Electroneum
Loading...
Searching...
No Matches
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 */
14
15#ifndef LDNS_PARSEUTIL_H
16#define LDNS_PARSEUTIL_H
17struct tm;
18
28 int id;
29 const char *name;
30};
32
40 const char *name);
48
55time_t sldns_mktime_from_utc(const struct tm *tm);
56
71struct tm * sldns_serial_arithmetics_gmtime_r(int32_t time, time_t now, struct tm *result);
72
79uint32_t sldns_str2period(const char *nptr, const char **endptr);
80
87
91size_t sldns_b64_ntop_calculate_size(size_t srcsize);
92
93int sldns_b64_ntop(uint8_t const *src, size_t srclength,
94 char *target, size_t targsize);
95
99size_t sldns_b64_pton_calculate_size(size_t srcsize);
100
101int sldns_b64_pton(char const *src, uint8_t *target, size_t targsize);
102
106size_t sldns_b32_ntop_calculate_size(size_t src_data_length);
107
108size_t sldns_b32_ntop_calculate_size_no_padding(size_t src_data_length);
109
110int 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
113int 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
119size_t sldns_b32_pton_calculate_size(size_t src_text_length);
120
121int 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
124int 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 */
138int sldns_parse_escape(uint8_t *ch_p, const char** str_p);
139
146int sldns_parse_char(uint8_t *ch_p, const char** str_p);
147
148#endif /* LDNS_PARSEUTIL_H */
time_t time
size_t sldns_b32_pton_calculate_size(size_t src_text_length)
time_t sldns_mktime_from_utc(const struct tm *tm)
struct sldns_struct_lookup_table sldns_lookup_table
Definition parseutil.h:31
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_pton_calculate_size(size_t srcsize)
int sldns_b32_ntop(const uint8_t *src_data, size_t src_data_length, char *target_text_buffer, size_t target_text_buffer_size)
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)
size_t sldns_b32_ntop_calculate_size(size_t src_data_length)
size_t sldns_b32_ntop_calculate_size_no_padding(size_t src_data_length)
int sldns_hexdigit_to_int(char ch)
uint32_t sldns_str2period(const char *nptr, const char **endptr)
int sldns_b64_pton(char const *src, uint8_t *target, size_t targsize)
sldns_lookup_table * sldns_lookup_by_name(sldns_lookup_table table[], const char *name)
int sldns_b64_ntop(uint8_t const *src, size_t srclength, char *target, size_t targsize)
struct tm * sldns_serial_arithmetics_gmtime_r(int32_t time, time_t now, struct tm *result)
int sldns_parse_escape(uint8_t *ch_p, const char **str_p)
sldns_lookup_table * sldns_lookup_by_id(sldns_lookup_table table[], int id)
int sldns_parse_char(uint8_t *ch_p, const char **str_p)
int sldns_b32_pton(const char *src_text, size_t src_text_length, uint8_t *target_data_buffer, size_t target_data_buffer_size)
size_t sldns_b64_ntop_calculate_size(size_t srcsize)
unsigned int uint32_t
Definition stdint.h:126
signed int int32_t
Definition stdint.h:123
unsigned char uint8_t
Definition stdint.h:124