/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: 2016-08-07 21:08:54 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20160807210854-esvxch63s29kr2kw
* Fixed s_base_16_enc
* started work on s_base_16_dec (have not figured out how why id is not working)
* fixed reverse table size issue (127 -> 128 elements)
* Added tests for Base 16 stuffs
* added s_string_len
* fixed? s_ustring_to_string
* added (do not know if it is working?) s_string_to_ustring
* commented out strdup
* removed mainloop tests from the standard test suite, sholud be run seperatly anyway.
* use libc for memory managment in the tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
sboolean
80
80
s_string_is_equal (const schar * a, const schar * b);
81
81
 
 
82
 
 
83
/**
 
84
 * Gets the length of a string.
 
85
 * Normally uses strlen under the hood.
 
86
 */
 
87
S_EXPORTED
 
88
size_t
 
89
s_string_len (const schar * str);
 
90
 
82
91
/**
83
92
 * Get the length of the uchar string.
84
93
 *
91
100
 
92
101
/**
93
102
 * Convert a wide (32 bit per char) string to a byte string.
94
 
 * TODO : Implement.
 
103
 *
 
104
 * @param us The uchar string to convert to a schar string.
95
105
 *
96
106
 * @note The name is a little misleading, this (should) work with
97
107
 *       Unicode strings, but we do not real checking of unicode validity,
103
113
 
104
114
 
105
115
/**
 
116
 * Convert (8bit per char) schar string to a (32bit per char) suchar string.
 
117
 *
 
118
 * @param str The schar string to convert to a suchar string.
 
119
 */
 
120
S_EXPORTED
 
121
suchar *
 
122
s_string_to_ustring (const schar * str);
 
123
 
 
124
 
 
125
/**
106
126
 * @deprecated Usage of this function is discouraged. Consider using uchar
107
127
 *             (char32_t) strings instead, and s_ustring_to_string(), for
108
128
 *             your own sanity.
112
132
schar *
113
133
s_wstring_to_string (const wchar_t * ws);
114
134
 
115
 
 
116
135
/**
117
136
 * Returns a C string with the current time (as run).
118
137
 *
122
141
schar *
123
142
s_current_time (void);
124
143
 
 
144
#if 0
125
145
/* strdup is not ISO C, so we have to declare it somewhare, this should work
126
146
 * even if we do not impliment the function ourselfs.
127
147
 *
129
149
 */
130
150
#define strdup(s) s_string_new(s)
131
151
 
 
152
#endif /* if 0 */
132
153
 
133
154
/** Just a standard print function. */
134
155
#define s_print(p, ...)\