- Timestamp:
- 07/09/2017 04:45:34 PM (7 years ago)
- Branches:
- master
- Children:
- 8618599
- Parents:
- 0292fbb
- Location:
- libsm
- Files:
-
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
libsm/index.c
r0292fbb r7258c6a 6 6 */ 7 7 8 char *index(char *str, charc)8 int8_t *index(int8_t *str, int8_t c) 9 9 { 10 10 while (*str) { … … 16 16 } 17 17 18 return(( char*)0);18 return((int8_t *)0); 19 19 } 20 20 -
libsm/memccpy.c
r0292fbb r7258c6a 11 11 */ 12 12 13 void *memccpy(void *vp1, void *vp2, char c, int n)13 void *memccpy(void *vp1, void *vp2, int8_t c, int16_t n) 14 14 { 15 char*cp1 = vp1;16 char*cp2 = vp2;15 int8_t *cp1 = vp1; 16 int8_t *cp2 = vp2; 17 17 18 18 while (--n >= 0) -
libsm/memchr.c
r0292fbb r7258c6a 9 9 */ 10 10 11 void *memchr(void *vp, char c, int n)11 void *memchr(void *vp, int8_t c, int16_t n) 12 12 { 13 char*cp = vp;13 int8_t *cp = vp; 14 14 15 15 while (--n >= 0) -
libsm/memcmp.c
r0292fbb r7258c6a 8 8 */ 9 9 10 int memcmp(void *vp1, void *vp2, int n)10 int16_t memcmp(void *vp1, void *vp2, int16_t n) 11 11 { 12 char*cp1 = vp1;13 char*cp2 = vp2;14 register int diff;12 int8_t *cp1 = vp1; 13 int8_t *cp2 = vp2; 14 register int16_t diff; 15 15 16 16 if (cp1 != cp2) -
libsm/memcmpu.c
r0292fbb r7258c6a 8 8 #include "ctype.h" 9 9 10 int memcmpu(void *vp1, void *vp2, int n)10 int16_t memcmpu(void *vp1, void *vp2, int16_t n) 11 11 { 12 char*cp1 = vp1;13 char*cp2 = vp2;14 register charc1, c2;12 int8_t *cp1 = vp1; 13 int8_t *cp2 = vp2; 14 register int8_t c1, c2; 15 15 16 16 while (n) { -
libsm/memcpy.c
r0292fbb r7258c6a 9 9 */ 10 10 11 void *memcpy(void *vp1, void *vp2, int n)11 void *memcpy(void *vp1, void *vp2, int16_t n) 12 12 { 13 char*cp1 = vp1;14 char*cp2 = vp2;13 int8_t *cp1 = vp1; 14 int8_t *cp2 = vp2; 15 15 16 16 while (--n >= 0) -
libsm/memcpyw.c
r0292fbb r7258c6a 9 9 */ 10 10 11 void *memcpyw(void *vp1, void *vp2, int n)11 void *memcpyw(void *vp1, void *vp2, int16_t n) 12 12 { 13 short *sp1 = vp1;14 short *sp2 = vp2;13 int16_t *sp1 = vp1; 14 int16_t *sp2 = vp2; 15 15 16 16 while (--n >= 0) -
libsm/memset.c
r0292fbb r7258c6a 9 9 */ 10 10 11 void *memset(void *vp, char c, int n)11 void *memset(void *vp, int8_t c, int16_t n) 12 12 { 13 char*cp = vp;13 int8_t *cp = vp; 14 14 15 15 while (--n >= 0) -
libsm/memsetw.c
r0292fbb r7258c6a 9 9 */ 10 10 11 void *memsetw(void *vp, short s, short n)11 void *memsetw(void *vp, int16_t s, int16_t n) 12 12 { 13 short *sp = vp;13 int16_t *sp = vp; 14 14 15 15 while (--n >= 0) -
libsm/rindex.c
r0292fbb r7258c6a 6 6 */ 7 7 8 char *rindex(char *str, charc)8 int8_t *rindex(int8_t *str, int8_t c) 9 9 { 10 register char*cp;10 register int8_t *cp; 11 11 12 12 for (cp = str ;*cp++ ; ) … … 17 17 return(cp); 18 18 19 return(( char*)0);19 return((int8_t *)0); 20 20 } 21 -
libsm/str2lc.c
r0292fbb r7258c6a 6 6 */ 7 7 8 char *str2lc(char*s)8 int8_t *str2lc(int8_t *s) 9 9 { 10 register charc;11 register char*r = s;10 register int8_t c; 11 register int8_t *r = s; 12 12 13 13 while (c = *s) -
libsm/str2uc.c
r0292fbb r7258c6a 6 6 */ 7 7 8 char *str2uc(char*s)8 int8_t *str2uc(int8_t *s) 9 9 { 10 register charc;11 register char*r = s;10 register int8_t c; 11 register int8_t *r = s; 12 12 13 13 while (c = *s) -
libsm/strcat.c
r0292fbb r7258c6a 9 9 */ 10 10 11 char *strcat(char *s1, char*s2)11 int8_t *strcat(int8_t *s1, int8_t *s2) 12 12 { 13 register char*os1;13 register int8_t *os1; 14 14 15 15 os1 = s1; -
libsm/strccpy.c
r0292fbb r7258c6a 16 16 */ 17 17 18 char *strccpy(char *s1, char *s2, charc)18 int8_t *strccpy(int8_t *s1, int8_t *s2, int8_t c) 19 19 { 20 register char*os1;21 register charx;20 register int8_t *os1; 21 register int8_t x; 22 22 23 23 os1 = s1; -
libsm/strchr.c
r0292fbb r7258c6a 10 10 #define NULL 0 11 11 12 char *strchr(char *sp, charc)12 int8_t *strchr(int8_t *sp, int8_t c) 13 13 { 14 14 do { … … 17 17 } while(*sp++); 18 18 19 return(( char*)NULL);19 return((int8_t *)NULL); 20 20 } 21 -
libsm/strcmp.c
r0292fbb r7258c6a 8 8 */ 9 9 10 int strcmp(char *s1, char*s2)10 int16_t strcmp(int8_t *s1, int8_t *s2) 11 11 { 12 12 if(s1 == s2) … … 17 17 return(0); 18 18 19 return((int )*s1 - (int)*--s2);19 return((int16_t)*s1 - (int16_t)*--s2); 20 20 } 21 -
libsm/strcpy.c
r0292fbb r7258c6a 9 9 */ 10 10 11 char *strcpy(char *s1, char*s2)11 int8_t *strcpy(int8_t *s1, int8_t *s2) 12 12 { 13 register char*os1;13 register int8_t *os1; 14 14 15 15 os1 = s1; -
libsm/strcspn.c
r0292fbb r7258c6a 9 9 */ 10 10 11 int strcspn(char *string, char*charset)11 int16_t strcspn(int8_t *string, int8_t *charset) 12 12 { 13 register char*p, *q;14 register int n = 0;13 register int8_t *p, *q; 14 register int16_t n = 0; 15 15 16 16 for(q = string; *q != '\0'; ++q , ++n) { -
libsm/strfill.c
r0292fbb r7258c6a 13 13 */ 14 14 15 char *strfill(char *s, char c, unsignedn)15 int8_t *strfill(int8_t *s, int8_t c, uint16_t n) 16 16 { 17 register u nsignedi;18 char*p;17 register uint16_t i; 18 int8_t *p; 19 19 20 20 p = s; -
libsm/strlcmp.c
r0292fbb r7258c6a 15 15 */ 16 16 17 int strlcmp(char *s, char*l[])17 int16_t strlcmp(int8_t *s, int8_t *l[]) 18 18 { 19 int rc;19 int16_t rc; 20 20 21 21 rc = 0; -
libsm/strlen.c
r0292fbb r7258c6a 9 9 10 10 11 int strlen(char*s)11 int16_t strlen(int8_t *s) 12 12 { 13 register int n = 0;13 register int16_t n = 0; 14 14 15 15 while (*s++ != '\0') -
libsm/strltrm.c
r0292fbb r7258c6a 10 10 #include "stddefs.h" 11 11 12 char *strltrm(char*s)12 int8_t *strltrm(int8_t *s) 13 13 { 14 register charc;15 register char*lp, *rp;14 register int8_t c; 15 register int8_t *lp, *rp; 16 16 17 17 if (*s NE ' ') -
libsm/strncat.c
r0292fbb r7258c6a 10 10 */ 11 11 12 char *strncat(char *s1, char *s2, int n)12 int8_t *strncat(int8_t *s1, int8_t *s2, int16_t n) 13 13 { 14 register char*os1;14 register int8_t *os1; 15 15 16 16 os1 = s1; -
libsm/strncmp.c
r0292fbb r7258c6a 9 9 */ 10 10 11 int strncmp(char *s1, char *s2, int n)11 int16_t strncmp(int8_t *s1, int8_t *s2, int16_t n) 12 12 { 13 13 if (s1 == s2) … … 18 18 return(0); 19 19 20 return((n < 0) ? 0 : (int )(*s1 - *--s2));20 return((n < 0) ? 0 : (int16_t)(*s1 - *--s2)); 21 21 } 22 -
libsm/strncpy.c
r0292fbb r7258c6a 9 9 */ 10 10 11 char *strncpy(char *s1, char *s2, int n)11 int8_t *strncpy(int8_t *s1, int8_t *s2, int16_t n) 12 12 { 13 register char*os1 = s1;13 register int8_t *os1 = s1; 14 14 15 15 while (--n >= 0) -
libsm/strpbrk.c
r0292fbb r7258c6a 9 9 */ 10 10 11 char *strpbrk(char *string, char*brkset)11 int8_t *strpbrk(int8_t *string, int8_t *brkset) 12 12 { 13 register char*p;13 register int8_t *p; 14 14 15 15 do { … … 25 25 ; 26 26 27 return(( char*)0);27 return((int8_t *)0); 28 28 } 29 -
libsm/strrchr.c
r0292fbb r7258c6a 9 9 */ 10 10 11 #define NULL ( char*)011 #define NULL (int8_t *)0 12 12 13 char *strrchr(char *sp, charc)13 int8_t *strrchr(int8_t *sp, int8_t c) 14 14 { 15 register char*r;15 register int8_t *r; 16 16 17 17 r = NULL; -
libsm/strrev.c
r0292fbb r7258c6a 14 14 */ 15 15 16 char *strrev(char *s1, char*s2)16 int8_t *strrev(int8_t *s1, int8_t *s2) 17 17 { 18 register char*s3;19 register longi;18 register int8_t *s3; 19 register int32_t i; 20 20 21 21 i = 0L; /* initialize string length */ -
libsm/strrevi.c
r0292fbb r7258c6a 12 12 */ 13 13 14 char *strrevi(char*s)14 int8_t *strrevi(int8_t *s) 15 15 { 16 register char*p1, *p2;17 register longi;18 register charc;16 register int8_t *p1, *p2; 17 register int32_t i; 18 register int8_t c; 19 19 20 20 p1 = s; /* initialize left end pointer */ -
libsm/strrtrm.c
r0292fbb r7258c6a 10 10 #include "stddefs.h" 11 11 12 char *strrtrm(char*s)12 int8_t *strrtrm(int8_t *s) 13 13 { 14 register char*lp, *rp;14 register int8_t *lp, *rp; 15 15 16 16 lp = s; … … 20 20 ++rp; 21 21 22 while (( long)(--rp) GE (long)lp) {22 while ((int32_t)(--rp) GE (int32_t)lp) { 23 23 24 24 if (*rp EQ ' ') -
libsm/strspn.c
r0292fbb r7258c6a 9 9 */ 10 10 11 int strspn(char *string, char*charset)11 int16_t strspn(int8_t *string, int8_t *charset) 12 12 { 13 register char*p, *q;14 register int n = 0;13 register int8_t *p, *q; 14 register int16_t n = 0; 15 15 16 16 for (q = string; *q != '\0'; ++q) { -
libsm/strtok.c
r0292fbb r7258c6a 11 11 */ 12 12 13 #define NULL ( char*)013 #define NULL (int8_t *)0 14 14 15 extern int strspn(char *string, char*charset);16 extern char *strpbrk(char *string, char*brkset);15 extern int16_t strspn(int8_t *string, int8_t *charset); 16 extern int8_t *strpbrk(int8_t *string, int8_t *brkset); 17 17 18 char *strtok(char *string, char*sepset)18 int8_t *strtok(int8_t *string, int8_t *sepset) 19 19 { 20 register char*p, *q, *r;21 static char*savept;20 register int8_t *p, *q, *r; 21 static int8_t *savept; 22 22 23 23 /* first or subsequent call ? */ -
libsm/strtol.c
r0292fbb r7258c6a 12 12 #define MBASE ('z' - 'a' + 1 + 10) 13 13 14 long strtol(char *str, char **ptr, int base)14 int32_t strtol(int8_t *str, int8_t **ptr, int16_t base) 15 15 { 16 register longval;17 register int c;18 int xx, neg = 0;16 register int32_t val; 17 register int16_t c; 18 int16_t xx, neg = 0; 19 19 20 if (ptr != ( char**)0)20 if (ptr != (int8_t **)0) 21 21 *ptr = str; /* in case no number is formed */ 22 22 … … 62 62 val = base * val - xx; 63 63 64 if (ptr != ( char**)0)64 if (ptr != (int8_t **)0) 65 65 *ptr = str; 66 66
Note:
See TracChangeset
for help on using the changeset viewer.