FFmpeg
Loading...
Searching...
No Matches
avsscanf.c File Reference
#include <errno.h>
#include <limits.h>
#include <math.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <float.h>
#include "avstring.h"
#include "libm.h"

Go to the source code of this file.

Data Structures

struct  FFFILE
 

Macros

#define SIZE_hh   -2
 
#define SIZE_h   -1
 
#define SIZE_def   0
 
#define SIZE_l   1
 
#define SIZE_L   2
 
#define SIZE_ll   3
 
#define shcnt(f)
 
#define shlim(f, lim)
 
#define shgetc(f)
 
#define shunget(f)
 
#define LD_B1B_DIG   2
 
#define LD_B1B_MAX   9007199, 254740991
 
#define KMAX   128
 
#define MASK   (KMAX-1)
 

Functions

static int fftoread (FFFILE *f)
 
static size_t ffstring_read (FFFILE *f, unsigned char *buf, size_t len)
 
static int ffuflow (FFFILE *f)
 
static void ffshlim (FFFILE *f, ptrdiff_t lim)
 
static int ffshgetc (FFFILE *f)
 
static unsigned long long ffintscan (FFFILE *f, unsigned base, int pok, unsigned long long lim)
 
static long long scanexp (FFFILE *f, int pok)
 
static double decfloat (FFFILE *f, int c, int bits, int emin, int sign, int pok)
 
static double hexfloat (FFFILE *f, int bits, int emin, int sign, int pok)
 
static double fffloatscan (FFFILE *f, int prec, int pok)
 
static void * arg_n (va_list ap, unsigned int n)
 
static void store_int (void *dest, int size, unsigned long long i)
 
static int ff_vfscanf (FFFILE *f, const char *fmt, va_list ap)
 
static int ff_vsscanf (const char *s, const char *fmt, va_list ap)
 
int av_sscanf (const char *string, const char *format,...)
 

Variables

static const unsigned char table []
 

Macro Definition Documentation

◆ SIZE_hh

#define SIZE_hh   -2

Definition at line 47 of file avsscanf.c.

Referenced by ff_vfscanf(), and store_int().

◆ SIZE_h

#define SIZE_h   -1

Definition at line 48 of file avsscanf.c.

Referenced by ff_vfscanf(), and store_int().

◆ SIZE_def

#define SIZE_def   0

Definition at line 49 of file avsscanf.c.

Referenced by ff_vfscanf(), and store_int().

◆ SIZE_l

#define SIZE_l   1

Definition at line 50 of file avsscanf.c.

Referenced by ff_vfscanf(), and store_int().

◆ SIZE_L

#define SIZE_L   2

Definition at line 51 of file avsscanf.c.

Referenced by ff_vfscanf().

◆ SIZE_ll

#define SIZE_ll   3

Definition at line 52 of file avsscanf.c.

Referenced by ff_vfscanf(), and store_int().

◆ shcnt

#define shcnt ( f)
Value:
((f)->shcnt + ((f)->rpos - (f)->buf))
#define f(width, name)
Definition cbs_vp8.c:236

Definition at line 54 of file avsscanf.c.

Referenced by ff_vfscanf(), and ffshgetc().

◆ shlim

#define shlim ( f,
lim )
Value:
ffshlim((f), (lim))
static void ffshlim(FFFILE *f, ptrdiff_t lim)
Definition avsscanf.c:85

Definition at line 115 of file avsscanf.c.

Referenced by decfloat(), ff_vfscanf(), fffloatscan(), ffintscan(), and hexfloat().

◆ shgetc

#define shgetc ( f)
Value:
(((f)->rpos < (f)->shend) ? *(f)->rpos++ : ffshgetc(f))
static int ffshgetc(FFFILE *f)
Definition avsscanf.c:96

Definition at line 116 of file avsscanf.c.

Referenced by decfloat(), ff_vfscanf(), fffloatscan(), ffintscan(), hexfloat(), and scanexp().

◆ shunget

#define shunget ( f)
Value:
((f)->shend ? (void)(f)->rpos-- : (void)0)

Definition at line 117 of file avsscanf.c.

Referenced by decfloat(), ff_vfscanf(), fffloatscan(), ffintscan(), hexfloat(), and scanexp().

◆ LD_B1B_DIG

#define LD_B1B_DIG   2

Definition at line 240 of file avsscanf.c.

Referenced by decfloat().

◆ LD_B1B_MAX

#define LD_B1B_MAX   9007199, 254740991

Definition at line 241 of file avsscanf.c.

Referenced by decfloat().

◆ KMAX

#define KMAX   128

Definition at line 242 of file avsscanf.c.

Referenced by decfloat().

◆ MASK

#define MASK   (KMAX-1)

Definition at line 243 of file avsscanf.c.

Function Documentation

◆ fftoread()

static int fftoread ( FFFILE * f)
static

Definition at line 56 of file avsscanf.c.

Referenced by ffuflow().

◆ ffstring_read()

static size_t ffstring_read ( FFFILE * f,
unsigned char * buf,
size_t len )
static

Definition at line 62 of file avsscanf.c.

Referenced by ff_vsscanf().

◆ ffuflow()

static int ffuflow ( FFFILE * f)
static

Definition at line 78 of file avsscanf.c.

Referenced by ffshgetc().

◆ ffshlim()

static void ffshlim ( FFFILE * f,
ptrdiff_t lim )
static

Definition at line 85 of file avsscanf.c.

◆ ffshgetc()

static int ffshgetc ( FFFILE * f)
static

Definition at line 96 of file avsscanf.c.

◆ ffintscan()

static unsigned long long ffintscan ( FFFILE * f,
unsigned base,
int pok,
unsigned long long lim )
static

Definition at line 138 of file avsscanf.c.

Referenced by ff_vfscanf().

◆ scanexp()

static long long scanexp ( FFFILE * f,
int pok )
static

Definition at line 214 of file avsscanf.c.

Referenced by decfloat(), and hexfloat().

◆ decfloat()

static double decfloat ( FFFILE * f,
int c,
int bits,
int emin,
int sign,
int pok )
static

Definition at line 245 of file avsscanf.c.

Referenced by fffloatscan().

◆ hexfloat()

static double hexfloat ( FFFILE * f,
int bits,
int emin,
int sign,
int pok )
static

Definition at line 497 of file avsscanf.c.

Referenced by fffloatscan().

◆ fffloatscan()

static double fffloatscan ( FFFILE * f,
int prec,
int pok )
static

Definition at line 610 of file avsscanf.c.

Referenced by ff_vfscanf().

◆ arg_n()

static void * arg_n ( va_list ap,
unsigned int n )
static

Definition at line 692 of file avsscanf.c.

Referenced by ff_vfscanf().

◆ store_int()

static void store_int ( void * dest,
int size,
unsigned long long i )
static

Definition at line 704 of file avsscanf.c.

Referenced by ff_vfscanf().

◆ ff_vfscanf()

static int ff_vfscanf ( FFFILE * f,
const char * fmt,
va_list ap )
static

Definition at line 726 of file avsscanf.c.

Referenced by ff_vsscanf().

◆ ff_vsscanf()

static int ff_vsscanf ( const char * s,
const char * fmt,
va_list ap )
static

Definition at line 952 of file avsscanf.c.

Referenced by av_sscanf().

◆ av_sscanf()

Variable Documentation

◆ table

const unsigned char table[]
static
Initial value:
= { -1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,-1,-1,-1,-1,-1,-1,
-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,
25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1,
-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,
25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
}

Definition at line 119 of file avsscanf.c.