navit 0.5.3-trunk
Loading...
Searching...
No Matches
util.h
Go to the documentation of this file.
1
20#ifndef NAVIT_types_H
21# define NAVIT_types_H
22
23# include "config.h"
24# include <ctype.h>
25# include <time.h>
26
27# define MAX_MISMATCH 100
28
44
45void strtoupper(char *dest, const char *src);
46void strtolower(char *dest, const char *src);
47unsigned int uint_sqrt(unsigned int n);
48int navit_utf8_strcasecmp(const char *s1, const char *s2);
49char *str_escape(enum escape_mode mode, const char *in);
50char *strncpy_unescape(char *dest, const char *src, size_t n);
51int compare_name_systematic(const char *s1, const char *s2);
52GList *g_hash_to_list(GHashTable *h);
53GList *g_hash_to_list_keys(GHashTable *h);
54gchar *g_strconcat_printf(gchar *buffer, gchar *fmt, ...);
55# if defined(_WIN32) || defined(__CEGCC__) || defined(__APPLE__) || defined(HAVE_API_ANDROID)
56# if defined(_UNICODE)
57wchar_t *newSysString(const char *toconvert);
58# else
59char *newSysString(const char *toconvert);
60# endif
61# endif
62
63void square_shape_str(char *s);
64
65unsigned int iso8601_to_secs(char *iso8601);
66time_t mkgmtime(struct tm *pt);
67time_t iso8601_to_time(char *iso8601);
68char *time_to_iso8601(time_t time);
69char *current_to_iso8601(void);
70
71# if defined(_MSC_VER) || (!defined(HAVE_GETTIMEOFDAY) && defined(HAVE_API_WIN32_BASE))
72
73# include <winsock.h>
74
75int gettimeofday(struct timeval *time, void *);
76
77# endif
78
80char *shell_escape(char *arg);
83
85void spawn_process_init(void);
86
87#endif
88
89void get_compass_direction(char *buffer, int angle, int mode);
static double s1
Definition geod_for.c:27
static char * argv[]
Definition graphics_qt_qpainter.cpp:512
Definition mg.h:33
Definition maptool.h:173
Definition util.c:929
GList * g_hash_to_list(GHashTable *h)
Definition util.c:463
time_t mkgmtime(struct tm *pt)
Converts a tm structure to time_t
Definition util.c:799
int spawn_process_check_status(struct spawn_process_info *pi, int block)
Definition util.c:1142
char * strncpy_unescape(char *dest, const char *src, size_t n)
Copy a string from src to dest, unescaping characters.
Definition util.c:217
void strtoupper(char *dest, const char *src)
Definition util.c:41
GList * g_hash_to_list_keys(GHashTable *h)
Definition util.c:475
struct spawn_process_info * spawn_process(char **argv)
Definition util.c:1054
void spawn_process_init(void)
Definition util.c:1247
char * str_escape(enum escape_mode mode, const char *in)
Escape special characters from a string.
Definition util.c:127
unsigned int uint_sqrt(unsigned int n)
Fast compute of square root for unsigned ints.
Definition util.c:59
gchar * g_strconcat_printf(gchar *buffer, gchar *fmt,...)
Appends a formatted string and appends it to an existing one.
Definition util.c:495
char * time_to_iso8601(time_t time)
Converts time to ISO8601 format.
Definition util.c:896
escape_mode
Escape modes for function str_escape()
Definition util.h:32
@ escape_mode_html_apos
Definition util.h:38
@ escape_mode_html_gt
Definition util.h:40
@ escape_mode_string
Definition util.h:34
@ escape_mode_quote
Definition util.h:35
@ escape_mode_html
Definition util.h:41
@ escape_mode_html_quote
Definition util.h:37
@ escape_mode_html_amp
Definition util.h:36
@ escape_mode_html_lt
Definition util.h:39
@ escape_mode_none
Definition util.h:33
char * current_to_iso8601(void)
Outputs local system time in ISO 8601 format.
Definition util.c:914
unsigned int iso8601_to_secs(char *iso8601)
Converts an ISO 8601-style time string into epoch time.
Definition util.c:753
int compare_name_systematic(const char *s1, const char *s2)
Compares two name_systematic strings.
Definition util.c:372
void strtolower(char *dest, const char *src)
Definition util.c:47
int navit_utf8_strcasecmp(const char *s1, const char *s2)
Definition util.c:84
time_t iso8601_to_time(char *iso8601)
Converts an ISO 8601-style time string into time_t.
Definition util.c:834
void get_compass_direction(char *buffer, int angle, int mode)
Get printable compass direction from an angle.
Definition util.c:1274
char * shell_escape(char *arg)
Definition util.c:945
void spawn_process_info_free(struct spawn_process_info *pi)
Definition util.c:1210
void square_shape_str(char *s)
Optimizes the format of a string, adding carriage returns so that when displayed, the result text zon...
Definition util.c:673