|
|
1.1 ! root 1: ! 2: /* Copyright Bell Telephone Laboratories Whippany, N.J. ! 3: ! 4: * ///////////////////////////////////// ! 5: * ///////////////////////////////////// ! 6: * //////////////// chr //////////////// ! 7: * /// J. P. Hawkins WH X4610 8C-001 /// ! 8: * ///// Mon Feb 16 22:19:00 1981 ////// ! 9: * ///////////////////////////////////// ! 10: * ///////////////////////////////////// ! 11: * @(#) chr.c: V1.2 3/4/81 ! 12: ! 13: * String function chr$(expr) where expr is a numerical expression ! 14: * and chr$ returns the character associated with that value. ! 15: */ ! 16: ! 17: char *chr(num) ! 18: char *num; ! 19: { ! 20: double evalx(); ! 21: static char tmpnum[2]; ! 22: ! 23: /* ! 24: * Evaluate expression num and mask all but low 8 bits ! 25: * then form null terminated single character string. ! 26: */ ! 27: tmpnum[0] = (char)0377 & (char)evalx(num); ! 28: tmpnum[1] = '\0'; ! 29: return(tmpnum); ! 30: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.