src/labeled_int_list.h
author Krista 'DarthMama' Bennett <krista@pep.foundation>
Thu, 04 Jun 2020 11:18:45 +0200
changeset 4729 3df9a2a67597
parent 3004 079d0bf653be
child 4792 7056435ab9e7
child 5246 67016f508d40
permissions -rw-r--r--
forgot test files
krista@2964
     1
// This file is under GNU General Public License 3.0
krista@2964
     2
// see LICENSE.txt
krista@2964
     3
krista@2964
     4
#pragma once
krista@2964
     5
krista@2964
     6
#include "dynamic_api.h"
krista@2964
     7
#include "stringpair.h"
krista@2964
     8
krista@2964
     9
#ifdef __cplusplus
krista@2964
    10
extern "C" {
krista@2964
    11
#endif
krista@2964
    12
krista@2964
    13
typedef struct _labeled_int_list_t {
krista@2964
    14
    int value;
krista@2964
    15
    char* label;                                // UTF-8 string, null-terminated
krista@2964
    16
    struct _labeled_int_list_t *next;           // this is a single linked list
krista@2964
    17
} labeled_int_list_t;
krista@2964
    18
krista@3004
    19
DYNAMIC_API labeled_int_list_t *new_labeled_int_list(int value, const char* label);
krista@2964
    20
krista@3004
    21
DYNAMIC_API void free_labeled_int_list(labeled_int_list_t *labeled_int_list);
krista@2964
    22
krista@3004
    23
DYNAMIC_API labeled_int_list_t *labeled_int_list_dup(const labeled_int_list_t *src);
krista@2964
    24
krista@3004
    25
DYNAMIC_API labeled_int_list_t *labeled_int_list_add(labeled_int_list_t *labeled_int_list, int value, const char* label);
krista@2964
    26
krista@3004
    27
DYNAMIC_API int labeled_int_list_length(const labeled_int_list_t *labeled_int_list);
krista@2964
    28
krista@2964
    29
#ifdef __cplusplus
krista@2964
    30
}
krista@2964
    31
#endif