By Harry Coin: make IsEmptyStr NULL-pointer-safe.
[citadel.git] / libcitadel / lib / libcitadel.h
index 00e84101870f5f2364c429f67d91204cab32c54b..d7da488f10c7a7ab48dbc265924b7da184f96417 100644 (file)
@@ -108,7 +108,7 @@ typedef enum _room_views {
 #define BLOG_EUIDBUF_SIZE      40
 
 #ifndef IsEmptyStr
-#define IsEmptyStr(a) ((a)[0] == '\0')
+#define IsEmptyStr(a) ( ( (a) == NULL ) || ((a)[0] == '\0') )
 #endif
 
 
@@ -346,9 +346,10 @@ typedef enum __eStreamType {
        eEmtyCodec
 } eStreamType;
 
-void *StrBufNewStreamContext(eStreamType type, const char **Err);
-int StrBufDestroyStreamContext(eStreamType type, void **Stream, const char **Err);
-int StrBufStreamTranscode(eStreamType type, IOBuffer *Target, IOBuffer *In, const char* pIn, long pInLen, void *Stream, int LastChunk, const char **Err);
+typedef struct vStreamT vStreamT;
+vStreamT *StrBufNewStreamContext(eStreamType type, const char **Err);
+int StrBufDestroyStreamContext(eStreamType type, vStreamT **Stream, const char **Err);
+int StrBufStreamTranscode(eStreamType type, IOBuffer *Target, IOBuffer *In, const char* pIn, long pInLen, vStreamT *Stream, int LastChunk, const char **Err);
 
 int StrBufDecodeBase64(StrBuf *Buf);
 int StrBufDecodeBase64To(const StrBuf *BufIn, StrBuf *BufOut);