Fix typo in the Gentoo initscript.
[fbsplash.git] / gentoo / test.c
blobc43464df0dbf4e0aaae9a657001d61d76122dafe
1 #include <stdlib.h>
2 #include <stdio.h>
3 #include <string.h>
4 #include <dlfcn.h>
6 #include <rc.h>
7 #include <errno.h>
8 #include <sys/mount.h>
10 #define SPLASH_CACHEDIR "/lib/splash/cache"
11 #define SPLASH_TMPDIR "/lib/splash/tmp"
14 int (*spf)(rc_hook_t hook, const char *name) = NULL;
16 int main(int argc, char **argv)
18 void *h = dlopen("./splash.so", RTLD_LAZY);
19 void *f = dlsym(h, "_splash_hook");
20 char **list;
21 int i = 0;
23 // rename(SPLASH_TMPDIR"/profile", SPLASH_CACHEDIR"/profile");
25 rc_depinfo_t *deptree = NULL;
27 deptree = rc_load_deptree();
28 list = rc_order_services (deptree, "reboot", RC_DEP_STOP);
30 while(list && list[i]) {
31 printf("%s ", list[i]);
32 i++;
35 printf("\n");
37 /*f (mount("cachedir", SPLASH_CACHEDIR, "tmpfs", MS_MGC_VAL, "mode=0644,size=4096k")) {
38 printf("failed: %s\n", strerror(errno));
41 return 0;
43 spf = f;
44 /* spf(rc_hook_runlevel_stop_in, "reboot");
45 spf(rc_hook_service_stop_in, "keymaps");
47 spf(rc_hook_runlevel_start_in, "boot");
48 spf(rc_hook_service_start_in, "keymaps");
49 spf(rc_hook_service_start_out, "keymaps");
51 return 0;