/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-09-08 13:10:20 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20160908131020-sljicwzlrlhjvxgq
* fiddeled with the test macros to make them easyer to read
* Fixed spelling mistakes in utils.h
* Added s_current_time_full ()

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
 */
42
42
 
43
43
/**
44
 
 * Creats a new C string with the correct length from a long string.
 
44
 * Creates a new C string with the correct length from a long string.
45
45
 * This may be a costly operation.
46
46
 *
47
 
 * The restulting string must be freed by caller.
 
47
 * The resulting string must be freed by caller.
48
48
 */
49
49
S_EXPORTED
50
50
char *
51
51
s_string_new (const char * s);
52
52
 
53
53
/**
54
 
 * Creats a new C string with the correct length using standard fprint style
 
54
 * Creates a new C string with the correct length using standard fprint style
55
55
 * format.
56
56
 *
57
 
 * The restulting string must be freed by caller.
 
57
 * The resulting string must be freed by caller.
58
58
 */
59
59
S_EXPORTED
60
60
schar *
64
64
/**
65
65
 * Same as s_string_new, but with a set length.
66
66
 *
67
 
 * The restulting string must be freed by caller
 
67
 * The resulting string must be freed by caller
68
68
 */
69
69
S_EXPORTED
70
70
schar *
135
135
/**
136
136
 * Returns a C string with the current time (as run).
137
137
 *
138
 
 * The restulting string must be freed by caller.
 
138
 * The resulting string must be freed by caller.
139
139
 */
140
140
S_EXPORTED
141
141
schar *
142
142
s_current_time (void);
143
143
 
 
144
/**
 
145
 * Returns a C string with the current time, millisecond and timezone
 
146
 * information.
 
147
 *
 
148
 * The resulting string must be freed by caller.
 
149
 */
 
150
S_EXPORTED
 
151
schar *
 
152
s_current_time_full (void);
 
153
 
144
154
#if 0
145
 
/* strdup is not ISO C, so we have to declare it somewhare, this should work
146
 
 * even if we do not impliment the function ourselfs.
 
155
/* strdup is not ISO C, so we have to declare it somewhere, this should work
 
156
 * even if we do not implement the function ourself.
147
157
 *
148
 
 * This just to supress a compiler warning.
 
158
 * This just to suppress a compiler warning.
149
159
 */
150
160
#define strdup(s) s_string_new(s)
151
161