FFmpeg
Data Structures | Macros | Functions | Variables
avsscanf.c File Reference
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <float.h>
#include "config.h"
#include "common.h"
#include "mem.h"
#include "avassert.h"
#include "avstring.h"
#include "bprint.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 voidarg_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

#define SIZE_hh   -2

Definition at line 47 of file avsscanf.c.

Referenced by ff_vfscanf(), and store_int().

#define SIZE_h   -1

Definition at line 48 of file avsscanf.c.

Referenced by ff_vfscanf(), and store_int().

#define SIZE_def   0

Definition at line 49 of file avsscanf.c.

Referenced by ff_vfscanf(), and store_int().

#define SIZE_l   1

Definition at line 50 of file avsscanf.c.

Referenced by ff_vfscanf(), and store_int().

#define SIZE_L   2

Definition at line 51 of file avsscanf.c.

Referenced by ff_vfscanf().

#define SIZE_ll   3

Definition at line 52 of file avsscanf.c.

Referenced by ff_vfscanf(), and store_int().

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

Definition at line 54 of file avsscanf.c.

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

Definition at line 115 of file avsscanf.c.

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

Definition at line 116 of file avsscanf.c.

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

#define shunget (   f)    ((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().

#define LD_B1B_DIG   2

Definition at line 240 of file avsscanf.c.

Referenced by decfloat().

#define LD_B1B_MAX   9007199, 254740991

Definition at line 241 of file avsscanf.c.

Referenced by decfloat().

#define KMAX   128

Definition at line 242 of file avsscanf.c.

Referenced by decfloat().

#define MASK   (KMAX-1)

Definition at line 243 of file avsscanf.c.

Referenced by decfloat().

Function Documentation

static int fftoread ( FFFILE f)
static

Definition at line 56 of file avsscanf.c.

Referenced by ffuflow().

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().

static int ffuflow ( FFFILE f)
static

Definition at line 78 of file avsscanf.c.

Referenced by ffshgetc().

static void ffshlim ( FFFILE f,
ptrdiff_t  lim 
)
static

Definition at line 85 of file avsscanf.c.

static int ffshgetc ( FFFILE f)
static

Definition at line 96 of file avsscanf.c.

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().

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

Definition at line 214 of file avsscanf.c.

Referenced by decfloat(), and hexfloat().

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().

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().

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

Definition at line 610 of file avsscanf.c.

Referenced by ff_vfscanf().

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

Definition at line 693 of file avsscanf.c.

Referenced by ff_vfscanf().

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().

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().

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

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().