configure.ac: fix sdl1 always-on-misdetection, dont use sdl-config
[rofl0r-gnuboy.git] / exports.c
blobf649dcd96e2fe0ca4d992252c7b11fc90654645b
1 #include <stdio.h>
2 #include <stdlib.h>
4 #include "rc.h"
6 extern rcvar_t rcfile_exports[], emu_exports[], loader_exports[],
7 lcd_exports[], rtc_exports[], debug_exports[], sound_exports[],
8 vid_exports[], joy_exports[], pcm_exports[];
11 rcvar_t *sources[] =
13 rcfile_exports,
14 emu_exports,
15 loader_exports,
16 lcd_exports,
17 rtc_exports,
18 debug_exports,
19 sound_exports,
20 vid_exports,
21 joy_exports,
22 pcm_exports,
23 NULL
27 void init_exports()
29 rcvar_t **s = sources;
31 while (*s)
32 rc_exportvars(*(s++));
36 void show_exports()
38 int i, j, n, *vec;
39 char value[256], tbuf[16], *v;
41 for (i = 0; sources[i]; i++)
42 for (j = 0; sources[i][j].name; j++) {
43 v = value;
44 sprintf(tbuf, "%-4s", rc_type_to_string(sources[i][j].type));
45 switch (sources[i][j].type) {
46 case rcv_bool:
47 case rcv_int:
48 sprintf(value, "%d", rc_getint(sources[i][j].name));
49 break;
50 case rcv_string:
51 v = rc_getstr(sources[i][j].name);
52 v = v ? v : "";
53 break;
54 case rcv_vector:
55 sprintf(tbuf+3, "%d", sources[i][j].len);
56 vec = rc_getvec(sources[i][j].name);
57 if (vec)
58 for (n = 0; n < sources[i][j].len; ++n) {
59 if (*vec > 999)
60 v += sprintf(v, "0x%x ", *(vec++));
61 else
62 v += sprintf(v, "%d ", *(vec++));
64 else value[0] = 0;
65 v = value;
66 break;
68 printf("%-11s %-35s %-4s %-8s\n",
69 sources[i][j].name,
70 sources[i][j].help[0] == 0 ? "-" : sources[i][j].help,
71 tbuf,