Graphviz 13.0.0~dev.20250121.0651
Loading...
Searching...
No Matches
sfhdr.h File Reference
#include <inttypes.h>
#include <sfio/sfio.h>
#include "config.h"
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <stddef.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <ctype.h>
#include <locale.h>
Include dependency graph for sfhdr.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

union  Argv_t
 
struct  _sftab_
 

Macros

#define uchar   unsigned char
 
#define ulong   uint64_t
 
#define ushort   unsigned short
 
#define SFSETLOCALE(decimal, thousand)
 
#define FP_SET(fp, fn)   (fp < 0 ? (fn += 1) : (fn = fp) )
 
#define LEFTP   '('
 
#define RIGHTP   ')'
 
#define QUOTE   '\''
 
#define FMTSET(ft, frm, fv, sz, flgs, wid, pr, bs, ts, ns)
 
#define FMTGET(ft, frm, fv, sz, flgs, wid, pr, bs)
 
#define FMTCMP(sz, type, maxtype)
 
#define SFFMT_EFORMAT   01000000000 /* sfcvt converting %e */
 
#define SFFMT_MINUS   02000000000 /* minus sign */
 
#define SFFMT_TYPES
 
#define SFFMT_INT   001 /* %d,%i */
 
#define SFFMT_UINT   002 /* %u,o,x etc. */
 
#define SFFMT_FLOAT   004 /* %f,e,g etc. */
 
#define SFFMT_BYTE   010 /* %c */
 
#define SFFMT_POINTER   020 /* %p, %n */
 
#define SFFMT_CLASS   040 /* %[ */
 
#define SF_RADIX   64 /* maximum integer conversion base */
 
#define SF_MAXEXP10   6
 
#define SF_FDIGITS   256 /* max allowed fractional digits */
 
#define SF_IDIGITS   1024 /* max number of digits in int part */
 
#define SF_MAXDIGITS   (((SF_FDIGITS+SF_IDIGITS)/sizeof(int) + 1)*sizeof(int))
 
#define _Sfpos10   (_Sftable.sf_pos10)
 
#define _Sfneg10   (_Sftable.sf_neg10)
 
#define _Sfdec   (_Sftable.sf_dec)
 
#define _Sfdigits   (_Sftable.sf_digits)
 
#define _Sfcvinit   (_Sftable.sf_cvinit)
 
#define _Sffmtintf   (_Sftable.sf_fmtintf)
 
#define _Sfcv36   (_Sftable.sf_cv36)
 
#define _Sfcv64   (_Sftable.sf_cv64)
 
#define _Sftype   (_Sftable.sf_type)
 
#define SFDIGIT(v, scale, digit)
 
#define sfucvt(v, s, n, list, type, utype)
 

Typedefs

typedef struct _sftab_ Sftab_t
 

Functions

char * _sfcvt (void *, int, int *, int *, int)
 

Variables

Sftab_t _Sftable
 

Macro Definition Documentation

◆ _Sfcv36

#define _Sfcv36   (_Sftable.sf_cv36)

Definition at line 134 of file sfhdr.h.

◆ _Sfcv64

#define _Sfcv64   (_Sftable.sf_cv64)

Definition at line 135 of file sfhdr.h.

◆ _Sfcvinit

#define _Sfcvinit   (_Sftable.sf_cvinit)

Definition at line 132 of file sfhdr.h.

◆ _Sfdec

#define _Sfdec   (_Sftable.sf_dec)

Definition at line 130 of file sfhdr.h.

◆ _Sfdigits

#define _Sfdigits   (_Sftable.sf_digits)

Definition at line 131 of file sfhdr.h.

◆ _Sffmtintf

#define _Sffmtintf   (_Sftable.sf_fmtintf)

Definition at line 133 of file sfhdr.h.

◆ _Sfneg10

#define _Sfneg10   (_Sftable.sf_neg10)

Definition at line 129 of file sfhdr.h.

◆ _Sfpos10

#define _Sfpos10   (_Sftable.sf_pos10)

Definition at line 128 of file sfhdr.h.

◆ _Sftype

#define _Sftype   (_Sftable.sf_type)

Definition at line 136 of file sfhdr.h.

◆ FMTCMP

