/simpletypesystem/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk

« back to all changes in this revision

Viewing changes to libssts/utils.h

  • Committer: Gustav Hartvigsson
  • Date: 2015-10-24 19:55:57 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20151024195557-lpmkc68r52x4t63h
* General cleanup/make it pritty.
* Added s_dynamic_array_append.
* Implimented the new Error System w/ error domains.
* Added s_string_is_equal
* changed char to schar here and there.
TODO:
  Change the tests to match the new error system.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
 * @addtogroup Utils
39
39
 * @{
40
40
 * A collect of utility functions.
41
 
 * 
 
41
 *
42
42
 */
43
43
 
44
44
/**
56
56
 *
57
57
 * The restulting string must be freed by caller.
58
58
 */
59
 
char *
60
 
s_string_new_fmt (const char * format, ...);
 
59
schar *
 
60
s_string_new_fmt (const schar * format, ...);
61
61
 
62
62
 
63
63
/**
65
65
 *
66
66
 * The restulting string must be freed by caller
67
67
 */
68
 
char *
69
 
s_string_new_with_len (const char * s, size_t len);
 
68
schar *
 
69
s_string_new_with_len (const schar * s, size_t len);
 
70
 
 
71
/**
 
72
 * Are the strings equal?
 
73
 * @returns TRUE if a and b are equal.
 
74
 * @returns FALSE if the strings are not equal.
 
75
 */
 
76
sboolean
 
77
s_string_is_equal (const schar * a, const schar * b);
70
78
 
71
79
/**
72
80
 * Convert a wide (32 bit per char) string to a byte string.
76
84
 *       Unicode strings, but we do not real checking of unicode validity,
77
85
 *       and we have no formal support for Unicode above the basics.
78
86
 */
79
 
char *
 
87
schar *
80
88
s_ustring_to_string (const suchar * us);
81
89
 
82
90
 
86
94
 *             your own sanity.
87
95
 */
88
96
DEPRECATED
89
 
char *
 
97
schar *
90
98
s_wstring_to_string (const wchar_t * ws);
91
99
 
92
100
 
95
103
 *
96
104
 * The restulting string must be freed by caller.
97
105
 */
98
 
char *
 
106
schar *
99
107
s_current_time (void);
100
108
 
101
109
/* strdup is not ISO C, so we have to declare it somewhare, this should work
130
138
  #define s_dbg_print(M, ...)\
131
139
    fprintf (stdout, YELLOW "[DEBUG][%s:%d] " M RESET "\n", __FILE__, __LINE__, ##__VA_ARGS__)
132
140
#else
133
 
  #define s_dbg_print(M, ...) 
 
141
  #define s_dbg_print(M, ...)
134
142
#endif
135
143
 
136
144
/**