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 <ctype.h>
24#include <time.h>
25#include "config.h"
26
27#define MAX_MISMATCH 100
28
43
44void strtoupper(char *dest, const char *src);
45void strtolower(char *dest, const char *src);
46unsigned int uint_sqrt(unsigned int n);
47int navit_utf8_strcasecmp(const char *s1, const char *s2);
48char *str_escape(enum escape_mode mode, const char *in);
49char *strncpy_unescape(char *dest, const char *src, size_t n);
50int compare_name_systematic(const char *s1, const char *s2);
51GList * g_hash_to_list(GHashTable *h);
52GList * g_hash_to_list_keys(GHashTable *h);
53gchar * g_strconcat_printf(gchar *buffer, gchar *fmt, ...);
54#if defined(_WIN32) || defined(__CEGCC__) || defined (__APPLE__) || defined(HAVE_API_ANDROID)
55#if defined(_UNICODE)
56wchar_t* newSysString(const char *toconvert);
57#else
58char * newSysString(const char *toconvert);
59#endif
60#endif
61
62void square_shape_str(char *s);
63
64unsigned int iso8601_to_secs(char *iso8601);
65time_t mkgmtime(struct tm * pt);
66time_t iso8601_to_time(char * iso8601);
67char * time_to_iso8601(time_t time);
68char * current_to_iso8601(void);
69
70#if defined(_MSC_VER) || (!defined(HAVE_GETTIMEOFDAY) && defined(HAVE_API_WIN32_BASE))
71
72#include <winsock.h>
73
74int gettimeofday(struct timeval *time, void *);
75
76#endif
77
79char * shell_escape(char *arg);
82
84void spawn_process_init(void);
85
86#endif
87
88void 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:169
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