/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 src/utils.c

  • Committer: Gustav Hartvigsson
  • Date: 2015-08-30 14:13:09 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20150830141309-kx9s3xdy4x2iegl9
* Readded s_wstring_to_string function*
  * added @depricated mark to the documentation.
  * added a warning to the function that it should not be used.

* Added FreeFunc to SMatrixRowInformation.
* Added function pointers to [from,to]_json functions to SMatrixRowInformation. 
* Added SMatrixRowInformation to SMatrix so we can do to/from JSON operations in the future, and better frees.

* Added UCHAR and USTIRNG to the S_TYPE enum and STypeName array.

* Created documentation group for Utils.

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
  return NULL;
70
70
}
71
71
 
72
 
#if 0
 
72
 
73
73
/*
74
74
 * This should not be used. If you need to use this, uncomment it.
75
75
 * I am conveting to something more sane than wchar_t.
76
76
 */
77
77
char *
78
78
s_wstring_to_string (const wchar_t * ws) {
 
79
  s_err_print ("Using depricated function: s_wstring_to_string ().\n"
 
80
               "Do not use s_wstring_to_string, as it is platform "
 
81
               "specific and may, or may not couse troubble.\n"
 
82
               "Use uchar strings instead of wchar_t strings, and "
 
83
               "use s_ustring_to_string instead of this.\n");
 
84
  
79
85
  size_t buflen;
80
86
  char * buffer;
81
87
  char * resized;
115
121
    if(! (resized = realloc (buffer, buflen)))
116
122
      goto err;
117
123
    buffer = resized;
118
 
    if((converted = c32rtomb (buffer + bufpos, &ws, buflen - bufpos, &mbstate))
 
124
    if((converted = wcsrtombs (buffer + bufpos, &ws, buflen - bufpos, &mbstate))
119
125
       == (size_t) -1)
120
126
      goto err;
121
127
    bufpos += converted;
136
142
  free(buffer);
137
143
  return NULL;
138
144
}
139
 
#endif
 
145
 
140
146