00001 #ifndef _STRINGBUF_H_ 00002 #define _STRINGBUF_H_ 00003 00008 typedef /*@abstract@*/ struct StringBufRec *StringBuf; 00009 00010 #ifdef __cplusplus 00011 extern "C" { 00012 #endif 00013 00014 /*@only@*/ StringBuf newStringBuf(void); 00015 void freeStringBuf( /*@only@*/ StringBuf sb); 00016 void truncStringBuf(StringBuf sb); 00017 /*@observer@*/ char *getStringBuf(StringBuf sb); 00018 void stripTrailingBlanksStringBuf(StringBuf sb); 00019 00020 #define appendStringBuf(sb, s) appendStringBufAux(sb, s, 0) 00021 #define appendLineStringBuf(sb, s) appendStringBufAux(sb, s, 1) 00022 00023 void appendStringBufAux(StringBuf sb, const char *s, int nl); 00024 00025 #ifdef __cplusplus 00026 } 00027 #endif 00028 00029 #endif /* _STRINGBUF_H_ */