NetSurf
Macros | Enumerations | Functions | Variables
punycode.c File Reference
#include <string.h>
#include "punycode.h"
Include dependency graph for punycode.c:

Go to the source code of this file.

Macros

#define basic(cp)   ((punycode_uint)(cp) < 0x80)
 
#define delim(cp)   ((cp) == delimiter)
 
#define flagged(bcp)   ((punycode_uint)(bcp) - 65 < 26)
 

Enumerations

enum  {
  base = 36 , tmin = 1 , tmax = 26 , skew = 38 ,
  damp = 700 , initial_bias = 72 , initial_n = 0x80 , delimiter = 0x2D
}
 

Functions

static punycode_uint decode_digit (punycode_uint cp)
 
static char encode_digit (punycode_uint d, int flag)
 
static char encode_basic (punycode_uint bcp, int flag)
 
static punycode_uint adapt (punycode_uint delta, punycode_uint numpoints, int firsttime)
 
enum punycode_status punycode_encode (size_t input_length_orig, const punycode_uint input[], const unsigned char case_flags[], size_t *output_length, char output[])
 
enum punycode_status punycode_decode (size_t input_length, const char input[], size_t *output_length, punycode_uint output[], unsigned char case_flags[])
 

Variables

static const punycode_uint maxint = -1
 

Macro Definition Documentation

◆ basic

#define basic (   cp)    ((punycode_uint)(cp) < 0x80)

Definition at line 23 of file punycode.c.

◆ delim

#define delim (   cp)    ((cp) == delimiter)

Definition at line 26 of file punycode.c.

◆ flagged

#define flagged (   bcp)    ((punycode_uint)(bcp) - 65 < 26)

Definition at line 55 of file punycode.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
base 
tmin 
tmax 
skew 
damp 
initial_bias 
initial_n 
delimiter 

Definition at line 19 of file punycode.c.

Function Documentation

◆ adapt()

static punycode_uint adapt ( punycode_uint  delta,
punycode_uint  numpoints,
int  firsttime 
)
static

Definition at line 77 of file punycode.c.

References base, damp, skew, tmax, and tmin.

Referenced by punycode_decode(), and punycode_encode().

Here is the caller graph for this function:

◆ decode_digit()

static punycode_uint decode_digit ( punycode_uint  cp)
static

Definition at line 32 of file punycode.c.

References base.

Referenced by punycode_decode().

Here is the caller graph for this function:

◆ encode_basic()

static char encode_basic ( punycode_uint  bcp,
int  flag 
)
static

Definition at line 63 of file punycode.c.

Referenced by punycode_encode().

Here is the caller graph for this function:

◆ encode_digit()

static char encode_digit ( punycode_uint  d,
int  flag 
)
static

Definition at line 44 of file punycode.c.

Referenced by punycode_encode().

Here is the caller graph for this function:

◆ punycode_decode()

enum punycode_status punycode_decode ( size_t  input_length,
const char  input[],
size_t *  output_length,
punycode_uint  output[],
unsigned char  case_flags[] 
)

Definition at line 194 of file punycode.c.

References adapt(), base, basic, decode_digit(), delim, flagged, initial_bias, initial_n, maxint, punycode_bad_input, punycode_big_output, punycode_overflow, punycode_success, tmax, and tmin.

Referenced by idna__ace_to_ucs4().

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

◆ punycode_encode()

enum punycode_status punycode_encode ( size_t  input_length_orig,
const punycode_uint  input[],
const unsigned char  case_flags[],
size_t *  output_length,
char  output[] 
)

Definition at line 95 of file punycode.c.

References adapt(), base, basic, delimiter, encode_basic(), encode_digit(), initial_bias, initial_n, maxint, punycode_big_output, punycode_overflow, punycode_success, tmax, and tmin.

Referenced by idna__ucs4_to_ace().

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

Variable Documentation

◆ maxint

const punycode_uint maxint = -1
static

Definition at line 72 of file punycode.c.

Referenced by punycode_decode(), and punycode_encode().