Fixed ROBODoc header.
[runtime.git] / lib / silcutil / silctime.h
index a57830f6444a90006491b6866f5e30fa9f1b6097..4fc7e4b7527042f970aa2c0622b7887e962d18d3 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 2003 - 2007 Pekka Riikonen
+  Copyright (C) 2003 - 2008 Pekka Riikonen
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -17,7 +17,7 @@
 
 */
 
-/****h* silcutil/SILC Time Interface
+/****h* silcutil/Time Interface
  *
  * DESCRIPTION
  *
@@ -30,7 +30,7 @@
 #ifndef SILCTIME_H
 #define SILCTIME_H
 
-/****s* silcutil/SilcTimeAPI/SilcTime
+/****s* silcutil/SilcTime
  *
  * NAME
  *
@@ -43,8 +43,8 @@
  *
  * SOURCE
  *
- ***/
-typedef struct {
+ */
+typedef struct SilcTimeObject {
   unsigned int year       : 15;           /* Year,     0 - 32768 */
   unsigned int month      : 4;    /* Month,    1 - 12 */
   unsigned int day        : 5;    /* Day,      1 - 31 */
@@ -59,7 +59,20 @@ typedef struct {
 } *SilcTime, SilcTimeStruct;
 /***/
 
-/****f* silcutil/SilcTimeAPI/silc_time
+/****s* silcutil/SilcTimeStruct
+ *
+ * NAME
+ *
+ *    typedef struct { ... } *SilcTime, SilcTimeStruct;
+ *
+ * DESCRIPTION
+ *
+ *    This context represents time value.  It includes date and time
+ *    down to millisecond precision.  The structure size is 64 bits.
+ *
+ ***/
+
+/****f* silcutil/silc_time
  *
  * SYNOPSIS
  *
@@ -73,7 +86,7 @@ typedef struct {
  ***/
 SilcInt64 silc_time(void);
 
-/****f* silcutil/SilcTimeAPI/silc_time_msec
+/****f* silcutil/silc_time_msec
  *
  * SYNOPSIS
  *
@@ -87,7 +100,7 @@ SilcInt64 silc_time(void);
  ***/
 SilcInt64 silc_time_msec(void);
 
-/****f* silcutil/SilcTimeAPI/silc_time_usec
+/****f* silcutil/silc_time_usec
  *
  * SYNOPSIS
  *
@@ -101,7 +114,7 @@ SilcInt64 silc_time_msec(void);
  ***/
 SilcInt64 silc_time_usec(void);
 
-/****f* silcutil/SilcTimeAPI/silc_time_string
+/****f* silcutil/silc_time_string
  *
  * SYNOPSIS
  *
@@ -118,7 +131,7 @@ SilcInt64 silc_time_usec(void);
  ***/
 const char *silc_time_string(SilcInt64 time_val_sec);
 
-/****f* silcutil/SilcTimeAPI/silc_time_value
+/****f* silcutil/silc_time_value
  *
  * SYNOPSIS
  *
@@ -134,7 +147,26 @@ const char *silc_time_string(SilcInt64 time_val_sec);
  ***/
 SilcBool silc_time_value(SilcInt64 time_val_msec, SilcTime ret_time);
 
-/****f* silcutil/SilcTimeAPI/silc_time_universal
+/****f* silcutil/silc_timezone
+ *
+ * SYNOPSIS
+ *
+ *    SilcBool silc_timezone(char *timezone, SilcUInt32 timezone_size);
+ *
+ * DESCRIPTION
+ *
+ *    Returns current timezone in Universal time format into the `timezone'
+ *    buffer of size of `timezone_size'.  The possible values this function
+ *    returns are: Z (For UTC timezone), +hh (UTC + hours) -hh (UTC - hours),
+ *    +hh:mm (UTC + hours:minutes) or -hh:mm (UTC - hours:minutes).  The
+ *    returned values are always offsets to UTC.
+ *
+ *    Returns FALSE on error, TRUE otherwise.
+ *
+ ***/
+SilcBool silc_timezone(char *timezone, SilcUInt32 timezone_size);
+
+/****f* silcutil/silc_time_universal
  *
  * SYNOPSIS
  *
@@ -160,7 +192,7 @@ SilcBool silc_time_value(SilcInt64 time_val_msec, SilcTime ret_time);
  ***/
 SilcBool silc_time_universal(const char *universal_time, SilcTime ret_time);
 
-/****f* silcutil/SilcTimeAPI/silc_time_universal_string
+/****f* silcutil/silc_time_universal_string
  *
  * SYNOPSIS
  *
@@ -176,7 +208,7 @@ SilcBool silc_time_universal(const char *universal_time, SilcTime ret_time);
 SilcBool silc_time_universal_string(SilcTime time_val, char *ret_string,
                                    SilcUInt32 ret_string_size);
 
-/****f* silcutil/SilcTimeAPI/silc_time_generalized
+/****f* silcutil/silc_time_generalized
  *
  * SYNOPSIS
  *
@@ -207,7 +239,7 @@ SilcBool silc_time_universal_string(SilcTime time_val, char *ret_string,
 SilcBool
 silc_time_generalized(const char *generalized_time, SilcTime ret_time);
 
-/****f* silcutil/SilcTimeAPI/silc_time_generalized_string
+/****f* silcutil/silc_time_generalized_string
  *
  * SYNOPSIS
  *
@@ -224,23 +256,22 @@ silc_time_generalized(const char *generalized_time, SilcTime ret_time);
 SilcBool silc_time_generalized_string(SilcTime time_val, char *ret_string,
                                      SilcUInt32 ret_string_size);
 
-/****f* silcutil/SilcTimeAPI/silc_compare_timeval
+/****f* silcutil/silc_compare_timeval
  *
  * SYNOPSIS
  *
- *    SilcBool silc_compare_timeval(struct time_val *smaller,
- *                                  struct time_val *bigger)
+ *    int silc_compare_timeval(struct time_val *t1, struct time_val *t2);
  *
  * DESCRIPTION
  *
- *    Compare two timeval structures and return TRUE if the first
- *    time value is smaller than the second time value.
+ *    Compares `t1' and `t2' time structures and returns less than zero,
+ *    zero or more than zero when `t1' is smaller, equal or bigger than
+ *    `t2', respectively.
  *
  ***/
-SilcBool silc_compare_timeval(struct timeval *smaller,
-                             struct timeval *bigger);
+int silc_compare_timeval(struct timeval *t1, struct timeval *t2);
 
-/****f* silcutil/SilcTimeAPI/silc_gettimeofday
+/****f* silcutil/silc_gettimeofday
  *
  * SYNOPSIS
  *