navit  0.5.3-trunk
util.h
Go to the documentation of this file.
1 
20 #ifndef NAVIT_types_H
21 #define NAVIT_types_H
22 
23 #include <ctype.h>
24 #include <time.h>
25 #include "config.h"
26 
27 #define MAX_MISMATCH 100
28 
42 };
43 
44 void strtoupper(char *dest, const char *src);
45 void strtolower(char *dest, const char *src);
46 unsigned int uint_sqrt(unsigned int n);
47 int navit_utf8_strcasecmp(const char *s1, const char *s2);
48 char *str_escape(enum escape_mode mode, const char *in);
49 char *strncpy_unescape(char *dest, const char *src, size_t n);
50 int compare_name_systematic(const char *s1, const char *s2);
51 GList * g_hash_to_list(GHashTable *h);
52 GList * g_hash_to_list_keys(GHashTable *h);
53 gchar * g_strconcat_printf(gchar *buffer, gchar *fmt, ...);
54 #if defined(_WIN32) || defined(__CEGCC__) || defined (__APPLE__) || defined(HAVE_API_ANDROID)
55 #if defined(_UNICODE)
56 wchar_t* newSysString(const char *toconvert);
57 #else
58 char * newSysString(const char *toconvert);
59 #endif
60 #endif
61 
62 void square_shape_str(char *s);
63 
64 unsigned int iso8601_to_secs(char *iso8601);
65 time_t mkgmtime(struct tm * pt);
66 time_t iso8601_to_time(char * iso8601);
67 char * time_to_iso8601(time_t time);
68 char * current_to_iso8601(void);
69 
70 #if defined(_MSC_VER) || (!defined(HAVE_GETTIMEOFDAY) && defined(HAVE_API_WIN32_BASE))
71 
72 #include <winsock.h>
73 
74 int gettimeofday(struct timeval *time, void *);
75 
76 #endif
77 
78 struct spawn_process_info;
79 char * shell_escape(char *arg);
80 struct spawn_process_info* spawn_process(char **argv);
82 
84 void spawn_process_init(void);
85 
86 #endif
87 
88 void 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
dest
Definition: startup.py:4
struct _GList GList
Definition: navit.h:30
Definition: mg.h:33
Definition: maptool.h:169
Definition: util.c:929
time_t mkgmtime(struct tm *pt)
Converts a tm structure to time_t
Definition: util.c:799
GList * g_hash_to_list(GHashTable *h)
Definition: util.c:463
int spawn_process_check_status(struct spawn_process_info *pi, int block)
Definition: util.c:1142
void strtoupper(char *dest, const char *src)
Definition: util.c:41
GList * g_hash_to_list_keys(GHashTable *h)
Definition: util.c:475
char * shell_escape(char *arg)
Definition: util.c:945
void spawn_process_init(void)
Definition: util.c:1247
gchar * g_strconcat_printf(gchar *buffer, gchar *fmt,...)
Appends a formatted string and appends it to an existing one.
Definition: util.c:495
unsigned int uint_sqrt(unsigned int n)
Fast compute of square root for unsigned ints.
Definition: util.c:59
struct spawn_process_info * spawn_process(char **argv)
Definition: util.c:1054
char * current_to_iso8601(void)
Outputs local system time in ISO 8601 format.
Definition: util.c:914
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
unsigned int iso8601_to_secs(char *iso8601)
Converts an ISO 8601-style time string into epoch time.
Definition: util.c:753
char * strncpy_unescape(char *dest, const char *src, size_t n)
Copy a string from src to dest, unescaping characters.
Definition: util.c:217
int compare_name_systematic(const char *s1, const char *s2)
Compares two name_systematic strings.
Definition: util.c:372
char * str_escape(enum escape_mode mode, const char *in)
Escape special characters from a string.
Definition: util.c:127
char * time_to_iso8601(time_t time)
Converts time to ISO8601 format.
Definition: util.c:896
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
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