Electroneum
parseutil.h
Go to the documentation of this file.
1 /*
2  * parseutil.h - parse utilities for string and wire conversion
3  *
4  * (c) NLnet Labs, 2004
5  *
6  * See the file LICENSE for the license
7  */
15 #ifndef LDNS_PARSEUTIL_H
16 #define LDNS_PARSEUTIL_H
17 struct tm;
18 
28  int id;
29  const char *name;
30 };
32 
40  const char *name);
48 
55 time_t sldns_mktime_from_utc(const struct tm *tm);
56 
71 struct tm * sldns_serial_arithmetics_gmtime_r(int32_t time, time_t now, struct tm *result);
72 
79 uint32_t sldns_str2period(const char *nptr, const char **endptr);
80 
86 int sldns_hexdigit_to_int(char ch);
87 
91 size_t sldns_b64_ntop_calculate_size(size_t srcsize);
92 
93 int sldns_b64_ntop(uint8_t const *src, size_t srclength,
94  char *target, size_t targsize);
95 
99 size_t sldns_b64_pton_calculate_size(size_t srcsize);
100 
101 int sldns_b64_pton(char const *src, uint8_t *target, size_t targsize);
102 
106 size_t sldns_b32_ntop_calculate_size(size_t src_data_length);
107 
108 size_t sldns_b32_ntop_calculate_size_no_padding(size_t src_data_length);
109 
110 int sldns_b32_ntop(const uint8_t* src_data, size_t src_data_length,
111  char* target_text_buffer, size_t target_text_buffer_size);
112 
113 int sldns_b32_ntop_extended_hex(const uint8_t* src_data, size_t src_data_length,
114  char* target_text_buffer, size_t target_text_buffer_size);
115 
119 size_t sldns_b32_pton_calculate_size(size_t src_text_length);
120 
121 int sldns_b32_pton(const char* src_text, size_t src_text_length,
122  uint8_t* target_data_buffer, size_t target_data_buffer_size);
123 
124 int sldns_b32_pton_extended_hex(const char* src_text, size_t src_text_length,
125  uint8_t* target_data_buffer, size_t target_data_buffer_size);
126 
127 /*
128  * Checks whether the escaped value at **s is an octal value or
129  * a 'normally' escaped character (and not eos)
130  *
131  * @param ch_p: the parsed character
132  * @param str_p: the string. moved along for characters read.
133  * The string pointer at *s is increased by either 0 (on error), 1 (on
134  * normal escapes), or 3 (on octals)
135  *
136  * @return 0 on error
137  */
138 int sldns_parse_escape(uint8_t *ch_p, const char** str_p);
139 
146 int sldns_parse_char(uint8_t *ch_p, const char** str_p);
147 
148 #endif /* LDNS_PARSEUTIL_H */
std::vector< std::vector< _variant_t > > table
int sldns_b32_pton_extended_hex(const char *src_text, size_t src_text_length, uint8_t *target_data_buffer, size_t target_data_buffer_size)
int sldns_b32_ntop_extended_hex(const uint8_t *src_data, size_t src_data_length, char *target_text_buffer, size_t target_text_buffer_size)
size_t sldns_b64_ntop_calculate_size(size_t srcsize)
int sldns_parse_escape(uint8_t *ch_p, const char **str_p)
size_t sldns_b32_pton_calculate_size(size_t src_text_length)
struct tm * sldns_serial_arithmetics_gmtime_r(int32_t time, time_t now, struct tm *result)
unsigned char uint8_t
Definition: stdint.h:124
const char * name
uint32_t sldns_str2period(const char *nptr, const char **endptr)
time_t sldns_mktime_from_utc(const struct tm *tm)
size_t sldns_b32_ntop_calculate_size(size_t src_data_length)
int sldns_b32_pton(const char *src_text, size_t src_text_length, uint8_t *target_data_buffer, size_t target_data_buffer_size)
sldns_lookup_table * sldns_lookup_by_name(sldns_lookup_table table[], const char *name)
time_t time
Definition: blockchain.cpp:93
sldns_lookup_table * sldns_lookup_by_id(sldns_lookup_table table[], int id)
unsigned int uint32_t
Definition: stdint.h:126
int sldns_b64_ntop(uint8_t const *src, size_t srclength, char *target, size_t targsize)
int sldns_parse_char(uint8_t *ch_p, const char **str_p)
int sldns_hexdigit_to_int(char ch)
size_t sldns_b64_pton_calculate_size(size_t srcsize)
size_t sldns_b32_ntop_calculate_size_no_padding(size_t src_data_length)
signed int int32_t
Definition: stdint.h:123
int sldns_b64_pton(char const *src, uint8_t *target, size_t targsize)
int sldns_b32_ntop(const uint8_t *src_data, size_t src_data_length, char *target_text_buffer, size_t target_text_buffer_size)