]> git.sur5r.net Git - cc65/blobdiff - src/ca65/feature.c
Finished implemenation of commands to delete macros. Added the new commands to
[cc65] / src / ca65 / feature.c
index 71f5f055b6f841512e303c52e107d4c1f8a21539..e138bfe74a83e65bae7acfd4239c7793eb365911 100644 (file)
@@ -6,10 +6,10 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2000     Ullrich von Bassewitz                                        */
-/*              Wacholderweg 14                                              */
-/*              D-70597 Stuttgart                                            */
-/* EMail:       uz@musoftware.de                                             */
+/* (C) 2000-2008 Ullrich von Bassewitz                                       */
+/*               Roemerstrasse 52                                            */
+/*               D-70794 Filderstadt                                         */
+/* EMail:        uz@cc65.org                                                 */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
@@ -52,9 +52,15 @@ static const char* FeatureKeys[FEAT_COUNT] = {
     "dollar_is_pc",
     "labels_without_colons",
     "loose_string_term",
+    "loose_char_term",
     "at_in_identifiers",
     "dollar_in_identifiers",
+    "leading_dot_in_identifiers",
+    "org_per_seg",
     "pc_assignment",
+    "missing_char_term",
+    "ubiquitous_idents",
+    "c_comments",
 };
 
 
@@ -65,7 +71,7 @@ static const char* FeatureKeys[FEAT_COUNT] = {
 
 
 
-feature_t FindFeature (const char* Key)
+feature_t FindFeature (const StrBuf* Key)
 /* Find the feature in a table and return the corresponding enum value. If the
  * feature is invalid, return FEAT_UNKNOWN.
  */
@@ -74,7 +80,7 @@ feature_t FindFeature (const char* Key)
 
     /* This is not time critical, so do a linear search */
     for (F = (feature_t) 0; F < FEAT_COUNT; ++F) {
-       if (strcmp (Key, FeatureKeys[F]) == 0) {
+               if (SB_CompareStr (Key, FeatureKeys[F]) == 0) {
            /* Found, index is enum value */
            return F;
        }
@@ -86,7 +92,7 @@ feature_t FindFeature (const char* Key)
 
 
 
-feature_t SetFeature (const char* Key)
+feature_t SetFeature (const StrBuf* Key)
 /* Find the feature and set the corresponding flag if the feature is known.
  * In any case, return the feature found. An invalid Key will return
  * FEAT_UNKNOWN.
@@ -97,13 +103,19 @@ feature_t SetFeature (const char* Key)
 
     /* Set the flags */
     switch (Feature) {
-       case FEAT_DOLLAR_IS_PC:          DollarIsPC     = 1;    break;
-       case FEAT_LABELS_WITHOUT_COLONS: NoColonLabels  = 1;    break;
-       case FEAT_LOOSE_STRING_TERM:     LooseStringTerm= 1;    break;
-       case FEAT_AT_IN_IDENTIFIERS:     AtInIdents     = 1;    break;
-       case FEAT_DOLLAR_IN_IDENTIFIERS: DollarInIdents = 1;    break;
-       case FEAT_PC_ASSIGNMENT:         PCAssignment   = 1;    break;
-               default:                         /* Keep gcc silent */  break;
+       case FEAT_DOLLAR_IS_PC:               DollarIsPC        = 1;    break;
+       case FEAT_LABELS_WITHOUT_COLONS:      NoColonLabels     = 1;    break;
+       case FEAT_LOOSE_STRING_TERM:          LooseStringTerm   = 1;    break;
+       case FEAT_LOOSE_CHAR_TERM:            LooseCharTerm     = 1;    break;
+       case FEAT_AT_IN_IDENTIFIERS:          AtInIdents        = 1;    break;
+       case FEAT_DOLLAR_IN_IDENTIFIERS:      DollarInIdents    = 1;    break;
+               case FEAT_LEADING_DOT_IN_IDENTIFIERS: LeadingDotInIdents= 1;    break;
+        case FEAT_ORG_PER_SEG:                OrgPerSeg         = 1;    break;
+       case FEAT_PC_ASSIGNMENT:              PCAssignment      = 1;    break;
+        case FEAT_MISSING_CHAR_TERM:          MissingCharTerm   = 1;    break;
+        case FEAT_UBIQUITOUS_IDENTS:          UbiquitousIdents  = 1;    break;
+        case FEAT_C_COMMENTS:                 CComments         = 1;    break;
+       default:                         /* Keep gcc silent */          break;
     }
 
     /* Return the value found */