module-dir.c revision 6a125dfb789cc44826e965987576fabb33425c01
/* Copyright (C) 2003 Timo Sirainen */
#include "lib.h"
#include "module-dir.h"
#ifdef HAVE_MODULES
#include <unistd.h>
#include <dirent.h>
#include <dlfcn.h>
#ifndef RTLD_GLOBAL
# define RTLD_GLOBAL 0
#endif
#ifndef RTLD_NOW
# define RTLD_NOW 0
#endif
{
const char *error;
void *ret;
/* get our init func */
}
return ret;
}
{
void *handle;
void (*init)(void);
void (*deinit)(void);
return NULL;
}
/* get our init func */
return NULL;
}
init();
return module;
}
{
struct dirent *d;
return NULL;
}
if (name[0] == '.')
continue;
continue;
name += 3;
t_push();
t_pop();
}
}
return modules;
}
{
i_error("dlclose() failed: %m");
}
}
#else
{
i_error("Dynamically loadable module support not built in");
return NULL;
}
{
}
#endif