| 1 | /* |
| 2 | * Copyright (c) 2015 Moritz Grimm <[email protected]> |
| 3 | * |
| 4 | * Permission to use, copy, modify, and distribute this software for any |
| 5 | * purpose with or without fee is hereby granted, provided that the above |
| 6 | * copyright notice and this permission notice appear in all copies. |
| 7 | * |
| 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 15 | */ |
| 16 | |
| 17 | #ifndef __CFG_DECODER_H__ |
| 18 | #define __CFG_DECODER_H__ |
| 19 | |
| 20 | typedef struct cfg_decoder * cfg_decoder_t; |
| 21 | typedef struct cfg_decoder_list * cfg_decoder_list_t; |
| 22 | |
| 23 | cfg_decoder_list_t |
| 24 | cfg_decoder_list_create(void); |
| 25 | void cfg_decoder_list_destroy(cfg_decoder_list_t *); |
| 26 | unsigned int |
| 27 | cfg_decoder_list_nentries(cfg_decoder_list_t); |
| 28 | |
| 29 | cfg_decoder_t |
| 30 | cfg_decoder_list_find(cfg_decoder_list_t, const char *); |
| 31 | cfg_decoder_t |
| 32 | cfg_decoder_list_findext(cfg_decoder_list_t, const char *); |
| 33 | cfg_decoder_t |
| 34 | cfg_decoder_list_get(cfg_decoder_list_t, const char *); |
| 35 | void cfg_decoder_list_remove(cfg_decoder_list_t, cfg_decoder_t *); |
| 36 | void cfg_decoder_list_foreach(cfg_decoder_list_t, void (*)(cfg_decoder_t, |
| 37 | void *), void *); |
| 38 | |
| 39 | cfg_decoder_t |
| 40 | cfg_decoder_create(const char *); |
| 41 | void cfg_decoder_destroy(cfg_decoder_t *); |
| 42 | |
| 43 | int cfg_decoder_set_name(cfg_decoder_t, cfg_decoder_list_t, const char *, |
| 44 | const char **); |
| 45 | int cfg_decoder_set_program(cfg_decoder_t, cfg_decoder_list_t, |
| 46 | const char *, const char **); |
| 47 | int cfg_decoder_add_match(cfg_decoder_t, cfg_decoder_list_t, const char *, |
| 48 | const char **); |
| 49 | |
| 50 | int cfg_decoder_validate(cfg_decoder_t, const char **); |
| 51 | |
| 52 | int cfg_decoder_extsupport(cfg_decoder_t, const char *); |
| 53 | void cfg_decoder_ext_foreach(cfg_decoder_t, void (*)(const char *, void *), |
| 54 | void *); |
| 55 | |
| 56 | const char * |
| 57 | cfg_decoder_get_name(cfg_decoder_t); |
| 58 | const char * |
| 59 | cfg_decoder_get_program(cfg_decoder_t); |
| 60 | |
| 61 | #endif /* __CFG_DECODER_H__ */ |