summaryrefslogtreecommitdiffstats
path: root/app/ptb.h
diff options
context:
space:
mode:
Diffstat (limited to 'app/ptb.h')
-rw-r--r--app/ptb.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/ptb.h b/app/ptb.h
new file mode 100644
index 0000000..865cacf
--- /dev/null
+++ b/app/ptb.h
@@ -0,0 +1,5 @@
+
+#define PTB_INIT(b) int _ptb_len=0,_ptb_left=sizeof(b)-1; char * _ptb_ptr=b;
+#define PTB_ADD(a...) do { int _ptb_writ=snprintf(_ptb_ptr,_ptb_left,a ); if (_ptb_writ >=0 ) { _ptb_left-=_ptb_writ; _ptb_len+=_ptb_writ; _ptb_ptr+=_ptb_writ; } } while (0)
+#define PTB_LEN _ptb_len
+