mstring.h

Go to the documentation of this file.
00001 #ifndef MSTRING_H
00002 #define MSTRING_H
00003 
00021 #ifndef CTLSTRING_H
00022 #error This should be included from "ctl/ctlstring.h"
00023 #endif
00024 
00031 #define ctl_mstring(tchar,handler )                         ppConcat4(ctl_mstring_,tchar,_,handler)
00032 
00040 #define ctl_mstring_(tchar,handler,function )               ppConcat3(ctl_mstring(tchar,handler),_,function)
00041 
00042 
00043 
00045 #define ctl_mstring_xgrow(tchar,handler, xgrow )            ppConcat3(ctl_mstring_,handler,_xgrow)(tchar, xgrow )
00046 #define ctl_mstring_grow_xgrow(tchar, xgrow)                xgrow
00047 #define ctl_mstring_fixed_xgrow(tchar, xgrow)
00048 
00050 #define ctl_mstring_xfixed(tchar,handler, xfixed )          ppConcat3(ctl_mstring_,handler,_xfixed)(tchar, xfixed )
00051 #define ctl_mstring_grow_xfixed(tchar, xfixed)
00052 #define ctl_mstring_fixed_xfixed(tchar, xfixed)             xfixed
00053 
00055 #define ctl_mstring_cond(tchar,handler, xgrow, xfixed )     ppConcat3(ctl_mstring_,handler,_cond)(tchar, xgrow, xfixed )
00056 #define ctl_mstring_grow_cond(tchar, xgrow, xfixed)         xgrow
00057 #define ctl_mstring_fixed_cond(tchar, xgrow, xfixed)        xfixed
00058 
00084 #define ctldecl_ctl_mstring(tchar,handler ) \
00085 \
00089 typedef struct ctl_mstring(tchar,handler ) \
00090 {\
00091     tchar*          begin;  /* Beginning of string; always at least valid to read */\
00092     tchar*          end;    /* End of written string; always points at a NUL character, always [begin >= parse >= end] */\
00093     tchar*          endBuff;/* End of buffer available for string - begin+length; never really a valid location to read or write, but it's reserved by every init for a terminating NUL */\
00094 } ctl_mstring(tchar,handler );\
00095 \
00096 ctl_mstring_xgrow(tchar,handler, extern const tchar ctl_mstring_(tchar,handler,0)[1]; ) /* Needed for empty/growable string */\
00097 \
00098 void ctl_mstring_(tchar,handler, grow )( ctl_mstring(tchar,handler)* self, size_t addLen );\
00099 void ctl_mstring_(tchar,handler, fill )( ctl_mstring(tchar,handler)* self, tchar fillVal, size_t maxLen );\
00100 void ctl_mstring_(tchar,handler, filltab )( ctl_mstring(tchar,handler)* self, tchar fillVal, size_t tabPos );\
00101 void ctl_mstring_(tchar,handler, putint32 )( ctl_mstring(tchar,handler)* self, int32 value );\
00102 void ctl_mstring_(tchar,handler, putuint32 )( ctl_mstring(tchar,handler)* self, uint32 value );\
00103 void ctl_mstring_(tchar,handler, putint64 )( ctl_mstring(tchar,handler)* self, int64 value );\
00104 void ctl_mstring_(tchar,handler, putuint64 )( ctl_mstring(tchar,handler)* self, uint64 value );\
00105 void ctl_mstring_(tchar,handler, putfloat64 )( ctl_mstring(tchar,handler)* self, float64 value );\
00106 void ctl_mstring_(tchar,handler, putxuint32 )( ctl_mstring(tchar,handler)* self, uint32 value, size_t places );\
00107 void ctl_mstring_(tchar,handler, putxuint64 )( ctl_mstring(tchar,handler)* self, uint64 value, size_t places );\
00108 void ctl_mstring_(tchar,handler, putenum )( ctl_mstring(tchar,handler)* self, int value, const tchar* const* const szzList, int max, const tchar* szUndefined );\
00109 void ctl_mstring_(tchar,handler, strncat )( ctl_mstring(tchar,handler)* self, const tchar* sz, size_t maxLen );\
00110 void ctl_mstring_(tchar,handler, strncpy )( ctl_mstring(tchar,handler)* self, const tchar* sz, size_t maxLen );\
00111 void ctl_mstring_(tchar,handler, strninsert )( ctl_mstring(tchar,handler)* self, size_t position, const tchar* sz, size_t max );\
00112 void ctl_mstring_(tchar,handler, vsprintf )( ctl_mstring(tchar,handler)* self, const tchar* fmt, va_list args );\
00113 void ctl_mstring_(tchar,handler, sprintf )( ctl_mstring(tchar,handler)* self, const tchar* fmt, ... );\
00114 void ctl_mstring_(tchar,handler, makeClabel )( ctl_mstring(tchar,handler)* self );\
00115 void ctl_mstring_(tchar,handler, truncate )( ctl_mstring(tchar,handler)* self, size_t newsize );\
00116 int ctl_mstring_(tchar,handler, compare )( const ctl_mstring(tchar,handler)* p1, const ctl_mstring(tchar,handler)* p2 );\
00117 int ctl_mstring_(tchar,handler, rcompare )( const ctl_mstring(tchar,handler)* p1, const ctl_mstring(tchar,handler)* p2 );\
00118 int ctl_mstring_(tchar,handler, strncmp )( const ctl_mstring(tchar,handler)* p1, const tchar* p2, size_t lenp2 );\
00119 int ctl_mstring_(tchar,handler, strnicmp )( const ctl_mstring(tchar,handler)* p1, const tchar* p2, size_t lenp2 );\
00120 
00121 
00122 /* Declare functions that grow string when it runs out */
00123 ctldecl_ctl_mstring(char,grow)
00124 ctldecl_ctl_mstring(wchar_t,grow)
00125 
00126 /* Declare functions that abort output when it's too big */
00127 ctldecl_ctl_mstring(char,fixed)
00128 ctldecl_ctl_mstring(wchar_t,fixed)
00129 
00130 #endif /* MSTRING_H */
00131 

Generated on Fri Jan 2 15:28:34 2009 for Squat by  doxygen 1.5.6