Lines Matching refs:fmt
92 static int getnum (lua_State *L, const char **fmt, int df) { in getnum() argument
93 if (!isdigit(**fmt)) /* no number? */ in getnum()
98 if (a > (INT_MAX / 10) || a * 10 > (INT_MAX - (**fmt - '0'))) in getnum()
100 a = a*10 + *((*fmt)++) - '0'; in getnum()
101 } while (isdigit(**fmt)); in getnum()
111 static size_t optsize (lua_State *L, char opt, const char **fmt) { in optsize() argument
120 case 'c': return getnum(L, fmt, 1); in optsize()
122 int sz = getnum(L, fmt, sizeof(int)); in optsize()
148 static void controloptions (lua_State *L, int opt, const char **fmt, in controloptions() argument
155 int a = getnum(L, fmt, MAXALIGN); in controloptions()
210 const char *fmt = luaL_checkstring(L, 1); in b_pack() local
217 while (*fmt != '\0') { in b_pack()
218 int opt = *fmt++; in b_pack()
219 size_t size = optsize(L, opt, &fmt); in b_pack()
257 default: controloptions(L, opt, &fmt, &h); in b_pack()
295 const char *fmt = luaL_checkstring(L, 1); in b_unpack() local
301 while (*fmt) { in b_unpack()
302 int opt = *fmt++; in b_unpack()
303 size_t size = optsize(L, opt, &fmt); in b_unpack()
351 default: controloptions(L, opt, &fmt, &h); in b_unpack()
362 const char *fmt = luaL_checkstring(L, 1); in b_size() local
365 while (*fmt) { in b_size()
366 int opt = *fmt++; in b_size()
367 size_t size = optsize(L, opt, &fmt); in b_size()
374 controloptions(L, opt, &fmt, &h); in b_size()