ELinks 0.18.0
scanner.h File Reference
#include "util/error.h"
#include "util/string.h"
Include dependency graph for scanner.h:
This graph shows which files directly or indirectly include this file:

Data Structures

struct  scanner_token
 The struct scanner_token describes one scanner state. More...
union  scan_table_data
struct  scan_table_info
struct  scanner_string_mapping
struct  scanner_info
struct  scanner
 The struct scanner describes the current state of the scanner. More...

Macros

#define scanner_token_strlcasecmp(token, str, len)
 Compare the string of token with str.
#define scanner_token_contains(token, str)
 Also compares the token string but using a "static" string.
#define SCAN_TABLE_SIZE   256
#define SCAN_TABLE_INFO(type, data1, data2, bits)
#define SCAN_TABLE_RANGE(from, to, bits)
#define SCAN_TABLE_STRING(str, bits)
#define SCAN_TABLE_END   SCAN_TABLE_INFO(SCAN_END, 0, 0, 0)
#define SCANNER_TOKENS   10
 The number of tokens in the scanners token table: At best it should be big enough to contain properties with space separated values and function calls with up to 3 variables like rgb().

Enumerations

enum  scan_type { SCAN_RANGE , SCAN_STRING , SCAN_END }

Functions

static struct scanner_tokenbegin_token_scanning (struct scanner *scanner)
static struct scanner_tokenend_token_scanning (struct scanner *scanner, struct scanner_token *end)

Macro Definition Documentation

◆ SCAN_TABLE_END

#define SCAN_TABLE_END   SCAN_TABLE_INFO(SCAN_END, 0, 0, 0)

◆ SCAN_TABLE_INFO

#define SCAN_TABLE_INFO ( type,
data1,
data2,
bits )
Value:
{ (type), { { (data1), (data2) } }, (bits) }
const char * type
Definition download.c:1899

◆ SCAN_TABLE_RANGE

#define SCAN_TABLE_RANGE ( from,
to,
bits )
Value:
SCAN_TABLE_INFO(SCAN_RANGE, from, to, bits)
@ SCAN_RANGE
Definition scanner.h:43
#define SCAN_TABLE_INFO(type, data1, data2, bits)
Definition scanner.h:57

◆ SCAN_TABLE_SIZE

#define SCAN_TABLE_SIZE   256

◆ SCAN_TABLE_STRING

#define SCAN_TABLE_STRING ( str,
bits )
Value:
SCAN_TABLE_INFO(SCAN_STRING, str, sizeof(str) - 1, bits)
@ SCAN_STRING
Definition scanner.h:43

◆ scanner_token_contains

#define scanner_token_contains ( token,
str )
Value:
scanner_token_strlcasecmp(token, str, sizeof(str) - 1)
#define scanner_token_strlcasecmp(token, str, len)
Compare the string of token with str.
Definition scanner.h:36

Also compares the token string but using a "static" string.

◆ scanner_token_strlcasecmp

#define scanner_token_strlcasecmp ( token,
str,
len )
Value:
((token) && !c_strlcasecmp((token)->string, (token)->length, str, len))
#define c_strlcasecmp(a, b, c, d)
Definition string.h:108

Compare the string of token with str.

◆ SCANNER_TOKENS

#define SCANNER_TOKENS   10

The number of tokens in the scanners token table: At best it should be big enough to contain properties with space separated values and function calls with up to 3 variables like rgb().

At worst it should be no less than 2 in order to be able to peek at the next token in the scanner.

Enumeration Type Documentation

◆ scan_type

enum scan_type
Enumerator
SCAN_RANGE 
SCAN_STRING 
SCAN_END 

Function Documentation

◆ begin_token_scanning()

struct scanner_token * begin_token_scanning ( struct scanner * scanner)
inlinestatic

◆ end_token_scanning()

struct scanner_token * end_token_scanning ( struct scanner * scanner,
struct scanner_token * end )
inlinestatic