#include "clisp.h"

extern gcv_object_t module__wildcard__object_tab[];
#include "config.h"
#include "fnmatch.h"

subr_t module__wildcard__subr_tab[1];
uintC module__wildcard__subr_tab_size = 0;
subr_initdata_t module__wildcard__subr_tab_initdata[1];

gcv_object_t module__wildcard__object_tab[1];
object_initdata_t module__wildcard__object_tab_initdata[1];
uintC module__wildcard__object_tab_size = 0;

long MODULE__WILDCARD__CONSTANT_MAP_LONG (int number, int *definedp);
long MODULE__WILDCARD__CONSTANT_MAP_LONG (int number, int *definedp) {
  *definedp=1;
  switch (number) {
#  if defined(FNM_PATHNAME)
    case 0: return FNM_PATHNAME;
#  endif
#  if defined(FNM_FILE_NAME)
    case 1: return FNM_FILE_NAME;
#  endif
#  if defined(FNM_NOESCAPE)
    case 2: return FNM_NOESCAPE;
#  endif
#  if defined(FNM_PERIOD)
    case 3: return FNM_PERIOD;
#  endif
#  if defined(FNM_LEADING_DIR)
    case 4: return FNM_LEADING_DIR;
#  endif
#  if defined(FNM_CASEFOLD)
    case 5: return FNM_CASEFOLD;
#  endif
    default: *definedp=0; return 0;
  }
}

void module__wildcard__init_function_1 (module_t* module);

void module__wildcard__init_function_2 (module_t* module);

void module__wildcard__fini_function (module_t* module);


void module__wildcard__init_function_1 (module_t* module)
{
  register_foreign_inttype("ssize_t",sizeof(ssize_t),(ssize_t)-1<=(ssize_t)0);
  register_foreign_inttype("size_t",sizeof(size_t),(size_t)-1<=(size_t)0);
}

void module__wildcard__init_function_2 (module_t* module)
{
  register_foreign_function((void*)&fnmatch,"fnmatch",1024);
  register_foreign_function((void*)&MODULE__WILDCARD__CONSTANT_MAP_LONG,"MODULE__WILDCARD__CONSTANT_MAP_LONG",1024);
}

void module__wildcard__fini_function (module_t* module)
{
}
