~ubuntu-branches/ubuntu/trusty/vice/trusty-proposed

« back to all changes in this revision

Viewing changes to src/fsdevice/fsdevice-resources.c

  • Committer: Bazaar Package Importer
  • Author(s): Gerfried Fuchs
  • Date: 2008-10-16 20:28:53 UTC
  • mfrom: (1.2.1 upstream) (9.1.6 intrepid)
  • Revision ID: james.westby@ubuntu.com-20081016202853-vo9c1g9pd15wl7zu
Tags: 1.22.dfsg1-0.1
* NMU to fix release-critical bugs.
* Add data/PRINTER/mps803 to mangle-source.sh check, it's not a multiple of
  2048. Also fix the bashism in the script by replacing $[ ] with $(( )) in
  the calculation part.
* Mangled the source with above fixed script (closes: #442924, #501143)
* do delete -size 6c files and not -empty, they contain "dummy\n"
* Remove README.Debian entry about Xaw3d and Gnome because it's not valid
  anymore (closes: #501135)
* Remove the following Build-Depends as they aren't used because of no xaw3d
  build: xaw3dg-dev, libxaw7-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
char *fsdevice_dir[4] = { NULL, NULL, NULL, NULL };
43
43
 
44
44
 
45
 
static int set_fsdevice_convert_p00(resource_value_t v, void *param)
 
45
static int set_fsdevice_convert_p00(int val, void *param)
46
46
{
47
 
    fsdevice_convert_p00_enabled[(int)param - 8] = (int)v;
 
47
    fsdevice_convert_p00_enabled[(int)param - 8] = val;
48
48
    return 0;
49
49
}
50
50
 
51
 
static int set_fsdevice_dir(resource_value_t v, void *param)
 
51
static int set_fsdevice_dir(const char *name, void *param)
52
52
{
53
 
    const char *name = (const char *)v;
54
 
 
55
53
    util_string_set(&fsdevice_dir[(int)param - 8], name ? name : "");
56
54
    return 0;
57
55
}
58
56
 
59
 
static int set_fsdevice_save_p00(resource_value_t v, void *param)
 
57
static int set_fsdevice_save_p00(int val, void *param)
60
58
{
61
 
    fsdevice_save_p00_enabled[(int)param - 8] = (int)v;
 
59
    fsdevice_save_p00_enabled[(int)param - 8] = val;
62
60
    return 0;
63
61
}
64
62
 
65
 
static int set_fsdevice_hide_cbm_files(resource_value_t v, void *param)
 
63
static int set_fsdevice_hide_cbm_files(int val, void *param)
66
64
{
67
 
    int val = (int)v;
68
 
 
69
65
    if (val && !fsdevice_convert_p00_enabled[(int)param - 8])
70
66
        return -1;
71
67
 
75
71
 
76
72
/* ------------------------------------------------------------------------- */
77
73
 
78
 
static const resource_t resources[] = {
79
 
    { "FSDevice8ConvertP00", RES_INTEGER, (resource_value_t)1,
80
 
      (void *)&fsdevice_convert_p00_enabled[0],
 
74
static const resource_string_t resources_string[] = {
 
75
    { "FSDevice8Dir", FSDEVICE_DEFAULT_DIR, RES_EVENT_NO, NULL,
 
76
      (void *)&fsdevice_dir[0], set_fsdevice_dir, (void *)8 },
 
77
    { "FSDevice9Dir", FSDEVICE_DEFAULT_DIR, RES_EVENT_NO, NULL,
 
78
      (void *)&fsdevice_dir[1], set_fsdevice_dir, (void *)9 },
 
79
    { "FSDevice10Dir", FSDEVICE_DEFAULT_DIR, RES_EVENT_NO, NULL,
 
80
      (void *)&fsdevice_dir[2], set_fsdevice_dir, (void *)10 },
 
81
    { "FSDevice11Dir", FSDEVICE_DEFAULT_DIR, RES_EVENT_NO, NULL,
 
82
      (void *)&fsdevice_dir[3], set_fsdevice_dir, (void *)11 },
 
83
    { NULL }
 
84
};
 
85
 
 
86
static const resource_int_t resources_int[] = {
 
87
    { "FSDevice8ConvertP00", 1, RES_EVENT_NO, NULL,
 
88
      &fsdevice_convert_p00_enabled[0],
81
89
      set_fsdevice_convert_p00, (void *)8 },
82
 
    { "FSDevice9ConvertP00", RES_INTEGER, (resource_value_t)1,
83
 
      (void *)&fsdevice_convert_p00_enabled[1],
 
90
    { "FSDevice9ConvertP00", 1, RES_EVENT_NO, NULL,
 
91
      &fsdevice_convert_p00_enabled[1],
84
92
      set_fsdevice_convert_p00, (void *)9 },
85
 
    { "FSDevice10ConvertP00", RES_INTEGER, (resource_value_t)1,
86
 
      (void *)&fsdevice_convert_p00_enabled[2],
 
93
    { "FSDevice10ConvertP00", 1, RES_EVENT_NO, NULL,
 
94
      &fsdevice_convert_p00_enabled[2],
87
95
      set_fsdevice_convert_p00, (void *)10 },
88
 
    { "FSDevice11ConvertP00", RES_INTEGER, (resource_value_t)1,
89
 
      (void *)&fsdevice_convert_p00_enabled[3],
 
96
    { "FSDevice11ConvertP00", 1, RES_EVENT_NO, NULL,
 
97
      &fsdevice_convert_p00_enabled[3],
90
98
      set_fsdevice_convert_p00, (void *)11 },
91
 
    { "FSDevice8Dir", RES_STRING, (resource_value_t)FSDEVICE_DEFAULT_DIR,
92
 
      (void *)&fsdevice_dir[0], set_fsdevice_dir, (void *)8 },
93
 
    { "FSDevice9Dir", RES_STRING, (resource_value_t)FSDEVICE_DEFAULT_DIR,
94
 
      (void *)&fsdevice_dir[1], set_fsdevice_dir, (void *)9 },
95
 
    { "FSDevice10Dir", RES_STRING, (resource_value_t)FSDEVICE_DEFAULT_DIR,
96
 
      (void *)&fsdevice_dir[2], set_fsdevice_dir, (void *)10 },
97
 
    { "FSDevice11Dir", RES_STRING, (resource_value_t)FSDEVICE_DEFAULT_DIR,
98
 
      (void *)&fsdevice_dir[3], set_fsdevice_dir, (void *)11 },
99
 
    { "FSDevice8SaveP00", RES_INTEGER, (resource_value_t)1,
100
 
      (void *)&fsdevice_save_p00_enabled[0],
 
99
    { "FSDevice8SaveP00", 1, RES_EVENT_NO, NULL,
 
100
      &fsdevice_save_p00_enabled[0],
101
101
      set_fsdevice_save_p00, (void *)8 },
102
 
    { "FSDevice9SaveP00", RES_INTEGER, (resource_value_t)1,
103
 
      (void *)&fsdevice_save_p00_enabled[1],
 
102
    { "FSDevice9SaveP00", 1, RES_EVENT_NO, NULL,
 
103
      &fsdevice_save_p00_enabled[1],
104
104
      set_fsdevice_save_p00, (void *)9 },
105
 
    { "FSDevice10SaveP00", RES_INTEGER, (resource_value_t)1,
106
 
      (void *)&fsdevice_save_p00_enabled[2],
 
105
    { "FSDevice10SaveP00", 1, RES_EVENT_NO, NULL,
 
106
      &fsdevice_save_p00_enabled[2],
107
107
      set_fsdevice_save_p00, (void *)10 },
108
 
    { "FSDevice11SaveP00", RES_INTEGER, (resource_value_t)0,
109
 
      (void *)&fsdevice_save_p00_enabled[3],
 
108
    { "FSDevice11SaveP00", 0, RES_EVENT_NO, NULL,
 
109
      &fsdevice_save_p00_enabled[3],
110
110
      set_fsdevice_save_p00, (void *)11 },
111
 
    { "FSDevice8HideCBMFiles", RES_INTEGER, (resource_value_t)0,
112
 
      (void *)&fsdevice_hide_cbm_files_enabled[0],
 
111
    { "FSDevice8HideCBMFiles", 0, RES_EVENT_NO, NULL,
 
112
      &fsdevice_hide_cbm_files_enabled[0],
113
113
      set_fsdevice_hide_cbm_files, (void *)8 },
114
 
    { "FSDevice9HideCBMFiles", RES_INTEGER, (resource_value_t)0,
115
 
      (void *)&fsdevice_hide_cbm_files_enabled[1],
 
114
    { "FSDevice9HideCBMFiles", 0, RES_EVENT_NO, NULL,
 
115
      &fsdevice_hide_cbm_files_enabled[1],
116
116
      set_fsdevice_hide_cbm_files, (void *)9 },
117
 
    { "FSDevice10HideCBMFiles", RES_INTEGER, (resource_value_t)0,
118
 
      (void *)&fsdevice_hide_cbm_files_enabled[2],
 
117
    { "FSDevice10HideCBMFiles", 0, RES_EVENT_NO, NULL,
 
118
      &fsdevice_hide_cbm_files_enabled[2],
119
119
      set_fsdevice_hide_cbm_files, (void *)10 },
120
 
    { "FSDevice11HideCBMFiles", RES_INTEGER, (resource_value_t)0,
121
 
      (void *)&fsdevice_hide_cbm_files_enabled[3],
 
120
    { "FSDevice11HideCBMFiles", 0, RES_EVENT_NO, NULL,
 
121
      &fsdevice_hide_cbm_files_enabled[3],
122
122
      set_fsdevice_hide_cbm_files, (void *)11 },
123
123
    { NULL }
124
124
};
125
125
 
126
126
int fsdevice_resources_init(void)
127
127
{
128
 
    return resources_register(resources);
 
128
    if (resources_register_string(resources_string) < 0)
 
129
        return -1;
 
130
 
 
131
    return resources_register_int(resources_int);
129
132
}
130
133
 
131
134
void fsdevice_resources_shutdown(void)