Lines Matching refs:form
1239 static void checkformat (lua_State *L, const char *form, const char *flags, in checkformat() argument
1241 const char *spec = form + 1; /* skip '%' */ in checkformat()
1251 luaL_error(L, "invalid conversion specification: '%s'", form); in checkformat()
1260 char *form) { in getformat() argument
1267 *(form++) = '%'; in getformat()
1268 memcpy(form, strfrmt, len * sizeof(char)); in getformat()
1269 *(form + len) = '\0'; in getformat()
1277 static void addlenmod (char *form, const char *lenmod) { in addlenmod() argument
1278 size_t l = strlen(form); in addlenmod()
1280 char spec = form[l - 1]; in addlenmod()
1281 strcpy(form + l - 1, lenmod); in addlenmod()
1282 form[l + lm - 1] = spec; in addlenmod()
1283 form[l + lm] = '\0'; in addlenmod()
1302 char form[MAX_FORMAT]; /* to store the format ('%...') */ in str_format() local
1308 strfrmt = getformat(L, strfrmt, form); in str_format()
1311 checkformat(L, form, L_FMTFLAGSC, 0); in str_format()
1312 nb = l_sprintf(buff, maxitem, form, (int)luaL_checkinteger(L, arg)); in str_format()
1325 checkformat(L, form, flags, 1); in str_format()
1326 addlenmod(form, LUA_INTEGER_FRMLEN); in str_format()
1327 nb = l_sprintf(buff, maxitem, form, (LUAI_UACINT)n); in str_format()
1332 checkformat(L, form, L_FMTFLAGSF, 1); in str_format()
1333 addlenmod(form, LUA_NUMBER_FRMLEN); in str_format()
1334 nb = lua_number2strx(L, buff, maxitem, form, in str_format()
1343 checkformat(L, form, L_FMTFLAGSF, 1); in str_format()
1344 addlenmod(form, LUA_NUMBER_FRMLEN); in str_format()
1345 nb = l_sprintf(buff, maxitem, form, (LUAI_UACNUMBER)n); in str_format()
1350 checkformat(L, form, L_FMTFLAGSC, 0); in str_format()
1353 form[strlen(form) - 1] = 's'; /* format it as a string */ in str_format()
1355 nb = l_sprintf(buff, maxitem, form, p); in str_format()
1360 if (form[2] != '\0') /* modifiers? */ in str_format()
1368 if (form[2] == '\0') /* no modifiers? */ in str_format()
1372 checkformat(L, form, L_FMTFLAGSC, 1); in str_format()
1373 if (strchr(form, '.') == NULL && l >= 100) { in str_format()
1378 nb = l_sprintf(buff, maxitem, form, s); in str_format()
1385 return luaL_error(L, "invalid conversion '%s' to 'format'", form); in str_format()