~ubuntu-branches/ubuntu/edgy/swig1.3/edgy

« back to all changes in this revision

Viewing changes to Source/DOH/base.c

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-12-05 01:16:04 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051205011604-ygx904it6413k3go
Tags: 1.3.27-1ubuntu1
Resynchronise with Debian again, for the new subversion packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
 * See the file LICENSE for information on usage and redistribution.
11
11
 * ----------------------------------------------------------------------------- */
12
12
 
13
 
char cvsroot_base_c[] = "$Header: /cvsroot/swig/SWIG/Source/DOH/base.c,v 1.9 2004/10/26 21:18:09 wsfulton Exp $";
 
13
char cvsroot_base_c[] = "$Header: /cvsroot/swig/SWIG/Source/DOH/base.c,v 1.12 2005/10/07 13:16:21 marcelomatus Exp $";
14
14
 
15
15
#include "dohint.h"
16
16
 
230
230
  iter.object  = 0;
231
231
  iter.item    = 0;
232
232
  iter.key     = 0;
 
233
  iter._current= 0;
 
234
  iter._index  = 0;
233
235
  return iter;
234
236
}
235
237
 
371
373
}
372
374
 
373
375
/* -----------------------------------------------------------------------------
 
376
 * DohGetFlagAttr() / DohGetFlag()
 
377
 * A flag is unset if the attribute (name) does not exist on the node (obj),
 
378
 * or it is set to "0". If the attribute is set to any other value,
 
379
 * the flag is set.
 
380
 * 
 
381
 * DohGetFlag()     returns if the flag is set or not
 
382
 * DohGetFlagAttr() returns the flag value if is set, NULL otherwise
 
383
 * ----------------------------------------------------------------------------- */
 
384
 
 
385
 
 
386
DOH *
 
387
DohGetFlagAttr(DOH *obj, const DOH *name) {
 
388
  DOH *val = Getattr(obj,(DOH *) name);
 
389
  if (!val) return NULL;
 
390
  return (Strcmp(val, "0") != 0) ? val : NULL;
 
391
}
 
392
 
 
393
int
 
394
DohGetFlag(DOH *obj, const DOH *name) {
 
395
  return DohGetFlagAttr(obj, name) ? 1: 0;
 
396
}
 
397
 
 
398
 
 
399
/* -----------------------------------------------------------------------------
374
400
 * DohGetVoid()
375
401
 * ----------------------------------------------------------------------------- */
376
402
 
416
442
}
417
443
 
418
444
/* -----------------------------------------------------------------------------
 
445
 * DohSetFlag()
 
446
 * ----------------------------------------------------------------------------- */
 
447
 
 
448
void
 
449
DohSetFlagAttr(DOH *obj, const DOH *name, const DOH* attr) {
 
450
  Setattr(obj,(DOH *) name, attr ? attr : NewString("0"));
 
451
}
 
452
 
 
453
void
 
454
DohSetFlag(DOH *obj, const DOH *name) {
 
455
  Setattr(obj,(DOH *) name, NewString("1"));
 
456
}
 
457
 
 
458
/* -----------------------------------------------------------------------------
419
459
 * DohSetVoid()
420
460
 * ----------------------------------------------------------------------------- */
421
461