pdf-devel
[Top][All Lists]
Advanced

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

Re: [pdf-devel] New functions for the Time Module


From: jemarch
Subject: Re: [pdf-devel] New functions for the Time Module
Date: Sat, 26 Jul 2008 14:55:25 +0200
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/23.0.60 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

   >    address@hidden pdf_status_t pdf_time_set_from_i32 (pdf_time_t
   >    @var{time_var}, pdf_i32_t @var{seconds})

   I was thinking in using `pdf_i64_assign_quick' internally, which takes a 
   signed 32-bit integer. We don't have an equivalent function for 
   pdf_u32_t. Or... we can use directly pdf_i64_assign(var,0,u32) true?
   I'll check it.

Ok, thanks.

   >    address@hidden pdf_status_t pdf_time_set (pdf_time_t @var{time_var},
   >    pdf_i64_t @var{seconds})
   > 
   > Why are we using signed values for the parameters?

   The same for pdf_i64_t. We don't have a pdf_u64_t, and I don't see any 
   easy hack for this.

Well, I think that a signed 64bit integer gives us enough range in the
time_t scale.

   > Also, I would name the second function as 'pdf_time_set_from_i64'. It
   > is more explicit.

   I was trying to follow the same way as with pdf_time_span_t, where we 
   have `pdf_time_span_set' to set from i64, and 
   `pdf_time_span_set_from_i32' for i32. But could even be a good idea 
   renaming also the `pdf_time_span_set' function to 
   `pdf_time_span_set_from_i64'.

The difference between both types is that for the spans the designed
API exposes the internals of the type: time span values are measured
in seconds. On the other hand the pdf_time_t type is more opaque: we
dont have the notion of an epoch (or any date used as a reference)
except for the calendar functions. That is the reason find
'pdf_time_set' confusing: we are introducing the concept of a
reference epoch, that is not used in the rest of the API.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]