FFmpeg
Data Structures | Macros | Functions | Variables
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)   ((f)->shcnt + ((f)->rpos - (f)->buf))
 
#define shlim(f, lim)   ffshlim((f), (lim))
 
#define shgetc(f)   (((f)->rpos < (f)->shend) ? *(f)->rpos++ : ffshgetc(f))
 
#define shunget(f)   ((f)->shend ? (void)(f)->rpos-- : (void)0)
 
#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,...)
 See libc sscanf manual for more information. More...
 

Variables

static const unsigned char table []
 

Macro Definition Documentation

◆ SIZE_hh

#define SIZE_hh   -2

Definition at line 47 of file avsscanf.c.

◆ SIZE_h

#define SIZE_h   -1

Definition at line 48 of file avsscanf.c.

◆ SIZE_def

#define SIZE_def   0

Definition at line 49 of file avsscanf.c.

◆ SIZE_l

#define SIZE_l   1

Definition at line 50 of file avsscanf.c.

◆ SIZE_L

#define SIZE_L   2

Definition at line 51 of file avsscanf.c.

◆ SIZE_ll

#define SIZE_ll   3

Definition at line 52 of file avsscanf.c.

◆ shcnt

#define shcnt (   f)    ((f)->shcnt + ((f)->rpos - (f)->buf))

Definition at line 54 of file avsscanf.c.

◆ shlim

#define shlim (   f,
  lim 
)    ffshlim((f), (lim))

Definition at line 115 of file avsscanf.c.

◆ shgetc

#define shgetc (   f)    (((f)->rpos < (f)->shend) ? *(f)->rpos++ : ffshgetc(f))

Definition at line 116 of file avsscanf.c.

◆ shunget

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

Definition at line 117 of file avsscanf.c.

◆ LD_B1B_DIG

#define LD_B1B_DIG   2

Definition at line 240 of file avsscanf.c.

◆ LD_B1B_MAX

#define LD_B1B_MAX   9007199, 254740991

Definition at line 241 of file avsscanf.c.

◆ KMAX

#define KMAX   128

Definition at line 242 of file avsscanf.c.

◆ 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 693 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 705 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 727 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().

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.

Referenced by ffintscan().