Lines Matching refs:buf

132 #define xvsnprintf(buf,size,fmt,args)  _vsnprintf_s(buf,size,_TRUNCATE,fmt,args)  argument
327 #define BBUF_INIT(buf,size) onig_bbuf_init((BBuf* )(buf), (size)) argument
329 #define BBUF_SIZE_INC(buf,inc) do{\ argument
330 (buf)->alloc += (inc);\
331 (buf)->p = (UChar* )xrealloc((buf)->p, (buf)->alloc);\
332 if (IS_NULL((buf)->p)) return(ONIGERR_MEMORY);\
335 #define BBUF_EXPAND(buf,low) do{\ argument
336 do { (buf)->alloc *= 2; } while ((buf)->alloc < (unsigned int )low);\
337 (buf)->p = (UChar* )xrealloc((buf)->p, (buf)->alloc);\
338 if (IS_NULL((buf)->p)) return(ONIGERR_MEMORY);\
341 #define BBUF_ENSURE_SIZE(buf,size) do{\ argument
342 unsigned int new_alloc = (buf)->alloc;\
344 if ((buf)->alloc != new_alloc) {\
345 (buf)->p = (UChar* )xrealloc((buf)->p, new_alloc);\
346 if (IS_NULL((buf)->p)) return(ONIGERR_MEMORY);\
347 (buf)->alloc = new_alloc;\
351 #define BBUF_WRITE(buf,pos,bytes,n) do{\ argument
353 if ((buf)->alloc < (unsigned int )used) BBUF_EXPAND((buf),used);\
354 xmemcpy((buf)->p + (pos), (bytes), (n));\
355 if ((buf)->used < (unsigned int )used) (buf)->used = used;\
358 #define BBUF_WRITE1(buf,pos,byte) do{\ argument
360 if ((buf)->alloc < (unsigned int )used) BBUF_EXPAND((buf),used);\
361 (buf)->p[(pos)] = (byte);\
362 if ((buf)->used < (unsigned int )used) (buf)->used = used;\
365 #define BBUF_ADD(buf,bytes,n) BBUF_WRITE((buf),(buf)->used,(bytes),(n)) argument
366 #define BBUF_ADD1(buf,byte) BBUF_WRITE1((buf),(buf)->used,(byte)) argument
367 #define BBUF_GET_ADD_ADDRESS(buf) ((buf)->p + (buf)->used) argument
368 #define BBUF_GET_OFFSET_POS(buf) ((buf)->used) argument
371 #define BBUF_MOVE_RIGHT(buf,from,to,n) do {\ argument
372 if ((unsigned int )((to)+(n)) > (buf)->alloc) BBUF_EXPAND((buf),(to) + (n));\
373 xmemmove((buf)->p + (to), (buf)->p + (from), (n));\
374 if ((unsigned int )((to)+(n)) > (buf)->used) (buf)->used = (to) + (n);\
378 #define BBUF_MOVE_LEFT(buf,from,to,n) do {\ argument
379 xmemmove((buf)->p + (to), (buf)->p + (from), (n));\
383 #define BBUF_MOVE_LEFT_REDUCE(buf,from,to) do {\ argument
384 xmemmove((buf)->p + (to), (buf)->p + (from), (buf)->used - (from));\
385 (buf)->used -= (from - to);\
388 #define BBUF_INSERT(buf,pos,bytes,n) do {\ argument
389 if (pos >= (buf)->used) {\
390 BBUF_WRITE(buf,pos,bytes,n);\
393 BBUF_MOVE_RIGHT((buf),(pos),(pos) + (n),((buf)->used - (pos)));\
394 xmemcpy((buf)->p + (pos), (bytes), (n));\
398 #define BBUF_GET_BYTE(buf, pos) (buf)->p[(pos)] argument
765 extern void onig_snprintf_with_pattern PV_((UChar buf[], int bufsize, OnigEncoding enc, UChar* pat…
766 extern int onig_bbuf_init P_((BBuf* buf, int size));