![]() |
![]() |
![]() |
Kipinä Internals Reference Manual | ![]() |
---|---|---|---|---|
#define NOT_NULL (x) enum KPTod; gboolean kp_date_valid (KPDate *date); void kp_date_set_time (KPDate *date, GTime time_); KPDate* kp_date_new_dmy (guint d, guint m, guint y); void kp_date_free (KPDate *date); gboolean kp_date_to_locale_string (KPDate *date, gchar *buf, size_t len); gboolean kp_date_dmy_to_locale_string (guint d, guint m, guint y, gchar *buf, size_t len); void kp_date_from_gdate (KPDate *date, GDate *gdate); void kp_time_set_hms (KPTime *t, guint h, guint m, guint s); void kp_date_set_dmy (KPDate *date, guint d, guint m, guint y); guint kp_date_get_iso8061_week_of_year (KPDate *date); void kp_time_set_tod (KPTime *t, KPTod tod); gboolean kp_time_is_tod (KPTime *t, KPTod *tod); gchar* kp_time_tod_to_string (KPTime *time); gchar* kp_date_seconds_to_string (gdouble sec); gchar* kp_date_mseconds_to_std_string (guint32 msec); gint32 kp_duration_str_to_ms (const gchar *time_str); gboolean kp_is_valid_date_str (const gchar *date_str); gboolean kp_is_valid_time_str (const gchar *time_str); gboolean kp_is_valid_number (const gchar *possible_number); gdouble kp_number (const gchar*); gdouble kp_is_valid_duration_entry_str (const gchar *time_str); GValue* kp_g_value_from_string (const gchar *string); gchar* kp_g_value_to_string (const GValue *value); guint kp_get_month_len (guint m, gboolean is_leap); gboolean kp_leap (guint year); gboolean kp_week_of_year (guint *week, guint *year, guint mm, guint dd); glong kp_calc_days (guint year, guint mm, guint dd); guint kp_day_of_week (guint year, guint mm, guint dd); glong kp_dates_difference (guint year1, guint mm1, guint dd1, guint year2, guint mm2, guint dd2); guint kp_weeks_in_year (guint year); void kp_print_debug_string (const gchar *file, const gchar *function, guint line, const gchar *message, ...); gint kp_get_month_num (const gchar *m); const gchar* kp_get_month_name (guint m); guint kp_month_num_by_year_day_number (guint day_num, gboolean is_leap); void kp_autoscale_axis (gdouble *min, gdouble *max); #define KP_TAG_MATCH (node,tagname) #define kp_debug (...)
gboolean kp_date_valid (KPDate *date);
Checks if this DMY is valid julian day.
date : |
A KPDate |
Returns : | TRUE if date is valid and FALSE otherwise. |
void kp_date_set_time (KPDate *date, GTime time_);
Used to create
date : |
KPDate |
time_ : |
time value, just like time_t |
KPDate* kp_date_new_dmy (guint d, guint m, guint y);
Just create a new KPDate.
d : |
Day |
m : |
Month (1-12) |
y : |
Year |
Returns : | New KPDate |
gboolean kp_date_to_locale_string (KPDate *date, gchar *buf, size_t len);
date : |
|
buf : |
|
len : |
|
Returns : |
gboolean kp_date_dmy_to_locale_string (guint d, guint m, guint y, gchar *buf, size_t len);
d : |
|
m : |
|
y : |
|
buf : |
|
len : |
|
Returns : |
void kp_date_set_dmy (KPDate *date, guint d, guint m, guint y);
date : |
|
d : |
|
m : |
|
y : |
guint kp_date_get_iso8061_week_of_year (KPDate *date);
date : |
|
Returns : |
gchar* kp_time_tod_to_string (KPTime *time);
Turns tod to string presentation if the time is one of the tods recognized.
time : |
A KPTime |
Returns : | Newly-allocated string or NULL |
gchar* kp_date_mseconds_to_std_string (guint32 msec);
msec : |
|
Returns : |
gboolean kp_is_valid_number (const gchar *possible_number);
Find out if the string contains some numeric data.
possible_number : |
String that may contain a valid numeric value |
Returns : | TRUE if string contains numeric data only and FALSE otherwise. |
gdouble kp_number (const gchar*);
Try to parse a string to a double.
Param1 : |
|
Returns : | The double value if possible_number is
valid and -1.0 otherwise.
|
gdouble kp_is_valid_duration_entry_str (const gchar *time_str);
time_str : |
|
Returns : |
GValue* kp_g_value_from_string (const gchar *string);
Tries to guess what kind of value that string represents and allocates space for the structure and initializes it with the correct value.
string : |
A string that contains some value |
Returns : | A pointer to GValue that must be freed. |
gchar* kp_g_value_to_string (const GValue *value);
Transform a GValue to a string presentation to show it to the user for example.
value : |
Pointer to GValue that is initialized |
Returns : | A newly-allocated string that must be freed. |
guint kp_get_month_len (guint m, gboolean is_leap);
Get number of days in the month.
m : |
Number of the month (0-11) |
is_leap : |
TRUE if the year which the month is in, is a leap year |
Returns : | Number of the days or 0 if month number is invalid. |
gboolean kp_week_of_year (guint *week, guint *year, guint mm, guint dd);
week : |
|
year : |
|
mm : |
|
dd : |
|
Returns : |
glong kp_dates_difference (guint year1, guint mm1, guint dd1, guint year2, guint mm2, guint dd2);
year1 : |
|
mm1 : |
|
dd1 : |
|
year2 : |
|
mm2 : |
|
dd2 : |
|
Returns : |
void kp_print_debug_string (const gchar *file, const gchar *function, guint line, const gchar *message, ...);
file : |
|
function : |
|
line : |
|
message : |
|
... : |
gint kp_get_month_num (const gchar *m);
Get number of the month.
m : |
localized month name. |
Returns : | The number of the month between 0 and 11 or -1 if the month is invalid. |
const gchar* kp_get_month_name (guint m);
Get localized month name.
m : |
month number between 0 and 11 |
Returns : | Static string that must not be freed or
NULL if m is invalid.
|
guint kp_month_num_by_year_day_number (guint day_num, gboolean is_leap);
Return the month that some day number is in.
day_num : |
Number of day between 1-366 |
is_leap : |
TRUE if the year is a leap year and FALSE otherwise |
Returns : | Month number between 1 and 12 or 0 if params are invalid. |
#define KP_TAG_MATCH(node,tagname) (xmlStrcasecmp(((xmlNodePtr)node)->name,(xmlChar *)tagname) == 0)
node : |
|
tagname : |