pdf-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[pdf-devel] New functions for the Time Module


From: Aleksander Morgado
Subject: [pdf-devel] New functions for the Time Module
Date: Fri, 25 Jul 2008 20:52:42 +0200
User-agent: Thunderbird 2.0.0.16 (X11/20080724)

As requested some time ago, I added three new  functions in the API of
the Time Module, to easily initialize pdf_time_t variables with
unix-timescale epochs and w32-specific Filetime-timescale epochs
(http://msdn.microsoft.com/en-us/library/ms724290(VS.85).aspx).

Find attached the patch for the new API. If agreed by all, I'll start
the development tomorrow.

Cheers,
-Aleksander



# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: address@hidden
# target_branch: file:///home/aleksander/Development/libgnupdf_repo\
#   /trunk/
# testament_sha1: f98b1d78e68ddc250c7359b362c564c0073e6876
# timestamp: 2008-07-25 20:47:22 +0200
# base_revision_id: address@hidden
#
# Begin patch
=== modified file 'ChangeLog'
--- ChangeLog    2008-07-25 13:30:00 +0000
+++ ChangeLog    2008-07-25 18:46:20 +0000
@@ -1,3 +1,12 @@
+2008-07-25  Aleksander Morgado  <address@hidden>
+
+    * doc/gnupdf.texi (Platform-specific functions): New section including
+    the w32-specific `pdf_time_w32_set_from_filetime' function, to fastly
+    set the pdf_time_t to a given filetime-timescale epoch.
+    (Managing Time Values): New functions `pdf_time_set_from_i32' and
+    `pdf_time_set' in order to fastly set the pdf_time_t variable to a
given
+    unix-timescale epoch.
+
 2008-07-25  Jose E. Marchesi  <address@hidden>
 
     * src/base/pdf-list.h: Inline semantics in MacosX.

=== modified file 'doc/gnupdf.texi'
--- doc/gnupdf.texi    2008-07-18 07:41:04 +0000
+++ doc/gnupdf.texi    2008-07-25 18:46:20 +0000
@@ -4554,6 +4554,7 @@
 * Managing Time Span Values::
 * Time Span Comparison::
 * Calendar Spans Management::
+* Platform-specific functions::
 @end menu
 
 @node Time Related Data Types
@@ -4782,6 +4783,69 @@
 @end table
 @end deftypefun
 
+
address@hidden pdf_status_t pdf_time_set_from_i32 (pdf_time_t
@var{time_var}, pdf_i32_t @var{seconds})
+This function will initialize @var{time_var} to the given Unix time
(seconds since January 1st 1970).
+The time is represented as a 32-bit integer.
+
address@hidden @strong
address@hidden Parameters
address@hidden @var
address@hidden time_var
+The time variable to set. Should be a properly create time variable.
address@hidden seconds
+Seconds since January 1st 1970, 32-bit value.
address@hidden table
address@hidden Returns
+A status value:
address@hidden @code
address@hidden PDF_OK
+The operation succeeded.
address@hidden table
address@hidden Usage example
address@hidden
+pdf_time_t mytime;
+
+mytime = pdf_time_new ();
+
+pdf_time_set_from_i32(mytime, 1217009657);
+
address@hidden example
address@hidden table
address@hidden deftypefun
+
address@hidden pdf_status_t pdf_time_set (pdf_time_t @var{time_var},
pdf_i64_t @var{seconds})
+This function will initialize @var{time_var} to the given Unix time
(seconds since January 1st 1970).
+The time is represented as a pdf_i64_t integer.
+
address@hidden @strong
address@hidden Parameters
address@hidden @var
address@hidden time_var
+The time variable to set. Should be a properly create time variable.
address@hidden seconds
+Seconds since January 1st 1970, pdf_i64_t variable.
address@hidden table
address@hidden Returns
+A status value:
address@hidden @code
address@hidden PDF_OK
+The operation succeeded.
address@hidden table
address@hidden Usage example
address@hidden
+pdf_time_t mytime;
+pdf_i64_t  epoch = pdf_i64_new(0,1217009657);
+mytime = pdf_time_new ();
+
+pdf_time_set(mytime, epoch);
+
address@hidden example
address@hidden table
address@hidden deftypefun
+
+
+
 @deftypefun pdf_status_t pdf_time_add_cal_span (pdf_time_t
@var{time_var}, const struct pdf_time_cal_span_s address@hidden)
 Add the time span represented by the calendar span under the address in
@var{p_cal_span} to @var{time_var}.
 
@@ -5912,6 +5976,43 @@
 @end table
 @end deftypefun
 
address@hidden Platform-specific functions
address@hidden Platform-specific functions
+
address@hidden pdf_status_t pdf_time_w32_set_from_filetime (pdf_time_t
@var{time_var}, pdf_i64_t @var{filetime})
+This function will initialize @var{time_var} to the given Filetime
(100-nanosecond intervals since January 1st 1601).
+
+This function is only available in Windows OS.
+
address@hidden @strong
address@hidden Parameters
address@hidden @var
address@hidden time_var
+The time variable to set. Should be a properly create time variable.
address@hidden seconds
+100-nanosecond intervals since 1 January 1601, pdf_i64_t variable.
address@hidden table
address@hidden Returns
+A status value:
address@hidden @code
address@hidden PDF_OK
+The operation succeeded.
address@hidden table
address@hidden Usage example
address@hidden
+pdf_time_t mytime;
+pdf_i64_t filetime;
+mytime = pdf_time_new ();
+
+/* do stuff to get the File Time */
+
+pdf_time_w32_set_from_filetime(mytime, filetime);
+
address@hidden example
address@hidden table
address@hidden deftypefun
+
+
 
 @node The Filesystem Module
 @section The Filesystem Module

# Begin bundle
IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWVrqrkwAA1ffgGAwUff//38/
34D////6YAgPeOfe2KAO9qAUBQpRVAGkmmoNNAAGjNJpoAAAABoAAZIJkYpqeUPU9TQaAGnqA0AA
AaAA4yZNDEYmjAIwEwgDATTRpkaAYYkQ0kPSNG1PUbTKPU0NAAGg0AaAAG0kEVN5CepqfqnpBnpJ
6INDIGgNAA0ABFIQBGRMCNTAmTIm1T1HiE9TJ6QND1PQQ4IQzZ/evkqGzBQPmmTz+ypIAYfwAkzy
r1IyWViZQsvFhFMZNs9wxmdDRgNEHQbOlgWEI2aMty+i8JcuwZZCiRLgtaLn3ddnCcMghcKfcNEf
u30ZMlEzo0bD5TIpAKqAEboSZmGLUmYBiKXVQlXjBsp4nV+DBnhtLJbAMxRRTlm2mInFYqsBji23
GsusiDy5o6FSE8th1xfQuUVGApzHhhQvCBbqsehRECMhgQUQzlFJKmj7GQaIsmK2FkU5pTF1jcjg
QSQNKzQHBGl4cBjyzXo1NY+9li5oXBGFGC/9DQhi2Eqoyzsm/u1aGJkYGAXJLiK7iUONHoojic6o
6wAFHUnIEs3Wkyjk0a+YIY1ZG1aa4iwYnYa1hNvfvRdOggVQz1SqGogzb4wLANOifY2G46cB2z6A
1d1QFR/fQedb4MMjk2HIT9Be8Pb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