// Copyright status: this file is in the public domain. #include #include "lx.h" #include "internal.h" void lx_hostlist_free(LX_HOSTLIST *hl) { free(hl->types); free(hl->sizes); free(hl->data); free(hl->alldata); free(hl); } int lx_hostlist_entries(const LX_HOSTLIST *hl) { return(hl->len); } LX_HOSTTYPE lx_hostlist_entry_type(const LX_HOSTLIST *hl, int x) { if ((x < 0) || (x >= hl->len)) return(LX_HOSTTYPE_Error); return(hl->types[x]); } int lx_hostlist_entry_size(const LX_HOSTLIST *hl, int x) { if ((x < 0) || (x >= hl->len)) return(-1); return(hl->sizes[x]); } const void *lx_hostlist_entry_data(const LX_HOSTLIST *hl, int x) { if ((x < 0) || (x >= hl->len)) return(0); return(hl->data[x]); }