/* * Copyright (c) 2018 Markus Hennecke * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef __HELPER_H__ #define __HELPER_H__ #include #include struct memmap { void *data; size_t size; }; struct md_mmap { struct memmap *mmap; bool md; char *html; size_t htmlsz; }; const char *rx_get_errormsg(int, regex_t *); void decode_string(char *); struct memmap *memmap_new(const char *); struct memmap *memmap_new_at(int, const char *); void memmap_free(struct memmap *); size_t memmap_chomp(struct memmap *); struct md_mmap *md_mmap_new(const char *); struct md_mmap *md_mmap_new_at(int, const char *); struct md_mmap *md_mmap_new_from_memmap(struct memmap *); void md_mmap_free(struct md_mmap *); void md_mmap_parse(struct md_mmap *); void md_mmap_content(struct md_mmap *, void **, size_t *); #endif // __HELPER_H__