mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 12:23:32 +01:00
Revert "Add a function to append an existing line to a config line list."
This reverts commit 5a2ab886ba
.
This commit is contained in:
parent
e3ccf37e25
commit
daed2e39ad
@ -33,23 +33,14 @@ config_line_append(config_line_t **lst,
|
||||
const char *key,
|
||||
const char *val)
|
||||
{
|
||||
tor_assert(lst);
|
||||
|
||||
config_line_t *newline;
|
||||
|
||||
newline = tor_malloc_zero(sizeof(config_line_t));
|
||||
newline->key = tor_strdup(key);
|
||||
newline->value = tor_strdup(val);
|
||||
newline->next = NULL;
|
||||
|
||||
config_line_append_line(lst, newline);
|
||||
}
|
||||
|
||||
/** Helper: append <b>newline</b> to the end of <b>lst</b>. */
|
||||
void
|
||||
config_line_append_line(config_line_t **lst,
|
||||
config_line_t *newline)
|
||||
{
|
||||
tor_assert(lst);
|
||||
|
||||
while (*lst)
|
||||
lst = &((*lst)->next);
|
||||
|
||||
@ -265,7 +256,7 @@ config_lines_dup_and_filter(const config_line_t *inp,
|
||||
/** Return true iff a and b contain identical keys and values in identical
|
||||
* order. */
|
||||
int
|
||||
config_lines_eq(const config_line_t *a, const config_line_t *b)
|
||||
config_lines_eq(config_line_t *a, config_line_t *b)
|
||||
{
|
||||
while (a && b) {
|
||||
if (strcasecmp(a->key, b->key) || strcmp(a->value, b->value))
|
||||
|
@ -41,7 +41,6 @@ typedef struct config_line_t {
|
||||
|
||||
void config_line_append(config_line_t **lst,
|
||||
const char *key, const char *val);
|
||||
void config_line_append_line(config_line_t **lst, config_line_t *newline);
|
||||
void config_line_prepend(config_line_t **lst,
|
||||
const char *key, const char *val);
|
||||
config_line_t *config_lines_dup(const config_line_t *inp);
|
||||
@ -51,7 +50,7 @@ const config_line_t *config_line_find(const config_line_t *lines,
|
||||
const char *key);
|
||||
const config_line_t *config_line_find_case(const config_line_t *lines,
|
||||
const char *key);
|
||||
int config_lines_eq(const config_line_t *a, const config_line_t *b);
|
||||
int config_lines_eq(config_line_t *a, config_line_t *b);
|
||||
int config_count_key(const config_line_t *a, const char *key);
|
||||
void config_free_lines_(config_line_t *front);
|
||||
#define config_free_lines(front) \
|
||||
|
Loading…
Reference in New Issue
Block a user