1 /* $XConsortium: chresc.c /main/3 1995/11/01 18:41:33 rswiston $ */
2 /***************************************************************
6 * THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
9 * Copyright (c) 1995 AT&T Corp. *
10 * All Rights Reserved *
12 * This software is licensed by AT&T Corp. *
13 * under the terms and conditions of the license in *
14 * http://www.research.att.com/orgs/ssr/book/reuse *
16 * This software was created by the *
17 * Software Engineering Research Department *
18 * AT&T Bell Laboratories *
20 * For further information contact *
21 * gsf@research.att.com *
23 ***************************************************************/
25 /* : : generated by proto : : */
27 #if !defined(__PROTO__)
28 #if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
29 #if defined(__cplusplus)
30 #define __MANGLE__ "C"
35 #define __PROTO__(x) x
37 #define __PARAM__(n,o) n
38 #if !defined(__STDC__) && !defined(__cplusplus)
39 #if !defined(c_plusplus)
50 #define __PROTO__(x) ()
51 #define __OTORP__(x) x
52 #define __PARAM__(n,o) o
60 #if defined(__cplusplus) || defined(c_plusplus)
61 #define __VARARG__ ...
65 #if defined(__STDARG__)
66 #define __VA_START__(p,a) va_start(p,a)
68 #define __VA_START__(p,a) va_start(p)
74 chresc __PARAM__((register const char* s, char** p), (s, p)) __OTORP__(register const char* s; char** p;){
75 register const char* q;
86 case '0': case '1': case '2': case '3':
87 case '4': case '5': case '6': case '7':
90 while (s < q) switch (*s)
92 case '0': case '1': case '2': case '3':
93 case '4': case '5': case '6': case '7':
94 c = (c << 3) + *s++ - '0';
128 while (q) switch (*s)
130 case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
131 c = (c << 4) + *s++ - 'a' + 10;
133 case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
134 c = (c << 4) + *s++ - 'A' + 10;
136 case '0': case '1': case '2': case '3': case '4':
137 case '5': case '6': case '7': case '8': case '9':
138 c = (c << 4) + *s++ - '0';
154 if (p) *p = (char*)s;