~ubuntu-branches/ubuntu/vivid/rawstudio/vivid

« back to all changes in this revision

Viewing changes to src/conf_interface.c

  • Committer: Bazaar Package Importer
  • Author(s): Bernd Zeimetz
  • Date: 2011-07-28 17:36:32 UTC
  • mfrom: (2.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20110728173632-5czluz9ye3c83zc5
Tags: 2.0-1
* [3750b2cf] Merge commit 'upstream/2.0'
* [63637468] Removing Patch, not necessary anymore.
* [2fb580dc] Add new build-dependencies.
* [c57d953b] Run dh_autoreconf due to patches in configure.in
* [13febe39] Add patch to remove the libssl requirement.
* [5ae773fe] Replace libjpeg62-dev by libjpeg8-dev :)
* [1969d755] Don't build static libraries.
* [7cfe0a2e] Add a patch to fix the plugin directory path.
  As plugins are shared libraries, they need to go into /usr/lib,
  not into /usr/share.
  Thanks to Andrew McMillan
* [c1d0d9dd] Don't install .la files for all plugins and libraries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2006-2009 Anders Brander <anders@brander.dk> and 
3
 
 * Anders Kvist <akv@lnxbx.dk>
4
 
 *
5
 
 * This program is free software; you can redistribute it and/or
6
 
 * modify it under the terms of the GNU General Public License
7
 
 * as published by the Free Software Foundation; either version 2
8
 
 * of the License, or (at your option) any later version.
9
 
 *
10
 
 * This program is distributed in the hope that it will be useful,
11
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
 * GNU General Public License for more details.
14
 
 *
15
 
 * You should have received a copy of the GNU General Public License
16
 
 * along with this program; if not, write to the Free Software
17
 
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18
 
 */
19
 
 
20
 
#include <gtk/gtk.h>
21
 
#include <glib.h>
22
 
#include <stdio.h>
23
 
#include "rawstudio.h"
24
 
#include "conf_interface.h"
25
 
#include "lcms.h"
26
 
 
27
 
#ifdef G_OS_WIN32
28
 
 #define WITH_REGISTRY
29
 
 #undef WITH_GCONF
30
 
#endif
31
 
 
32
 
static GStaticMutex lock = G_STATIC_MUTEX_INIT;
33
 
 
34
 
#ifdef WITH_GCONF
35
 
 #include <gconf/gconf-client.h>
36
 
 #define GCONF_PATH "/apps/rawstudio/"
37
 
#else
38
 
 #ifdef G_OS_WIN32
39
 
  #include <windows.h>
40
 
  #define WITH_REGISTRY
41
 
  #define REGISTRY_KEY "Software\\Rawstudio"
42
 
 #endif
43
 
#endif
44
 
 
45
 
gboolean
46
 
rs_conf_get_boolean(const gchar *name, gboolean *boolean_value)
47
 
{
48
 
        gboolean ret = FALSE;
49
 
#ifdef WITH_GCONF
50
 
        GConfValue *gvalue;
51
 
        GConfClient *client = gconf_client_get_default();
52
 
        GString *fullname = g_string_new(GCONF_PATH);
53
 
        g_string_append(fullname, name);
54
 
        if (client)
55
 
        {
56
 
                g_static_mutex_lock(&lock);
57
 
                gvalue = gconf_client_get(client, fullname->str, NULL);
58
 
                g_static_mutex_unlock(&lock);
59
 
                if (gvalue)
60
 
                {
61
 
                        if (gvalue->type == GCONF_VALUE_BOOL)
62
 
                        {
63
 
                                ret = TRUE;
64
 
                                if (boolean_value)
65
 
                                        *boolean_value = gconf_value_get_bool(gvalue);
66
 
                        }
67
 
                        gconf_value_free(gvalue);
68
 
                }
69
 
                g_object_unref(client);
70
 
        }
71
 
        g_string_free(fullname, TRUE);
72
 
#endif
73
 
#ifdef WITH_REGISTRY
74
 
        ret = rs_conf_get_integer(name, boolean_value);
75
 
#endif
76
 
        return(ret);
77
 
}
78
 
 
79
 
gboolean
80
 
rs_conf_get_boolean_with_default(const gchar *name, gboolean *boolean_value, gboolean default_value)
81
 
