deque.h | deque.h | |||
---|---|---|---|---|
#ifndef _LIBHX_DEQUE_H | #ifndef _LIBHX_DEQUE_H | |||
#define _LIBHX_DEQUE_H 1 | #define _LIBHX_DEQUE_H 1 | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
# include <cstdlib> | ||||
#else | ||||
# include <stdlib.h> | ||||
#endif | ||||
#ifdef __cplusplus | ||||
extern "C" { | extern "C" { | |||
#endif | #endif | |||
struct HXdeque_node { | struct HXdeque_node { | |||
struct HXdeque_node *next; | struct HXdeque_node *next; | |||
union { | union { | |||
void *ptr; | void *ptr; | |||
char *sptr; | char *sptr; | |||
}; | }; | |||
struct HXdeque *parent; | struct HXdeque *parent; | |||
skipping to change at line 35 | skipping to change at line 41 | |||
extern struct HXdeque *HXdeque_init(void); | extern struct HXdeque *HXdeque_init(void); | |||
extern struct HXdeque_node *HXdeque_push(struct HXdeque *, const void *); | extern struct HXdeque_node *HXdeque_push(struct HXdeque *, const void *); | |||
extern struct HXdeque_node *HXdeque_unshift(struct HXdeque *, const void *) ; | extern struct HXdeque_node *HXdeque_unshift(struct HXdeque *, const void *) ; | |||
extern void *HXdeque_pop(struct HXdeque *); | extern void *HXdeque_pop(struct HXdeque *); | |||
extern void *HXdeque_shift(struct HXdeque *); | extern void *HXdeque_shift(struct HXdeque *); | |||
extern void HXdeque_move(struct HXdeque_node *, struct HXdeque_node *); | extern void HXdeque_move(struct HXdeque_node *, struct HXdeque_node *); | |||
extern struct HXdeque_node *HXdeque_find(struct HXdeque *, const void *); | extern struct HXdeque_node *HXdeque_find(struct HXdeque *, const void *); | |||
extern void *HXdeque_get(struct HXdeque *, const void *); | extern void *HXdeque_get(struct HXdeque *, const void *); | |||
extern void *HXdeque_del(struct HXdeque_node *); | extern void *HXdeque_del(struct HXdeque_node *); | |||
extern void HXdeque_free(struct HXdeque *); | extern void HXdeque_free(struct HXdeque *); | |||
extern void HXdeque_genocide(struct HXdeque *); | extern void HXdeque_genocide2(struct HXdeque *, void (*)(void *)); | |||
extern void **HXdeque_to_vec(const struct HXdeque *, unsigned int *); | extern void **HXdeque_to_vec(const struct HXdeque *, unsigned int *); | |||
static inline void HXdeque_genocide(struct HXdeque *dq) | ||||
{ | ||||
HXdeque_genocide2(dq, free); | ||||
} | ||||
#ifdef __cplusplus | #ifdef __cplusplus | |||
} /* extern "C" */ | } /* extern "C" */ | |||
extern "C++" { | extern "C++" { | |||
template<typename type> static inline type HXdeque_pop(struct HXdeque *dq) | template<typename type> static inline type HXdeque_pop(struct HXdeque *dq) | |||
{ | { | |||
return reinterpret_cast<type>(HXdeque_pop(dq)); | return reinterpret_cast<type>(HXdeque_pop(dq)); | |||
} | } | |||
End of changes. 3 change blocks. | ||||
1 lines changed or deleted | 12 lines changed or added | |||
misc.h | misc.h | |||
---|---|---|---|---|
skipping to change at line 87 | skipping to change at line 87 | |||
extern void HX_diff_timeval(struct timeval *, | extern void HX_diff_timeval(struct timeval *, | |||
const struct timeval *, const struct timeval *); | const struct timeval *, const struct timeval *); | |||
extern long HX_time_compare(const struct stat *, const struct stat *, char) ; | extern long HX_time_compare(const struct stat *, const struct stat *, char) ; | |||
extern void HX_zvecfree(char **); | extern void HX_zvecfree(char **); | |||
/* | /* | |||
* RAND.C | * RAND.C | |||
*/ | */ | |||
extern int HX_rand(void); | extern int HX_rand(void); | |||
extern unsigned int HX_irand(unsigned int, unsigned int); | extern unsigned int HX_irand(unsigned int, unsigned int); | |||
extern double HX_drand(double, double); | ||||
/* | /* | |||
* INLINE FUNCTIONS | * INLINE FUNCTIONS | |||
*/ | */ | |||
static inline int HX_zveclen(const char *const *args) | static inline int HX_zveclen(const char *const *args) | |||
{ | { | |||
int argk = 0; | int argk = 0; | |||
while (*args++ != NULL) | while (*args++ != NULL) | |||
++argk; | ++argk; | |||
return argk; | return argk; | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 1 lines changed or added | |||
option.h | option.h | |||
---|---|---|---|---|
skipping to change at line 36 | skipping to change at line 36 | |||
extern struct HXformat_map *HXformat_init(void); | extern struct HXformat_map *HXformat_init(void); | |||
extern void HXformat_free(struct HXformat_map *); | extern void HXformat_free(struct HXformat_map *); | |||
extern int HXformat_add(struct HXformat_map *, const char *, const void *, | extern int HXformat_add(struct HXformat_map *, const char *, const void *, | |||
unsigned int); | unsigned int); | |||
extern int HXformat_aprintf(const struct HXformat_map *, | extern int HXformat_aprintf(const struct HXformat_map *, | |||
hxmc_t **, const char *); | hxmc_t **, const char *); | |||
extern int HXformat_sprintf(const struct HXformat_map *, | extern int HXformat_sprintf(const struct HXformat_map *, | |||
char *, size_t, const char *); | char *, size_t, const char *); | |||
extern int HXformat_fprintf(const struct HXformat_map *, | extern int HXformat_fprintf(const struct HXformat_map *, | |||
FILE *, const char *); | FILE *, const char *); | |||
extern int HXformat2_aprintf(const struct HXformat_map *, | ||||
hxmc_t **, const char *); | ||||
extern int HXformat2_sprintf(const struct HXformat_map *, | ||||
char *, size_t, const char *); | ||||
extern int HXformat2_fprintf(const struct HXformat_map *, | ||||
FILE *, const char *); | ||||
/* | /* | |||
* OPT.C | * OPT.C | |||
*/ | */ | |||
enum { | enum { | |||
/* .type */ | /* .type */ | |||
HXTYPE_NONE = 0, | HXTYPE_NONE = 0, | |||
/* for opt: set specific integer value */ | /* for opt: set specific integer value */ | |||
HXTYPE_VAL, | HXTYPE_VAL, | |||
/* for opt: set specific string value */ | /* for opt: set specific string value */ | |||
skipping to change at line 142 | skipping to change at line 148 | |||
const char *sval, *help, *htyp; | const char *sval, *help, *htyp; | |||
}; | }; | |||
extern int HX_getopt(const struct HXoption *, int *, const char ***, | extern int HX_getopt(const struct HXoption *, int *, const char ***, | |||
unsigned int); | unsigned int); | |||
extern void HX_getopt_help(const struct HXoptcb *, FILE *); | extern void HX_getopt_help(const struct HXoptcb *, FILE *); | |||
extern void HX_getopt_help_cb(const struct HXoptcb *); | extern void HX_getopt_help_cb(const struct HXoptcb *); | |||
extern void HX_getopt_usage(const struct HXoptcb *, FILE *); | extern void HX_getopt_usage(const struct HXoptcb *, FILE *); | |||
extern void HX_getopt_usage_cb(const struct HXoptcb *); | extern void HX_getopt_usage_cb(const struct HXoptcb *); | |||
extern int HX_shconfig(const char *, const struct HXoption *); | extern int HX_shconfig(const char *, const struct HXoption *); | |||
extern struct HXmap *HX_shconfig_map(const char *); | ||||
extern int HX_shconfig_pv(const char **, const char *, | extern int HX_shconfig_pv(const char **, const char *, | |||
const struct HXoption *, unsigned int); | const struct HXoption *, unsigned int); | |||
extern void HX_shconfig_free(const struct HXoption *); | extern void HX_shconfig_free(const struct HXoption *); | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
} /* extern "C" */ | } /* extern "C" */ | |||
#endif | #endif | |||
#ifndef __cplusplus | #ifndef __cplusplus | |||
# define HXOPT_AUTOHELP \ | # define HXOPT_AUTOHELP \ | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 7 lines changed or added | |||
string.h | string.h | |||
---|---|---|---|---|
skipping to change at line 32 | skipping to change at line 32 | |||
HXQUOTE_HTML, | HXQUOTE_HTML, | |||
_HXQUOTE_MAX, | _HXQUOTE_MAX, | |||
}; | }; | |||
#ifndef __libhx_internal_hxmc_t_defined | #ifndef __libhx_internal_hxmc_t_defined | |||
#define __libhx_internal_hxmc_t_defined 1 | #define __libhx_internal_hxmc_t_defined 1 | |||
typedef char hxmc_t; | typedef char hxmc_t; | |||
#endif | #endif | |||
/* | /* | |||
* HMC.C | * MC.C | |||
*/ | */ | |||
extern hxmc_t *HXmc_strinit(const char *); | extern hxmc_t *HXmc_strinit(const char *); | |||
extern hxmc_t *HXmc_meminit(const void *, size_t); | extern hxmc_t *HXmc_meminit(const void *, size_t); | |||
extern hxmc_t *HXmc_strcpy(hxmc_t **, const char *); | extern hxmc_t *HXmc_strcpy(hxmc_t **, const char *); | |||
extern hxmc_t *HXmc_memcpy(hxmc_t **, const void *, size_t); | extern hxmc_t *HXmc_memcpy(hxmc_t **, const void *, size_t); | |||
extern size_t HXmc_length(const hxmc_t *); | extern size_t HXmc_length(const hxmc_t *); | |||
extern hxmc_t *HXmc_setlen(hxmc_t **, size_t); | extern hxmc_t *HXmc_setlen(hxmc_t **, size_t); | |||
extern hxmc_t *HXmc_trunc(hxmc_t **, size_t); | extern hxmc_t *HXmc_trunc(hxmc_t **, size_t); | |||
extern hxmc_t *HXmc_strcat(hxmc_t **, const char *); | extern hxmc_t *HXmc_strcat(hxmc_t **, const char *); | |||
extern hxmc_t *HXmc_memcat(hxmc_t **, const void *, size_t); | extern hxmc_t *HXmc_memcat(hxmc_t **, const void *, size_t); | |||
extern hxmc_t *HXmc_strpcat(hxmc_t **, const char *); | extern hxmc_t *HXmc_strpcat(hxmc_t **, const char *); | |||
extern hxmc_t *HXmc_mempcat(hxmc_t **, const void *, size_t); | extern hxmc_t *HXmc_mempcat(hxmc_t **, const void *, size_t); | |||
extern hxmc_t *HXmc_strins(hxmc_t **, size_t, const char *); | extern hxmc_t *HXmc_strins(hxmc_t **, size_t, const char *); | |||
extern hxmc_t *HXmc_memins(hxmc_t **, size_t, const void *, size_t); | extern hxmc_t *HXmc_memins(hxmc_t **, size_t, const void *, size_t); | |||
extern hxmc_t *HXmc_memdel(hxmc_t *, size_t, size_t); | extern hxmc_t *HXmc_memdel(hxmc_t *, size_t, size_t); | |||
extern void HXmc_free(hxmc_t *); | extern void HXmc_free(hxmc_t *); | |||
extern void HXmc_zvecfree(hxmc_t **); | ||||
/* | /* | |||
* STRING.C | * STRING.C | |||
*/ | */ | |||
extern char *HX_basename(const char *); | extern char *HX_basename(const char *); | |||
extern char *HX_basename_exact(const char *); | extern char *HX_basename_exact(const char *); | |||
extern char *HX_chomp(char *); | extern char *HX_chomp(char *); | |||
extern char *HX_dirname(const char *); | extern char *HX_dirname(const char *); | |||
extern hxmc_t *HX_getl(hxmc_t **, FILE *); | extern hxmc_t *HX_getl(hxmc_t **, FILE *); | |||
extern char **HX_split(const char *, const char *, int *, int); | extern char **HX_split(const char *, const char *, int *, int); | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 2 lines changed or added | |||