#define FMTCMP (   sz,
  type,
  maxtype 
)
Value:
(sz == sizeof(type) || (sz == 0 && sizeof(type) == sizeof(maxtype)) || \
(sz == 64 && sz == sizeof(type)*CHAR_BIT) )
expr procedure type
Definition exparse.y:208

Definition at line 99 of file sfhdr.h.

◆ FMTGET

#define FMTGET (   ft,
  frm,
  fv,
  sz,
  flgs,
  wid,
  pr,
  bs 
)
Value:
((frm = ft->form), (fv = ft->fmt), (sz = ft->size), \
(flgs = (flgs&~(SFFMT_SET))|(ft->flags&SFFMT_SET)), \
(wid = ft->width), (pr = ft->precis), (bs = ft->base) )
#define SFFMT_SET
Definition sfio.h:66

Definition at line 95 of file sfhdr.h.

◆ FMTSET

#define FMTSET (   ft,
  frm,
  fv,
  sz,
  flgs,
  wid,
  pr,
  bs,
  ts,
  ns 
)
Value:
((ft->form = (char*)frm), \
(ft->fmt = fv), (ft->size = sz), \
(ft->flags = (flgs&SFFMT_SET)), \
(ft->width = wid), (ft->precis = pr), (ft->base = bs), \
(ft->t_str = ts), (ft->n_str = ns) )

Definition at line 89 of file sfhdr.h.

◆ FP_SET

#define FP_SET (   fp,
  fn 
)    (fp < 0 ? (fn += 1) : (fn = fp) )

Definition at line 66 of file sfhdr.h.

◆ LEFTP

#define LEFTP   '('

Definition at line 85 of file sfhdr.h.

◆ QUOTE

#define QUOTE   '\''

Definition at line 87 of file sfhdr.h.

◆ RIGHTP

#define RIGHTP   ')'

Definition at line 86 of file sfhdr.h.

◆ SF_FDIGITS

#define SF_FDIGITS   256 /* max allowed fractional digits */

Definition at line 123 of file sfhdr.h.

◆ SF_IDIGITS

#define SF_IDIGITS   1024 /* max number of digits in int part */

Definition at line 124 of file sfhdr.h.

◆ SF_MAXDIGITS

#define SF_MAXDIGITS   (((SF_FDIGITS+SF_IDIGITS)/sizeof(int) + 1)*sizeof(int))

Definition at line 125 of file sfhdr.h.

◆ SF_MAXEXP10

#define SF_MAXEXP10   6

Definition at line 122 of file sfhdr.h.

◆ SF_RADIX

#define SF_RADIX   64 /* maximum integer conversion base */

Definition at line 119 of file sfhdr.h.

◆ SFDIGIT

#define SFDIGIT (   v,
  scale,
  digit 
)
Value:
{ if(v < 5*scale) \
if(v < 2*scale) \
if(v < 1*scale) \
{ digit = '0'; } \
else { digit = '1'; v -= 1*scale; } \
else if(v < 3*scale) \
{ digit = '2'; v -= 2*scale; } \
else if(v < 4*scale) \
{ digit = '3'; v -= 3*scale; } \
else { digit = '4'; v -= 4*scale; } \
else if(v < 7*scale) \
if(v < 6*scale) \
{ digit = '5'; v -= 5*scale; } \
else { digit = '6'; v -= 6*scale; } \
else if(v < 8*scale) \
{ digit = '7'; v -= 7*scale; } \
else if(v < 9*scale) \
{ digit = '8'; v -= 8*scale; } \
else { digit = '9'; v -= 9*scale; } \
}
static pointf scale(double c, pointf p)
Definition geomprocs.h:155

Definition at line 150 of file sfhdr.h.

◆ SFFMT_BYTE

#define SFFMT_BYTE   010 /* %c */

Definition at line 115 of file sfhdr.h.

◆ SFFMT_CLASS

#define SFFMT_CLASS   040 /* %[ */

Definition at line 117 of file sfhdr.h.

◆ SFFMT_EFORMAT

#define SFFMT_EFORMAT   01000000000 /* sfcvt converting %e */

Definition at line 104 of file sfhdr.h.

◆ SFFMT_FLOAT

#define SFFMT_FLOAT   004 /* %f,e,g etc. */

Definition at line 114 of file sfhdr.h.

◆ SFFMT_INT

#define SFFMT_INT   001 /* %d,%i */

Definition at line 112 of file sfhdr.h.