{
82
 
        gboolean ret = FALSE;
83
 
        if (boolean_value)
84
 
                *boolean_value = default_value;
85
 
#ifdef WITH_GCONF
86
 
        GConfValue *gvalue;
87
 
        GConfClient *client = gconf_client_get_default();
88
 
        GString *fullname = g_string_new(GCONF_PATH);
89
 
        g_string_append(fullname, name);
90
 
        if (client)
91
 
        {
92
 
                g_static_mutex_lock(&lock);
93
 
                gvalue = gconf_client_get(client, fullname->str, NULL);
94
 
                g_static_mutex_unlock(&lock);
95
 
                if (gvalue)
96
 
                {
97
 
                        if (gvalue->type == GCONF_VALUE_BOOL)
98
 
                        {
99
 
                                ret = TRUE;
100
 
                                if (boolean_value)
101
 
                                        *boolean_value = gconf_value_get_bool(gvalue);
102
 
                        }
103
 
                        gconf_value_free(gvalue);
104
 
                }
105
 
                g_object_unref(client);
106
 
        }
107
 
        g_string_free(fullname, TRUE);
108
 
#endif
109
 
#ifdef WITH_REGISTRY
110
 
        ret = rs_conf_get_integer(name, boolean_value);
111
 
#endif
112
 
        return(ret);
113
 
}
114
 
 
115
 
gboolean
116
 
rs_conf_set_boolean(const gchar *name, gboolean bool_value)
117
 
{
118
 
        gboolean ret = FALSE;
119
 
#ifdef WITH_GCONF
120
 
        GConfClient *client = gconf_client_get_default();
121
 
        GString *fullname = g_string_new(GCONF_PATH);
122
 
        g_string_append(fullname, name);
123
 
        g_static_mutex_lock(&lock);
124
 
        if (client)
125
 
        {
126
 
                ret = gconf_client_set_bool(client, fullname->str, bool_value, NULL);
127
 
                g_object_unref(client);
128
 
        }
129
 
        g_static_mutex_unlock(&lock);
130
 
        g_string_free(fullname, TRUE);
131
 
#endif
132
 
#ifdef WITH_REGISTRY
133
 
        ret = rs_conf_set_integer(name, bool_value);
134
 
#endif
135
 
        return(ret);
136
 
}
137
 
 
138
 
gchar *
139
 
rs_conf_get_string(const gchar *name)
140
 
{
141
 
        gchar *ret=NULL;
142
 
#ifdef WITH_GCONF
143
 
        GConfValue *gvalue;
144
 
        GConfClient *client = gconf_client_get_default();
145
 
        GString *fullname = g_string_new(GCONF_PATH);
146
 
        g_string_append(fullname, name);
147
 
        if (client)
148
 
        {
149
 
                g_static_mutex_lock(&lock);
150
 
                gvalue = gconf_client_get(client, fullname->str, NULL);
151
 
                g_static_mutex_unlock(&lock);
152
 
                if (gvalue)
153
 
                {
154
 
                        if (gvalue->type == GCONF_VALUE_STRING)
155
 
                                ret = g_strdup(gconf_value_get_string(gvalue));
156
 
                        gconf_value_free(gvalue);
157
 
                }
158
 
                g_object_unref(client);
159
 
        }
160
 
        g_string_free(fullname, TRUE);
161
 
#endif
162
 
#ifdef WITH_REGISTRY
163
 
    HKEY hKey;
164
 
        char *szLwd;
165
 
    DWORD dwBufLen;
166
 
    LONG lRet;
167
 
 
168
 
        if (RegOpenKeyEx( HKEY_CURRENT_USER, REGISTRY_KEY, 0, KEY_QUERY_VALUE, &hKey ) == ERROR_SUCCESS)
169
 
        {
170
 
            lRet = RegQueryValueEx( hKey, name, NULL, NULL, NULL, &dwBufLen);
171
 
                if (dwBufLen > 0)
172
 
                {
173
 
                szLwd = g_malloc(dwBufLen);
174
 
                lRet = RegQueryValueEx( hKey, name, NULL, NULL, (LPBYTE) szLwd, &dwBufLen);
175
 
                RegCloseKey( hKey );
176
 
                if (lRet == ERROR_SUCCESS)
177
 
                                ret = szLwd;
178
 
                        else
179
 
                                g_free(szLwd);
180
 
                }
181
 
        }
182
 
#endif
183
 
        return(ret);
184
 
}
185
 
 
186
 
gboolean
187
 
