Browse Source

- str formatting macro by Bogdan Pintea
closes SER-127

Jan Janak 19 years ago
parent
commit
374f5e864a
1 changed files with 3 additions and 0 deletions
  1. 3 0
      str.h

+ 3 - 0
str.h

@@ -40,4 +40,7 @@ typedef struct _str str;
 #define STR_STATIC_INIT(v) {(v), sizeof(v) - 1}
 #define STR_NULL {NULL, 0}
 
+#define STR_FMT(_pstr_)	\
+  ((_pstr_) ? (_pstr_)->len : 0), ((_pstr_) ? (_pstr_)->s : "")
+
 #endif