nis-util  1.0.D108
Defines | Functions | Variables
lib/mprintf.cc File Reference
#include <lib/ac/errno.h>
#include <lib/ac/stdio.h>
#include <lib/ac/stdlib.h>
#include <lib/ac/string.h>
#include <libexplain/malloc.h>
#include <libexplain/realloc.h>
#include <lib/mprintf.h>

Go to the source code of this file.

Defines

#define QUANTUM   200
#define MAX_WIDTH   (QUANTUM - 1)

Functions

static int bigger (void)
static void build_fake (char *fake, int flag, int width, int precision, int qualifier, int specifier)
const char * vmprintf (const char *fmt, va_list ap)
const char * mprintf (const char *fmt,...)
const char * vmprintfe (const char *fmt, va_list ap)
const char * mprintfe (const char *fmt,...)

Variables

static size_t tmplen
static size_t length
static char * tmp

Define Documentation

#define MAX_WIDTH   (QUANTUM - 1)

Definition at line 36 of file mprintf.cc.

#define QUANTUM   200

Definition at line 31 of file mprintf.cc.


Function Documentation

static int bigger ( void  ) [static]

The bigger function is used to grow the dynamic memory buffer used by vmprintf to store the formatting results. The buffer is increased by QUANTUM bytes.

Definition at line 53 of file mprintf.cc.

static void build_fake ( char *  fake,
int  flag,
int  width,
int  precision,
int  qualifier,
int  specifier 
) [static]

The build_fake function is used to construct a format specification string from the arguments presented. This is used to guarantee exact replication of sprintf behaviour.

Parameters:
fakebuffer to store results
flagthe flag specified (zero if not)
widththe width specified (zero if not)
precisionthe precision specified (zero if not)
qualifierthe qualifier specified (zero if not)
specifierthe formatting specifier specified

Definition at line 83 of file mprintf.cc.

const char* mprintf ( const char *  fmt,
  ... 
)

Definition at line 515 of file mprintf.cc.

const char* mprintfe ( const char *  fmt,
  ... 
)

Definition at line 533 of file mprintf.cc.

const char* vmprintf ( const char *  fmt,
va_list  ap 
)

Definition at line 106 of file mprintf.cc.

const char* vmprintfe ( const char *  fmt,
va_list  ap 
)

Definition at line 526 of file mprintf.cc.


Variable Documentation

size_t length [static]

Definition at line 42 of file mprintf.cc.

char* tmp [static]

Definition at line 43 of file mprintf.cc.

size_t tmplen [static]

Definition at line 41 of file mprintf.cc.