◆ SFFMT_MINUS

#define SFFMT_MINUS   02000000000 /* minus sign */

Definition at line 105 of file sfhdr.h.

◆ SFFMT_POINTER

#define SFFMT_POINTER   020 /* %p, %n */

Definition at line 116 of file sfhdr.h.

◆ SFFMT_TYPES

#define SFFMT_TYPES
Value:
#define SFFMT_ZFLAG
Definition sfio.h:49
#define SFFMT_LONG
Definition sfio.h:59
#define SFFMT_JFLAG
Definition sfio.h:65
#define SFFMT_SSHORT
Definition sfio.h:47
#define SFFMT_SHORT
Definition sfio.h:58
#define SFFMT_IFLAG
Definition sfio.h:64
#define SFFMT_LDOUBLE
Definition sfio.h:61
#define SFFMT_TFLAG
Definition sfio.h:48
#define SFFMT_LLONG
Definition sfio.h:60

Definition at line 107 of file sfhdr.h.

◆ SFFMT_UINT

#define SFFMT_UINT   002 /* %u,o,x etc. */

Definition at line 113 of file sfhdr.h.

◆ SFSETLOCALE

#define SFSETLOCALE (   decimal,
  thousand 
)
Value:
{ struct lconv* lv_; \
if((decimal) == 0) \
{ (decimal) = '.'; \
if((lv_ = localeconv())) \
{ if(lv_->decimal_point && lv_->decimal_point[0]) \
(decimal) = lv_->decimal_point[0]; \
if(lv_->thousands_sep && lv_->thousands_sep[0]) \
(thousand) = lv_->thousands_sep[0]; \
} \
} \
}

Definition at line 52 of file sfhdr.h.

◆ sfucvt

#define sfucvt (   v,
  s,
  n,
  list,
  type,
  utype 
)
Value:
{ while((utype)v >= 10000) \
{ n = v; v = (type)(((utype)v)/10000); \
n = (type)((utype)n - ((utype)v)*10000); \
s -= 4; SFDIGIT(n,1000,s[0]); SFDIGIT(n,100,s[1]); \
s[2] = *(list = (char*)_Sfdec + (n <<= 1)); s[3] = *(list+1); \
} \
if(v < 100) \
{ if(v < 10) \
{ s -= 1; s[0] = (char)('0'+v); \
} else \
{ s -= 2; s[0] = *(list = (char*)_Sfdec + (v <<= 1)); s[1] = *(list+1); \
} \
} else \
{ if(v < 1000) \
{ s -= 3; SFDIGIT(v,100,s[0]); \
s[1] = *(list = (char*)_Sfdec + (v <<= 1)); s[2] = *(list+1); \
} else \
{ s -= 4; SFDIGIT(v,1000,s[0]); SFDIGIT(v,100,s[1]); \
s[2] = *(list = (char*)_Sfdec + (v <<= 1)); s[3] = *(list+1); \
} \
} \
}
#define SFDIGIT(v, scale, digit)
Definition sfhdr.h:150
#define _Sfdec
Definition sfhdr.h:130
Definition grammar.c:93

Definition at line 171 of file sfhdr.h.

◆ uchar

#define uchar   unsigned char

Definition at line 41 of file sfhdr.h.

◆ ulong

#define ulong   uint64_t

Definition at line 44 of file sfhdr.h.

◆ ushort

#define ushort   unsigned short

Definition at line 47 of file sfhdr.h.

Typedef Documentation

◆ Sftab_t

typedef struct _sftab_ Sftab_t

Function Documentation

◆ _sfcvt()

char * _sfcvt ( void *  dv,
int  n_digit,
int *  decpt,
int *  sign,
int  format 
)
extern
Parameters
dvvalue to convert
n_digitnumber of digits wanted
decptreturn decimal point
signreturn sign
formatconversion format

Definition at line 31 of file sfcvt.c.

References _Sfi, _Sfneg10, _Sfpos10, format, SF_IDIGITS, SF_INFINITE, SF_INTPART, SF_MAXDIGITS, SF_MAXEXP10, SF_ZERO, SFFMT_EFORMAT, sfucvt, sign(), and ulong.

Referenced by sfprint().

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

Variable Documentation

◆ _Sftable

Sftab_t _Sftable
extern

Definition at line 30 of file sftable.c.