Diff for /np2/common/milstr.c between versions 1.4 and 1.7

version 1.4, 2003/11/21 06:51:10 version 1.7, 2004/06/19 17:54:19
Line 5 Line 5
 // ---- ANK  // ---- ANK
   
 #if defined(SUPPORT_ANK)  #if defined(SUPPORT_ANK)
   int milank_charsize(const char *str) {
   
           return((str[0] != '\0')?1:0);
   }
   
 int milank_cmp(const char *str, const char *cmp) {  int milank_cmp(const char *str, const char *cmp) {
   
         int             s;          int             s;
Line 78  void milank_ncat(char *dst, const char * Line 83  void milank_ncat(char *dst, const char *
                 dst[i] = '\0';                  dst[i] = '\0';
         }          }
 }  }
   
   char *milank_chr(const char *str, int c) {
   
           int             s;
   
           if (str) {
                   do {
                           s = *str;
                           if (s == c) {
                                   return((char *)str);
                           }
                           str++;
                   } while(s);
           }
           return(NULL);
   }
 #endif  #endif
   
   
 // ---- Shift-JIS  // ---- Shift-JIS
   
 #if defined(SUPPORT_SJIS)  #if defined(SUPPORT_SJIS)
   int milsjis_charsize(const char *str) {
   
           int             pos;
   
           pos = ((((str[0] ^ 0x20) - 0xa1) & 0xff) < 0x3c)?1:0;
           return((str[pos] != '\0')?(pos+1):0);
   }
   
 int milsjis_cmp(const char *str, const char *cmp) {  int milsjis_cmp(const char *str, const char *cmp) {
   
         int             s;          int             s;
Line 212  void milsjis_ncat(char *dst, const char  Line 241  void milsjis_ncat(char *dst, const char 
                 dst[i] = '\0';                  dst[i] = '\0';
         }          }
 }  }
   
   char *milsjis_chr(const char *str, int c) {
   
           int             s;
   
           if (str) {
                   do {
                           s = *str;
                           if (s == c) {
                                   return((char *)str);
                           }
                           if ((((s ^ 0x20) - 0xa1) & 0xff) < 0x3c) {
                                   str++;
                                   s = *str;
                           }
                           str++;
                   } while(s);
           }
           return(NULL);
   }
 #endif  #endif
   
   
 // ---- EUC  // ---- EUC
   
 #if defined(SUPPORT_EUC)  #if defined(SUPPORT_EUC)                // あれ 半角カナ忘れてるぞ?
   int mileuc_charsize(const char *str) {
   
           int             pos;
   
           pos = (((str[0] - 0xa1) & 0xff) < 0x5d)?1:0;
           return((str[pos] != '\0')?(pos+1):0);
   }
   
 int mileuc_cmp(const char *str, const char *cmp) {  int mileuc_cmp(const char *str, const char *cmp) {
   
         int             s;          int             s;
Line 346  void mileuc_ncat(char *dst, const char * Line 403  void mileuc_ncat(char *dst, const char *
                 dst[i] = '\0';                  dst[i] = '\0';
         }          }
 }  }
   
   char *mileuc_chr(const char *str, int c) {
   
           int             s;
   
           if (str) {
                   do {
                           s = *str;
                           if (s == c) {
                                   return((char *)str);
                           }
                           if (((s - 0xa1) & 0xff) < 0x5d) {
                                   str++;
                                   s = *str;
                           }
                           str++;
                   } while(s);
           }
           return(NULL);
   }
 #endif  #endif
   
   
Line 387  int milstr_extendcmp(const char *str, co Line 464  int milstr_extendcmp(const char *str, co
         return((s > c)?1:-1);          return((s > c)?1:-1);
 }  }
   
   char *milstr_nextword(const char *str) {
   
           if (str) {
                   while(!(((*str) - 1) & 0xe0)) {
                           str++;
                   }
           }
           return((char *)str);
   }
   
 int milstr_getarg(char *str, char *arg[], int maxarg) {  int milstr_getarg(char *str, char *arg[], int maxarg) {
   
         int             ret = 0;          int             ret = 0;
Line 477  long milstr_solveINT(const char *str) { Line 564  long milstr_solveINT(const char *str) {
         return(ret * s);          return(ret * s);
 }  }
   
   char *milstr_list(const char *lststr, UINT pos) {
   
           if (lststr) {
                   while(pos) {
                           pos--;
                           while(*lststr++ != '\0') {
                           }
                   }
           }
           return((char *)lststr);
   }
   

Removed from v.1.4  
changed lines
  Added in v.1.7


RetroPC.NET-CVS <cvs@retropc.net>