NAME ^

src/spf_render.c - Parrot sprintf

DESCRIPTION ^

Implements the main function that drives the Parrot_sprintf family and its utility functions.

Utility Functions ^

PARROT_CANNOT_RETURN_NULL static STRING *handle_flags(PARROT_INTERP, NOTNULL(SpfInfo *info), NOTNULL(STRING *str), INTVAL is_int_type, NULLOK(STRING *prefix))

Handles +, -, 0, #, space, width, and prec.

PARROT_CANNOT_RETURN_NULL static STRING *str_append_w_flags(PARROT_INTERP, NOTNULL(STRING *dest), NOTNULL(SpfInfo *info), NOTNULL(STRING *src), NULLOK(STRING *prefix))

RT#48260: Not yet documented!!!

static void gen_sprintf_call(NOTNULL(char *out), NOTNULL(SpfInfo *info), int thingy)

Turn the info structure back into an sprintf format. Far from being pointless, this is used to call snprintf() when we're confronted with a float.

PARROT_WARN_UNUSED_RESULT PARROT_CANNOT_RETURN_NULL STRING *Parrot_sprintf_format(PARROT_INTERP, NOTNULL(STRING *pat), NOTNULL(SPRINTF_OBJ *obj))

This is the engine that does all the formatting.

SEE ALSO ^

src/misc.h, src/misc.c, src/spf_vtable.c.


parrot