Graphviz 13.0.0~dev.20241222.1117
Loading...
Searching...
No Matches
sfprint.c File Reference
#include <assert.h>
#include <inttypes.h>
#include <sfio/sfhdr.h>
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <util/gv_ctype.h>
#include <util/gv_math.h>
Include dependency graph for sfprint.c:

Go to the source code of this file.

Macros

#define HIGHBITI   (~((~0u) >> 1))
 
#define HIGHBITL   (~((~0ull) >> 1))
 
#define SFFMT_PREFIX   (SFFMT_MINUS|SFFMT_SIGN|SFFMT_BLANK)
 
#define FPRECIS   6 /* default precision for floats */
 
#define SLACK   1024
 
#define SFputc(f, c)
 
#define SFnputc(f, c, n)
 
#define SFwrite(f, s, n)
 

Functions

int sfprint (FILE *f, Sffmt_t *format)
 

Macro Definition Documentation

◆ FPRECIS

#define FPRECIS   6 /* default precision for floats */

Definition at line 30 of file sfprint.c.

◆ HIGHBITI

#define HIGHBITI   (~((~0u) >> 1))

Definition at line 25 of file sfprint.c.

◆ HIGHBITL

#define HIGHBITL   (~((~0ull) >> 1))

Definition at line 26 of file sfprint.c.

◆ SFFMT_PREFIX

#define SFFMT_PREFIX   (SFFMT_MINUS|SFFMT_SIGN|SFFMT_BLANK)

Definition at line 28 of file sfprint.c.

◆ SFnputc

#define SFnputc (   f,
  c,
 
)
Value:
do { \
for (int i_ = 0; i_ < (n); ++i_) { \
if (putc((c), (f)) == EOF) { \
goto done; \
} \
} \
(n) = 0; \
} while (0)

◆ SFputc

#define SFputc (   f,
 
)
Value:
do { \
if (putc((c), (f)) == EOF) { \
goto done; \
} \
} while (0)

◆ SFwrite

#define SFwrite (   f,
  s,
 
)
Value:
do { \
if ((n) > 0 && fwrite((s), (size_t)(n), 1, (f)) < 1) { \
goto done; \
} \
} while (0)
Definition grammar.c:93

◆ SLACK

#define SLACK   1024

Function Documentation

◆ sfprint()

int sfprint ( FILE *  f,
Sffmt_t format 
)
Parameters
ffile to print to
formatStructure describing how to print

Definition at line 36 of file sfprint.c.

References _sfcvt(), _Sfdec, _Sfdigits, _Sffmtintf, _Sftype, Argv_t::c, Argv_t::d, dot, _sffmt_s::extf, Argv_t::f, flags, _sffmt_s::flags, FMTCMP, FMTGET, FMTSET, _sffmt_s::form, format, FP_SET, FPRECIS, Argv_t::ft, gv_isalnum(), gv_isalpha(), gv_isdigit(), gv_isupper(), Argv_t::h, HIGHBITI, HIGHBITL, Argv_t::i, imin(), Argv_t::l, LEFTP, Argv_t::ll, NULL, QUOTE, RIGHTP, Argv_t::s, SF_FDIGITS, SF_MAXDIGITS, SF_RADIX, SFFMT_ALTER, SFFMT_BLANK, SFFMT_EFORMAT, SFFMT_FLOAT, SFFMT_IFLAG, SFFMT_INT, SFFMT_JFLAG, SFFMT_LDOUBLE, SFFMT_LEFT, SFFMT_LLONG, SFFMT_LONG, SFFMT_MINUS, SFFMT_PREFIX, SFFMT_SHORT, SFFMT_SIGN, SFFMT_SSHORT, SFFMT_TFLAG, SFFMT_THOUSAND, SFFMT_TYPES, SFFMT_UINT, SFFMT_VALUE, SFFMT_ZERO, SFFMT_ZFLAG, SFnputc, SFputc, SFSETLOCALE, sfslen(), sfucvt, SFwrite, sign(), _sffmt_s::size, SLACK, Argv_t::sp, uchar, ulong, ushort, and Argv_t::vp.

Referenced by print().

Here is the call graph for this function:
Here is the caller graph for this function: