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

« back to all changes in this revision

Viewing changes to Source/Swig/naming.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:
9
9
 * See the file LICENSE for information on usage and redistribution.    
10
10
 * ----------------------------------------------------------------------------- */
11
11
 
12
 
char cvsroot_naming_c[] = "$Header: /cvsroot/swig/SWIG/Source/Swig/naming.c,v 1.17 2004/11/03 00:58:48 marcelomatus Exp $";
 
12
char cvsroot_naming_c[] = "$Header: /cvsroot/swig/SWIG/Source/Swig/naming.c,v 1.22 2005/10/04 20:34:40 wsfulton Exp $";
13
13
 
14
14
#include "swig.h"
15
15
#include <ctype.h>
208
208
  String *f;
209
209
 
210
210
#ifdef SWIG_DEBUG
211
 
  Printf(stdout,"name get:  '%s'\n", vname); 
 
211
  Printf(stdout,"Swig_name_get:  '%s'\n", vname); 
212
212
#endif
213
213
 
214
214
  r = NewString("");
395
395
  DOH *n;
396
396
 
397
397
#ifdef SWIG_DEBUG
398
 
  Printf(stdout,"name set:  '%s', '%s'\n", name, decl); 
 
398
  Printf(stdout,"Swig_name_object_set:  '%s', '%s'\n", name, decl); 
399
399
#endif
400
400
  n = Getattr(namehash,name);
401
401
  if (!n) {
404
404
  }
405
405
  /* Add an object based on the declarator value */
406
406
  if (!decl) {
407
 
    Setattr(n,NewString("*"),object);
 
407
    Setattr(n,"*",object);
408
408
  } else {
409
409
    Setattr(n,Copy(decl),object);
410
410
  }
457
457
  }
458
458
  */
459
459
 
 
460
  
460
461
  /* Perform a class-based lookup (if class prefix supplied) */
461
462
  if (prefix) {
462
463
    if (Len(prefix)) {
463
464
      tname = NewStringf("%s::%s",prefix,name);
464
465
      rn = name_object_get(namehash, tname, decl, ncdecl);
465
466
      Delete(tname);
 
467
      if (!rn) {
 
468
        String *cls = Swig_scopename_last(prefix);
 
469
        if (Strcmp(cls,prefix)!= 0) {
 
470
          tname = NewStringf("*::%s::%s",cls,name);
 
471
          rn = name_object_get(namehash, tname, decl, ncdecl);
 
472
          Delete(tname);
 
473
        }
 
474
        Delete(cls);
 
475
      }    
466
476
      /* A template-based class lookup */
467
477
      if (!rn && SwigType_istemplate(prefix)) {
468
478
        String *tprefix = SwigType_templateprefix(prefix);
469
 
        tname = NewStringf("%s::%s",tprefix,name);
470
 
        rn = name_object_get(namehash, tname, decl, ncdecl);
471
 
        Delete(tname);
 
479
        if (Strcmp(tprefix,prefix) != 0) {
 
480
          rn = Swig_name_object_get(namehash, tprefix, name, decl);
 
481
        }
472
482
        Delete(tprefix);
473
483
      }
474
484
    }
561
571
{
562
572
  Node *n = Getattr(features,tname);
563
573
#ifdef SWIG_DEBUG
564
 
  Printf(stdout,"  feature_get: %s\n", tname);
 
574
  Printf(stdout,"  features_get: %s\n", tname);
565
575
#endif
566
576
  if (n) {
567
577
    merge_features(get_object(n,0),node);
598
608
  }
599
609
  
600
610
#ifdef SWIG_DEBUG
601
 
  Printf(stdout,"feature_get: %s %s %s\n", prefix, name, decl);
 
611
  Printf(stdout,"Swig_features_get: %s %s %s\n", prefix, name, decl);
602
612
#endif
603
613
 
604
614
  /* Global features */
639
649
      Delete(tname);
640
650
    }
641
651
  }
 
652
  if (name && SwigType_istemplate(name)) {
 
653
    String *dname = Swig_symbol_template_deftype(name,0);
 
654
    if (Strcmp(dname,name)) {    
 
655
      Swig_features_get(features, prefix, dname, decl, node);
 
656
    }
 
657
    Delete(dname);
 
658
  }
 
659
 
642
660
  Delete(rname);
643
661
  Delete(rdecl);
644
662
}
658
676
  Hash *fhash;
659
677
 
660
678
#ifdef SWIG_DEBUG
661
 
  Printf(stdout,"feature_set: %s %s %s %s\n", name, decl, featurename,value);  
 
679
  Printf(stdout,"Swig_feature_set: %s %s %s %s\n", name, decl, featurename,value);  
662
680
#endif
663
681
 
664
682
  n = Getattr(features,name);
700
718
      attribs = nextSibling(attribs);
701
719
    }
702
720
  }
 
721
 
 
722
  if (name && SwigType_istemplate(name)) {
 
723
    String *dname = Swig_symbol_template_deftype(name,0);
 
724
    if (Strcmp(dname,name)) {    
 
725
      Swig_feature_set(features, dname, decl, featurename, value, featureattribs);
 
726
    }
 
727
    Delete(dname);
 
728
  }
703
729
}
704
730
 
705
731