#include <stddef.h>#include <string.h>#include <sys/types.h>#include <stdarg.h>#include <stdlib.h>#include <ctype.h>Go to the source code of this file.
Defines | |
| #define | NULL 0 |
| #define | LDOUBLE double |
| #define | LLONG long |
| #define | VA_COPY(dest, src) (dest) = (src) |
| #define | DP_S_DEFAULT 0 |
| #define | DP_S_FLAGS 1 |
| #define | DP_S_MIN 2 |
| #define | DP_S_DOT 3 |
| #define | DP_S_MAX 4 |
| #define | DP_S_MOD 5 |
| #define | DP_S_CONV 6 |
| #define | DP_S_DONE 7 |
| #define | DP_F_MINUS (1 << 0) |
| #define | DP_F_PLUS (1 << 1) |
| #define | DP_F_SPACE (1 << 2) |
| #define | DP_F_NUM (1 << 3) |
| #define | DP_F_ZERO (1 << 4) |
| #define | DP_F_UP (1 << 5) |
| #define | DP_F_UNSIGNED (1 << 6) |
| #define | DP_C_SHORT 1 |
| #define | DP_C_LONG 2 |
| #define | DP_C_LDOUBLE 3 |
| #define | DP_C_LLONG 4 |
| #define | char_to_int(p) ((p)- '0') |
| #define | MAX(p, q) (((p) >= (q)) ? (p) : (q)) |
| #define | vsnprintf smb_vsnprintf |
| #define | snprintf smb_snprintf |
Functions | |
| static size_t | dopr (char *buffer, size_t maxlen, const char *format, va_list args_in) |
| static void | fmtstr (char *buffer, size_t *currlen, size_t maxlen, char *value, int flags, int min, int max) |
| static void | fmtint (char *buffer, size_t *currlen, size_t maxlen, long value, int base, int min, int max, int flags) |
| static void | fmtfp (char *buffer, size_t *currlen, size_t maxlen, LDOUBLE fvalue, int min, int max, int flags) |
| static void | dopr_outch (char *buffer, size_t *currlen, size_t maxlen, char c) |
| static LDOUBLE | abs_val (LDOUBLE value) |
| static LDOUBLE | POW10 (int exp) |
| static LLONG | ROUND (LDOUBLE value) |
| static double | my_modf (double x0, double *iptr) |
| int | smb_vsnprintf (char *str, size_t count, const char *fmt, va_list args) |
| int | smb_snprintf (char *str, size_t count, const char *fmt,...) |
| int | vasprintf (char **ptr, const char *format, va_list ap) |
| int | asprintf (char **ptr, const char *format,...) |
| #define DP_C_LDOUBLE 3 |
| #define DP_C_LLONG 4 |
| #define DP_C_LONG 2 |
| #define DP_C_SHORT 1 |
| #define DP_F_MINUS (1 << 0) |
| #define DP_F_NUM (1 << 3) |
| #define DP_F_PLUS (1 << 1) |
| #define DP_F_SPACE (1 << 2) |
| #define DP_F_UNSIGNED (1 << 6) |
| #define DP_F_UP (1 << 5) |
| #define DP_F_ZERO (1 << 4) |
| #define DP_S_CONV 6 |
| #define DP_S_DEFAULT 0 |
| #define DP_S_DONE 7 |
| #define DP_S_DOT 3 |
| #define DP_S_FLAGS 1 |
| #define DP_S_MAX 4 |
| #define DP_S_MIN 2 |
| #define DP_S_MOD 5 |
| #define LDOUBLE double |
| #define LLONG long |
| #define NULL 0 |
Definition at line 94 of file snprintf.c.
Referenced by _glewStrCLen(), _glewStrLen(), _glewStrSame(), _glewStrSame1(), _glewStrSame2(), _glewStrSame3(), ARGParser::addEntry(), ARGParser::addNonParamEntry(), adjust_varargs(), Arith(), asprintf(), atomic(), aux_upvalue(), auxgetinfo(), auxupvalue(), close_func(), collectargs(), collectvalidlines(), MeshLODVector::computeEdgeCostAtVertex(), correctstack(), GLTexture::create(), GLTexture::createBufferTexture(), createmeta(), createScorchedWindow(), db_gethook(), db_sethook(), S3D::dialogMessage(), doargs(), dotty(), Water2Patch::draw(), LandVisibilityPatch::draw(), VisibilityPatchGrid::drawWater(), DumpFunction(), DumpString(), end_capture(), exprstat(), f_flush(), f_seek(), f_setvbuf(), findfile(), findlocal(), g_iofile(), g_read(), g_write(), gctm(), GCTM(), generic_reader(), get_compTM(), get_prompt(), getF(), getfreepos(), getfuncname(), getiofile(), Keyboard::getkeyboardbuffer(), getluaproto(), getobjname(), SecureID::GetPrivateKey(), getS(), glewGetString(), glxewGetExtension(), gmatch_aux(), handle_luainit(), handle_script(), indexupvalue(), io_fclose(), io_flush(), io_gc(), io_lines(), io_open(), io_pclose(), io_popen(), io_readline(), io_tmpfile(), io_tostring(), io_type(), l_alloc(), ll_load(), ll_loadfunc(), ll_module(), ll_register(), ll_sym(), llex(), lmemfind(), LoadConstants(), LoadDebug(), loader_C(), loader_Croot(), loader_Lua(), ImagePng::loadFromBuffer(), LoadFunction(), LoadString(), lstop(), lua_close(), lua_getinfo(), lua_getmetatable(), lua_newstate(), lua_pushstring(), lua_sethook(), lua_setmetatable(), lua_tocfunction(), lua_tolstring(), lua_topointer(), lua_tothread(), lua_touserdata(), luaB_collectgarbage(), luaB_dofile(), luaB_load(), luaB_loadfile(), luaB_print(), luaC_fullgc(), luaC_separateudata(), luaE_freethread(), luaF_close(), luaF_findupval(), luaF_getlocalname(), luaF_newLclosure(), luaF_newproto(), luaG_aritherror(), luaG_typeerror(), luaH_new(), luaI_openlib(), luaL_argerror(), luaL_checkudata(), luaL_findtable(), luaL_gsub(), luaL_loadfile(), luaL_newstate(), luaM_realloc_(), luaM_toobig(), luaO_pushvfstring(), luaopen_package(), luaS_newlstr(), luaS_newudata(), luaS_resize(), luaT_gettm(), luaU_dump(), luaV_equalval(), luaV_gettable(), luaV_settable(), luaV_tonumber(), luaX_setinput(), luaY_parser(), luaZ_fill(), luaZ_init(), main(), markroot(), match(), match_capture(), matchbalance(), max_expand(), min_expand(), modinit(), newfile(), newkey(), open_func(), os_date(), os_execute(), os_setlocale(), os_time(), pmain(), preinit_state(), print_version(), PrintUpvalues(), pushclosure(), pushnexttemplate(), read_line(), readable(), FileList::readFiles(), DisplayFrame::refreshResolutions(), registerlocalvar(), report(), resetstack(), runargs(), scanformat(), setnodevector(), setpath(), showMainDialog(), singlestep(), singlevaraux(), NetServerTCP3::start(), NetServerTCP2::start(), NetServerTCP::start(), start_capture(), str_find_aux(), sweeplist(), test_eof(), tofile(), traversetable(), vasprintf(), and ImagePng::writeToBuffer().
| #define snprintf smb_snprintf |
Definition at line 831 of file snprintf.c.
| #define vsnprintf smb_vsnprintf |
Definition at line 811 of file snprintf.c.
| static LDOUBLE abs_val | ( | LDOUBLE | value | ) | [static] |
| int asprintf | ( | char ** | ptr, | |
| const char * | format, | |||
| ... | ||||
| ) |
| static size_t dopr | ( | char * | buffer, | |
| size_t | maxlen, | |||
| const char * | format, | |||
| va_list | args_in | |||
| ) | [static] |
Definition at line 193 of file snprintf.c.
References char_to_int, dopr_outch(), DP_C_LDOUBLE, DP_C_LLONG, DP_C_LONG, DP_C_SHORT, DP_F_MINUS, DP_F_NUM, DP_F_PLUS, DP_F_SPACE, DP_F_UNSIGNED, DP_F_UP, DP_F_ZERO, DP_S_CONV, DP_S_DEFAULT, DP_S_DONE, DP_S_DOT, DP_S_FLAGS, DP_S_MAX, DP_S_MIN, DP_S_MOD, fmtfp(), fmtint(), fmtstr(), LDOUBLE, LLONG, LangStringUtil::strlen(), and VA_COPY.
Referenced by smb_vsnprintf().
| static void dopr_outch | ( | char * | buffer, | |
| size_t * | currlen, | |||
| size_t | maxlen, | |||
| char | c | |||
| ) | [static] |
| static void fmtfp | ( | char * | buffer, | |
| size_t * | currlen, | |||
| size_t | maxlen, | |||
| LDOUBLE | fvalue, | |||
| int | min, | |||
| int | max, | |||
| int | flags | |||
| ) | [static] |
Definition at line 647 of file snprintf.c.
References abs_val(), dopr_outch(), DP_F_MINUS, DP_F_PLUS, DP_F_SPACE, DP_F_UP, DP_F_ZERO, int(), my_modf(), POW10(), and ROUND().
Referenced by dopr().
| static void fmtint | ( | char * | buffer, | |
| size_t * | currlen, | |||
| size_t | maxlen, | |||
| long | value, | |||
| int | base, | |||
| int | min, | |||
| int | max, | |||
| int | flags | |||
| ) | [static] |
Definition at line 494 of file snprintf.c.
References dopr_outch(), DP_F_MINUS, DP_F_PLUS, DP_F_SPACE, DP_F_UNSIGNED, DP_F_UP, DP_F_ZERO, MAX, and uvalue.
Referenced by dopr().
| static void fmtstr | ( | char * | buffer, | |
| size_t * | currlen, | |||
| size_t | maxlen, | |||
| char * | value, | |||
| int | flags, | |||
| int | min, | |||
| int | max | |||
| ) | [static] |
Definition at line 456 of file snprintf.c.
References dopr_outch(), and DP_F_MINUS.
Referenced by dopr().
| static double my_modf | ( | double | x0, | |
| double * | iptr | |||
| ) | [static] |
| static LDOUBLE POW10 | ( | int | exp | ) | [static] |
| static LLONG ROUND | ( | LDOUBLE | value | ) | [static] |
| int smb_snprintf | ( | char * | str, | |
| size_t | count, | |||
| const char * | fmt, | |||
| ... | ||||
| ) |
| int smb_vsnprintf | ( | char * | str, | |
| size_t | count, | |||
| const char * | fmt, | |||
| va_list | args | |||
| ) |
| int vasprintf | ( | char ** | ptr, | |
| const char * | format, | |||
| va_list | ap | |||
| ) |
Definition at line 837 of file snprintf.c.
References NULL, VA_COPY, and vsnprintf.
Referenced by asprintf().
1.5.3