rs_conf_set_string(const gchar *name, const gchar *string_value)
188
 
{
189
 
        gboolean ret = FALSE;
190
 
#ifdef WITH_GCONF
191
 
        GConfClient *client = gconf_client_get_default();
192
 
        GString *fullname = g_string_new(GCONF_PATH);
193
 
        g_string_append(fullname, name);
194
 
        if (client)
195
 
        {
196
 
                g_static_mutex_lock(&lock);
197
 
                ret = gconf_client_set_string(client, fullname->str, string_value, NULL);
198
 
                g_static_mutex_unlock(&lock);
199
 
                g_object_unref(client);
200
 
        }
201
 
        g_string_free(fullname, TRUE);
202
 
#endif
203
 
#ifdef WITH_REGISTRY
204
 
    HKEY hKey;
205
 
 
206
 
        if (RegCreateKeyEx(HKEY_CURRENT_USER, REGISTRY_KEY, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL) == ERROR_SUCCESS)
207
 
        {
208
 
                if (RegSetValueEx(hKey, name, 0, REG_SZ, (LPBYTE) string_value, (DWORD) (lstrlen(string_value)+1))==ERROR_SUCCESS)
209
 
                        ret = TRUE;
210
 
        }
211
 
    RegCloseKey(hKey);
212
 
#endif
213
 
        return ret;
214
 
}
215
 
 
216
 
gboolean
217
 
rs_conf_get_integer(const gchar *name, gint *integer_value)
218
 
{
219
 
        gboolean ret=FALSE;
220
 
#ifdef WITH_GCONF
221
 
        GConfValue *gvalue;
222
 
        GConfClient *client = gconf_client_get_default();
223
 
        GString *fullname = g_string_new(GCONF_PATH);
224
 
        g_string_append(fullname, name);
225
 
        if (client)
226
 
        {
227
 
                g_static_mutex_lock(&lock);
228
 
                gvalue = gconf_client_get(client, fullname->str, NULL);
229
 
                g_static_mutex_unlock(&lock);
230
 
                if (gvalue)
231
 
                {
232
 
                        if (gvalue->type == GCONF_VALUE_INT)
233
 
                        {
234
 
                                ret = TRUE;
235
 
                                *integer_value = gconf_value_get_int(gvalue);
236
 
                        }
237
 
                        gconf_value_free(gvalue);
238
 
                }
239
 
                g_object_unref(client);
240
 
        }
241
 
        g_string_free(fullname, TRUE);
242
 
#endif
243
 
#ifdef WITH_REGISTRY
244
 
    HKEY hKey;
245
 
    DWORD dwBufLen;
246
 
    LONG lRet;
247
 
 
248
 
        if (RegOpenKeyEx( HKEY_CURRENT_USER, REGISTRY_KEY, 0, KEY_QUERY_VALUE, &hKey ) == ERROR_SUCCESS)
249
 
        {
250
 
            lRet = RegQueryValueEx( hKey, name, NULL, NULL, NULL, &dwBufLen);
251
 
                if (dwBufLen > 0)
252
 
                {
253
 
                        gint val;
254
 
                        DWORD size = sizeof(gint);
255
 
                lRet = RegQueryValueEx( hKey, name, NULL, NULL, (LPBYTE) &val, &size);
256
 
                RegCloseKey( hKey );
257
 
                if ((lRet == ERROR_SUCCESS) && (size == sizeof(gint)))
258
 
                {
259
 
                                ret = TRUE;
260
 
                                *integer_value = val;
261
 
                        }
262
 
                }
263
 
        }
264
 
#endif
265
 
        return(ret);
266
 
}
267
 
 
268
 
gboolean
269
 
rs_conf_set_integer(const gchar *name, const gint integer_value)
270
 
{
271
 
        gboolean ret = FALSE;
272
 
#ifdef WITH_GCONF
273
 
        GConfClient *client = gconf_client_get_default();
274
 
        GString *fullname = g_string_new(GCONF_PATH);
275
 
        g_string_append(fullname, name);
276
 
        g_static_mutex_lock(&lock);
277
 
        if (client)
278
 
        {
279
 
                ret = gconf_client_set_int(client, fullname->str, integer_value, NULL);
280
 
                g_object_unref(client);
281
 
        }
282
 
        g_static_mutex_unlock(&lock);
283
 
        g_string_free(fullname, TRUE);
284
 
#endif
285
 
#ifdef WITH_REGISTRY
286
 
    HKEY hKey;
287
 
 
288
 
        if (RegCreateKeyEx(HKEY_CURRENT_USER, REGISTRY_KEY, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL) == ERROR_SUCCESS)
289
 
        {
290
 
                if (RegSetValueEx(hKey, name, 0, REG_DWORD, (LPBYTE) &integer_value, sizeof(gint))==ERROR_SUCCESS)
291
 
                        ret = TRUE;
292
 
        }
293
 
    RegCloseKey(hKey);
294
 
#endif
295
 
        return(ret);
296
 
}
297
 
 
298
 
