~compiz-team/compiz-libcompizconfig/0.9.5

« back to all changes in this revision

Viewing changes to src/lists.c

  • Committer: Sam Spilsbury
  • Date: 2011-07-29 15:10:33 UTC
  • mfrom: (412.1.3)
  • Revision ID: git-v1:21d23fe4074b65ff356bf24c51925ab48a70535c
Merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
150
150
            if (prev) prev->next = l->next; \
151
151
            else list = l->next; \
152
152
            if (freeObj) \
153
 
                ccsFree##type (l->data); \
 
153
                ccs##type##Unref (l->data); \
154
154
            free (l); \
155
155
        } \
156
156
        return list; \
165
165
            le = l; \
166
166
            l = l->next; \
167
167
            if (freeObj) \
168
 
                ccsFree##type (le->data); \
 
168
                ccs##type##Unref (le->data); \
169
169
            free(le); \
170
170
        } \
171
171
        return NULL; \
173
173
 
174
174
CCSLIST (Plugin, CCSPlugin, FALSE, 0)
175
175
CCSLIST (Setting, CCSSetting, FALSE, 0)
176
 
CCSLIST (String, char, TRUE, strcmp (data, l->data) == 0)
 
176
CCSLIST (String, CCSString, TRUE, strcmp (((CCSString *)data)->value, ((CCSString *)l->data)->value) == 0)
177
177
CCSLIST (Group, CCSGroup, FALSE, 0)
178
178
CCSLIST (SubGroup, CCSSubGroup, FALSE, 0)
179
179
CCSLIST (SettingValue, CCSSettingValue, FALSE, 0)
194
194
        if (!value)
195
195
            return rv;
196
196
 
 
197
        value->refCount = 1;
197
198
        value->isListChild = TRUE;
198
199
        value->parent = parent;
199
 
        value->value.asString = strdup (list->data);
 
200
        value->value.asString = strdup (((CCSString *)list->data)->value);
200
201
        rv = ccsSettingValueListAppend (rv, value);
201
202
        list = list->next;
202
203
    }
210
211
 
211
212
    while (list)
212
213
    {
213
 
        rv = ccsStringListAppend (rv, strdup (list->data->value.asString) );
 
214
        CCSString *str = calloc (1, sizeof (CCSString));
 
215
        
 
216
        str->value = strdup (list->data->value.asString);
 
217
        str->refCount = 1;
 
218
 
 
219
        rv = ccsStringListAppend (rv, str);
214
220
        list = list->next;
215
221
    }
216
222
 
231
237
    }
232
238
 
233
239
    for (i = 0; i < length; i++, list = list->next)
234
 
        rv[i] = strdup (list->data);
 
240
    {
 
241
        rv[i] = strdup (((CCSString *)list->data)->value);
 
242
    }
235
243
 
236
244
    *num = length;
237
245
 
244
252
    int i;
245
253
 
246
254
    for (i = 0; i < num; i++)
247
 
        rv = ccsStringListAppend (rv, strdup (array[i]) );
 
255
    {
 
256
        CCSString *str = calloc (1, sizeof (CCSString));
 
257
        
 
258
        str->value = strdup (array[i]);
 
259
        str->refCount = 1;
 
260
 
 
261
        rv = ccsStringListAppend (rv, str);
 
262
    }
248
263
 
249
264
    return rv;
250
265
}
389
404
        if (!value)
390
405
            return l;
391
406
 
 
407
        value->refCount = 1;
392
408
        value->isListChild = TRUE;
393
409
        value->parent = parent;
394
410
        value->value.asString = strdup (array[i]);
410
426
        if (!value)
411
427
            return l;
412
428
 
 
429
        value->refCount = 1;
413
430
        value->isListChild = TRUE;
414
431
        value->parent = parent;
415
432
        value->value.asMatch = strdup (array[i]);
431
448
        if (!value)
432
449
            return l;
433
450
 
 
451
        value->refCount = 1;
434
452
        value->isListChild = TRUE;
435
453
        value->parent = parent;
436
454
        value->value.asInt = array[i];
452
470
        if (!value)
453
471
            return l;
454
472
 
 
473
        value->refCount = 1;
455
474
        value->isListChild = TRUE;
456
475
        value->parent = parent;
457
476
        value->value.asFloat = array[i];
473
492
        if (!value)
474
493
            return l;
475
494
 
 
495
        value->refCount = 1;
476
496
        value->isListChild = TRUE;
477
497
        value->parent = parent;
478
498
        value->value.asBool = array[i];
494
514
        if (!value)
495
515
            return l;
496
516
 
 
517
        value->refCount = 1;
497
518
        value->isListChild = TRUE;
498
519
        value->parent = parent;
499
520
        value->value.asColor = array[i];