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 <glib.h>
26#include <time.h>
27
28#define MAX_MISMATCH 100
29
45
46void strtoupper(char *dest, const char *src);
47void strtolower(char *dest, const char *src);
48unsigned int uint_sqrt(unsigned int n);
49int navit_utf8_strcasecmp(const char *s1, const char *s2);
50char *str_escape(enum escape_mode mode, const char *in);
51char *strncpy_unescape(char *dest, const char *src, size_t n);
52int compare_name_systematic(const char *s1, const char *s2);
53GList *g_hash_to_list(GHashTable *h);
54GList *g_hash_to_list_keys(GHashTable *h);
55gchar *g_strconcat_printf(gchar *buffer, gchar *fmt, ...);
56#if defined(_WIN32) || defined(__CEGCC__) || defined(__APPLE__) || defined(HAVE_API_ANDROID)
57# if defined(_UNICODE)
58wchar_t *newSysString(const char *toconvert);
59# else
60char *newSysString(const char *toconvert);
61# endif
62#endif
63
64void square_shape_str(char *s);
65
66unsigned int iso8601_to_secs(char *iso8601);
67time_t mkgmtime(struct tm *pt);
68time_t iso8601_to_time(char *iso8601);
69char *time_to_iso8601(time_t time);
70char *current_to_iso8601(void);
71
72#if defined(_MSC_VER) || (!defined(HAVE_GETTIMEOFDAY) && defined(HAVE_API_WIN32_BASE))
73
74# include <winsock.h>
75
76int gettimeofday(struct timeval *time, void *);
77
78#endif
79
81char *shell_escape(char *arg);
84
86void spawn_process_init(void);
87
88void get_compass_direction(char *buffer, int angle, int mode);
89#endif
static double s1
Definition geod_for.c:26
static char * argv[]
Definition graphics_qt_qpainter.cpp:512
Definition mg.h:33
Definition maptool.h:171
Definition util.c:935
GList * g_hash_to_list(GHashTable *h)
Definition util.c:473
time_t mkgmtime(struct tm *pt)
Converts a tm structure to time_t
Definition util.c:805
int spawn_process_check_status(struct spawn_process_info *pi, int block)
Definition util.c:1145
char * strncpy_unescape(char *dest, const char *src, size_t n)
Copy a string from src to dest, unescaping characters.
Definition util.c:226
void strtoupper(char *dest, const char *src)
Definition util.c:45
GList * g_hash_to_list_keys(GHashTable *h)
Definition util.c:485
struct spawn_process_info * spawn_process(char **argv)
Definition util.c:1057
void spawn_process_init(void)
Definition util.c:1250
char * str_escape(enum escape_mode mode, const char *in)
Escape special characters from a string.
Definition util.c:132
unsigned int uint_sqrt(unsigned int n)
Fast compute of square root for unsigned ints.
Definition util.c:63
gchar * g_strconcat_printf(gchar *buffer, gchar *fmt,...)
Appends a formatted string and appends it to an existing one.
Definition util.c:505
char * time_to_iso8601(time_t time)
Converts time to ISO8601 format.
Definition util.c:902
escape_mode
Escape modes for function str_escape()
Definition util.h:33
@ escape_mode_html_apos
Definition util.h:39
@ escape_mode_html_gt
Definition util.h:41
@ escape_mode_string
Definition util.h:35
@ escape_mode_quote
Definition util.h:36
@ escape_mode_html
Definition util.h:42
@ escape_mode_html_quote
Definition util.h:38
@ escape_mode_html_amp
Definition util.h:37
@ escape_mode_html_lt
Definition util.h:40
@ escape_mode_none
Definition util.h:34
char * current_to_iso8601(void)
Outputs local system time in ISO 8601 format.
Definition util.c:920
unsigned int iso8601_to_secs(char *iso8601)
Converts an ISO 8601-style time string into epoch time.
Definition util.c:759
int compare_name_systematic(const char *s1, const char *s2)
Compares two name_systematic strings.
Definition util.c:382
void strtolower(char *dest, const char *src)
Definition util.c:51
int navit_utf8_strcasecmp(const char *s1, const char *s2)
Definition util.c:88
time_t iso8601_to_time(char *iso8601)
Converts an ISO 8601-style time string into time_t.
Definition util.c:840
void get_compass_direction(char *buffer, int angle, int mode)
Get printable compass direction from an angle.
Definition util.c:1277
char * shell_escape(char *arg)
Definition util.c:950
void spawn_process_info_free(struct spawn_process_info *pi)
Definition util.c:1213
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:678