gboolean
299
 
rs_conf_get_color(const gchar *name, GdkColor *color)
300
 
{
301
 
        gchar *str;
302
 
        gboolean ret = FALSE;
303
 
 
304
 
        str = rs_conf_get_string(name);
305
 
        if (str)
306
 
        {
307
 
                ret = gdk_color_parse(str, color);
308
 
                g_free(str);
309
 
        }
310
 
        return(ret);
311
 
}
312
 
 
313
 
gboolean
314
 
rs_conf_set_color(const gchar *name, GdkColor *color)
315
 
{
316
 
        gchar *str;
317
 
        gboolean ret = FALSE;
318
 
 
319
 
        str = g_strdup_printf ("#%02x%02x%02x", color->red>>8, color->green>>8, color->blue>>8);
320
 
        if (str)
321
 
        {
322
 
                ret = rs_conf_set_string(name, str);
323
 
                g_free(str);
324
 
        }
325
 
        return(ret);
326
 
}
327
 
 
328
 
static const struct {
329
 
        gint intent;
330
 
        gchar *name;
331
 
} intents[] =  {
332
 
        {INTENT_PERCEPTUAL, "perceptual"},
333
 
        {INTENT_RELATIVE_COLORIMETRIC, "relative"},
334
 
        {INTENT_SATURATION, "saturation"},
335
 
        {INTENT_ABSOLUTE_COLORIMETRIC, "absolute"},
336
 
        {-1, NULL}
337
 
};
338
 
 
339
 
gboolean
340
 
rs_conf_get_cms_intent(const gchar *name, gint *intent)
341
 
{
342
 
        gchar *str;
343
 
        gboolean ret = FALSE;
344
 
        gint n = 0;
345
 
 
346
 
        str = rs_conf_get_string(name);
347
 
        if (str)
348
 
        {
349
 
                while(intents[n].name)
350
 
                {
351
 
                        if (g_ascii_strncasecmp(intents[n].name, str, 15) == 0)
352
 
                        {
353
 
                                *intent = intents[n].intent;
354
 
                                ret = TRUE;
355
 
                                break;
356
 
                        }
357
 
                        n++;
358
 
                }
359
 
                g_free(str);
360
 
        }
361
 
 
362
 
        return(ret);
363
 
}
364
 
 
365
 
gboolean
366
 
rs_conf_set_cms_intent(const gchar *name, gint *intent)
367
 
{
368
 
        gboolean ret = FALSE;
369
 
        gchar *str = NULL;
370
 
        gint n = 0;
371
 
 
372
 
        while(intents[n].name)
373
 
        {
374
 
                if (*intent == intents[n].intent)
375
 
                {
376
 
                        str = intents[n].name;
377
 
                        ret = TRUE;
378
 
                        break;
379
 
                }
380
 
                n++;
381
 
        }
382
 
 
383
 
        if (str)
384
 
                ret = rs_conf_set_string(name, str);
385
 
 
386
 
        return(ret);
387
 
}
388
 
 
389
 
gchar *
390
 
rs_conf_get_cms_profile(gint type)
391
 
{
392
 
        gchar *ret = NULL;
393
 
        gint selected = 0;
394
 
        if (type == CMS_PROFILE_INPUT)
395
 
        {
396
 
                rs_conf_get_integer(CONF_CMS_IN_PROFILE_SELECTED, &selected);
397
 
                if (selected > 0)
398
 
                        ret = rs_conf_get_nth_string_from_list_string(CONF_CMS_IN_PROFILE_LIST, --selected);
399
 
        }
400
 
        else if (type == CMS_PROFILE_DISPLAY)
401
 
        {
402
 
                rs_conf_get_integer(CONF_CMS_DI_PROFILE_SELECTED, &selected);
403
 
                if (selected > 0)
404
 
                        ret = rs_conf_get_nth_string_from_list_string(CONF_CMS_DI_PROFILE_LIST, --selected);
405
 
        } 
406
 
        else if (type == CMS_PROFILE_EXPORT)
407
 
        {
408
 
                rs_conf_get_integer(CONF_CMS_EX_PROFILE_SELECTED, &selected);
409
 
                if (selected > 0)
410
 
                        ret = rs_conf_get_nth_string_from_list_string(CONF_CMS_EX_PROFILE_LIST, --selected);
411
 
        }
412
 
 
413
 
        return ret;
414
 
}
415
 
 
416
 
