String.st
changeset 302 1f76060d58a4
parent 299 bc0645db1ab0
child 314 7581a5c57224
equal deleted inserted replaced
301:35e40a6fc72b 302:1f76060d58a4
    19 
    19 
    20 String comment:'
    20 String comment:'
    21 COPYRIGHT (c) 1988 by Claus Gittinger
    21 COPYRIGHT (c) 1988 by Claus Gittinger
    22 	     All Rights Reserved
    22 	     All Rights Reserved
    23 
    23 
    24 $Header: /cvs/stx/stx/libbasic/String.st,v 1.31 1995-03-07 19:45:41 claus Exp $
    24 $Header: /cvs/stx/stx/libbasic/String.st,v 1.32 1995-03-08 23:40:12 claus Exp $
    25 '!
    25 '!
    26 
    26 
    27 !String class methodsFor:'documentation'!
    27 !String class methodsFor:'documentation'!
    28 
    28 
    29 copyright
    29 copyright
    40 "
    40 "
    41 !
    41 !
    42 
    42 
    43 version
    43 version
    44 "
    44 "
    45 $Header: /cvs/stx/stx/libbasic/String.st,v 1.31 1995-03-07 19:45:41 claus Exp $
    45 $Header: /cvs/stx/stx/libbasic/String.st,v 1.32 1995-03-08 23:40:12 claus Exp $
    46 "
    46 "
    47 !
    47 !
    48 
    48 
    49 documentation
    49 documentation
    50 "
    50 "
    70 %{
    70 %{
    71 #include <stdio.h>
    71 #include <stdio.h>
    72 #include <ctype.h>
    72 #include <ctype.h>
    73 #ifdef LINUX
    73 #ifdef LINUX
    74 # include <linux/string.h>
    74 # include <linux/string.h>
    75 #endif
    75 #else
       
    76   extern char *strchr();
       
    77 #endif
       
    78 
       
    79 #ifdef SYSV
       
    80 # define INDEX strchr
       
    81 #else
       
    82 # define INDEX index
       
    83 #endif
       
    84 extern char *INDEX();
    76 
    85 
    77 /*
    86 /*
    78  * old st/x creates strings with spaces in it;
    87  * old st/x creates strings with spaces in it;
    79  * new st/x will fill it with zeros (for st-80 compatibility)
    88  * new st/x will fill it with zeros (for st-80 compatibility)
    80  * the define below sets old behavior.
    89  * the define below sets old behavior.
   722 
   731 
   723 %{  /* NOCONTEXT */
   732 %{  /* NOCONTEXT */
   724 
   733 
   725     REGISTER unsigned char *cp;
   734     REGISTER unsigned char *cp;
   726     REGISTER int byteValue;
   735     REGISTER int byteValue;
   727     extern char *strchr();
       
   728     OBJ cls;
   736     OBJ cls;
   729 
   737 
   730     if (__isCharacter(aCharacter)) {
   738     if (__isCharacter(aCharacter)) {
   731 	byteValue = _intVal(_characterVal(aCharacter));
   739 	byteValue = _intVal(_characterVal(aCharacter));
   732 	cp = _stringVal(self);
   740 	cp = _stringVal(self);
   765 
   773 
   766 %{  /* NOCONTEXT */
   774 %{  /* NOCONTEXT */
   767 
   775 
   768     REGISTER unsigned char *cp;
   776     REGISTER unsigned char *cp;
   769     REGISTER unsigned char *matchP;
   777     REGISTER unsigned char *matchP;
   770 #ifdef SYSV
       
   771 # define INDEX strchr
       
   772 #else
       
   773 # define INDEX index
       
   774 #endif
       
   775     extern char *INDEX();
       
   776     OBJ cls;
   778     OBJ cls;
   777 
   779 
   778     if (__isString(aCollection)) {
   780     if (__isString(aCollection)) {
   779 	matchP = _stringVal(aCollection);
   781 	matchP = _stringVal(aCollection);
   780 	cp = _stringVal(self);
   782 	cp = _stringVal(self);