gboolean
417
 
rs_conf_get_filetype(const gchar *name, RS_FILETYPE **target)
418
 
{
419
 
        extern RS_FILETYPE *filetypes;
420
 
        RS_FILETYPE *filetype = filetypes, *def=NULL;
421
 
        gchar *str;
422
 
        str = rs_conf_get_string(name);
423
 
        while(filetype)
424
 
        {
425
 
                if (0==g_ascii_strcasecmp(filetype->id, DEFAULT_CONF_EXPORT_FILETYPE))
426
 
                        def = filetype;
427
 
                if (str)
428
 
                        if (0==g_ascii_strcasecmp(filetype->id, str))
429
 
                        {
430
 
                                *target = filetype;
431
 
                                g_free(str);
432
 
                                return(TRUE);
433
 
                        }
434
 
                filetype = filetype->next;
435
 
        }
436
 
        if (str)
437
 
                g_free(str);
438
 
        *target = def;
439
 
        return(FALSE);
440
 
}
441
 
 
442
 
gboolean
443
 
rs_conf_set_filetype(const gchar *name, const RS_FILETYPE *filetype)
444
 
{
445
 
        gchar *str;
446
 
        gboolean ret = FALSE;
447
 
        if (filetype)
448
 
        {
449
 
                str = filetype->id;
450
 
                if (str)
451
 
                        ret = rs_conf_set_string(name, str);
452
 
        }
453
 
        return(ret);
454
 
}
455
 
 
456
 
gboolean
457
 
rs_conf_get_double(const gchar *name, gdouble *float_value)
458
 
{
459
 
        gboolean ret=FALSE;
460
 
#ifdef WITH_GCONF
461
 
        GConfValue *gvalue;
462
 
        GConfClient *client = gconf_client_get_default();
463
 
        GString *fullname = g_string_new(GCONF_PATH);
464
 
        g_string_append(fullname, name);
465
 
        if (client)
466
 
        {
467
 
                g_static_mutex_lock(&lock);
468
 
                gvalue = gconf_client_get(client, fullname->str, NULL);
469
 
                g_static_mutex_unlock(&lock);
470
 
                if (gvalue)
471
 
                {
472
 
                        if (gvalue->type == GCONF_VALUE_FLOAT)
473
 
                        {
474
 
                                ret = TRUE;
475
 
                                *float_value = gconf_value_get_float(gvalue);
476
 
                        }
477
 
                        gconf_value_free(gvalue);
478
 
                }
479
 
                g_object_unref(client);
480
 
        }
481
 
        g_string_free(fullname, TRUE);
482
 
#endif
483
 
#ifdef WITH_REGISTRY
484
 
    HKEY hKey;
485
 
    DWORD dwBufLen;
486
 
    LONG lRet;
487
 
 
488
 
        if (RegOpenKeyEx( HKEY_CURRENT_USER, REGISTRY_KEY, 0, KEY_QUERY_VALUE, &hKey ) == ERROR_SUCCESS)
489
 
        {
490
 
            lRet = RegQueryValueEx( hKey, name, NULL, NULL, NULL, &dwBufLen);
491
 
                if (dwBufLen > 0)
492
 
                {
493
 
                        gdouble val;
494
 
                        DWORD size = sizeof(gdouble);
495
 
                lRet = RegQueryValueEx( hKey, name, NULL, NULL, (LPBYTE) &val, &size);
496
 
                RegCloseKey( hKey );
497
 
                if ((lRet == ERROR_SUCCESS) && (size == sizeof(gdouble)))
498
 
                {
499
 
                                ret = TRUE;
500
 
                                *float_value = val;
501
 
                        }
502
 
                }
503
 
        }
504
 
#endif
505
 
        return(ret);
506
 
}
507
 
 
508
 
gboolean
509
 
rs_conf_set_double(const gchar *name, const gdouble float_value)
510
 
{
511
 
        gboolean ret = FALSE;
512
 
#ifdef WITH_GCONF
513
 
        GConfClient *client = gconf_client_get_default();
514
 
        GString *fullname = g_string_new(GCONF_PATH);
515
 
        g_string_append(fullname, name);
516
 
        g_static_mutex_lock(&lock);
517
 
        if (client)
518
 
        {
519
 
                ret = gconf_client_set_float(client, fullname->str, float_value, NULL);
520
 
                g_object_unref(client);
521
 
        }
522
 
        g_static_mutex_unlock(&lock);
523
 
        g_string_free(fullname, TRUE);
524
 
#endif
525
 
#ifdef WITH_REGISTRY
526
 
    HKEY hKey;
527
 
 
528
 
        if (RegCreateKeyEx(HKEY_CURRENT_USER, REGISTRY_KEY, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL) == ERROR_SUCCESS)
529
 
        {
530
 
                if (RegSetValueEx(hKey, name, 0, REG_BINARY, (LPBYTE) &float_value, sizeof(gdouble))==ERROR_SUCCESS)
531
 
                        ret = TRUE;
532
 
        }
533
 
    RegCloseKey(hKey);
534
 
#endif
535
 
        return(ret);
536
 
}
537
 
 
538
 
GSList *
539
 
rs_conf_get_list_string(const gchar *name)
540
 
{
541
 
        GSList *list = NULL;
542
 
#ifdef WITH_GCONF
543
 
        GConfClient *client = gconf_client_get_default();
544
 
        GString *fullname = g_string_new(GCONF_PATH);
545
 
 
546
 
        g_string_append(fullname, name);
547
 
        g_static_mutex_lock(&lock);
548
 
        if (client)
549
 
        {
550
 
                list = gconf_client_get_list(client, fullname->str, GCONF_VALUE_STRING, NULL);
551
 
                g_object_unref(client);
552
 
        }
553
 
        g_static_mutex_unlock(&lock);
554
 
        g_string_free(fullname, TRUE);
555
 
#else
556
 
        /* FIXME: windows stub */
557
 
#endif
558
 
        return list;
559
 
}
560
 
 
561
 
gboolean
562
 
rs_conf_set_list_string(const gchar *name, GSList *list)
563
 
{
564
 
        gboolean ret = FALSE;
565
 
#ifdef WITH_GCONF
566
 
        GConfClient *client = gconf_client_get_default();
567
 
        GString *fullname = g_string_new(GCONF_PATH);
568
 
 
569
 
        g_string_append(fullname, name);
570
 
        g_static_mutex_lock(&lock);
571
 
        if (client)
572
 
        {
573
 
                ret = gconf_client_set_list(client, fullname->str, GCONF_VALUE_STRING, list, NULL);
574
 
                g_object_unref(client);
575
 
        }
576
 
        g_static_mutex_unlock(&lock);
577
 
        g_string_free(fullname, TRUE);
578
 
#else
579
 
        /* FIXME: windows stub */
580
 
#endif
581
 
        return(ret);
582
 
}
583
 
 
584
 
gboolean
585
 
rs_conf_add_string_to_list_string(const gchar *name, gchar *value)
586
 
{
587
 
        gboolean ret = FALSE;
588
 
 
589
 
        GSList *newlist = NULL;
590
 
        GSList *oldlist = rs_conf_get_list_string(name);
591
 
 
592
 
        while (oldlist)
593
 
        {
594
 
                newlist = g_slist_append(newlist, oldlist->data);
595
 
                oldlist = oldlist->next;
596
 
        }
597
 
 
598
 
        newlist = g_slist_append(newlist, value);
599
 
        ret = rs_conf_set_list_string(name, newlist);
600
 
 
601
 
        return(ret);
602
 
}
603
 
 
604
 
gchar *
605
 
rs_conf_get_nth_string_from_list_string(const gchar *name, gint num)
606
 
{
607
 
        GSList *list = rs_conf_get_list_string(name);
608
 
        gint i;
609
 
        gchar *value = NULL;
610
 
 
611
 
        if (list)
612
 
        {
613
 
                for (i = 0; i < num; i++)
614
 
                        list = list->next;
615
 
                if (list)
616
 
                        value = (gchar *) list->data;
617
 
                else
618
 
                        value = NULL;
619
 
        }
620
 
        return value;
621
 
}