Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!rutgers!njin!princeton!notecnirp!nfs From: nfs@notecnirp.Princeton.EDU (Norbert Schlenker) Newsgroups: comp.os.minix Subject: Re: 1.5.0 upgrade - missing libc.a routines Summary: Filling in a few blanks Message-ID: <22671@princeton.Princeton.EDU> Date: 30 Dec 89 07:12:17 GMT References: <1989Dec29.192941.2148@chinet.chi.il.us> Sender: news@princeton.Princeton.EDU Reply-To: nfs@notecnirp.UUCP (Norbert Schlenker) Organization: Dept. of Computer Science, Princeton University Lines: 107 In article <1989Dec29.192941.2148@chinet.chi.il.us> bill@chinet.chi.il.us (Bill Mitchell) writes: >In a recent posting, I asked about missing lib routines. >... >setjmp.s strhp.s unknown.s vars.s unget.s >memmove.s strcoll.s strxfrm.s > >I am unable to find source code for any of these. I don't find even >object versions of unget.s, memmove.s, strcoll.s, or strxform.s in >my PH 1.3 distribution. Is source for these routines available? >If so, where? If not, what now? Assuming source is available, it >goes in a directory something like /lib/i8088 in the official MINIX >directory tree, right? I have no idea what unget.s is - I have a strong suspicion it's a typo on Andy's part (i.e. it should be ungetc). As for memmove, strcoll, and strxfrm, they are ANSI mandated routines in the string library. My assembly language version (for PC's) will include them if Andy gets around to posting it. For the benefit of those who want them now, and for the Atari owners out there, below are some C versions that will serve. >From their names alone, the following sound as if they might be compiler >specific: >... many routine names omitted >I should just use the object versions from my PH 1.3 libc.a file, right? Right. Norbert ------------------------------- Snip snip --------------------------------- #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create: # memmove.c # strcoll.c # strxfrm.c # This archive created: Sat Dec 30 01:48:31 1989 export PATH; PATH=/bin:/usr/bin:$PATH if test -f 'memmove.c' then echo shar: "will not over-write existing file 'memmove.c'" else cat << \SHAR_EOF > 'memmove.c' /* memmove.c */ /* Moves a block of memory (safely). */ /* Calls memcpy(), so memcpy() had better be safe. */ /* Henry Spencer's routine is fine. */ #include void *memmove(s1, s2, n) void *s1; void *s2; size_t n; { return memcpy(s1, s2, n); } SHAR_EOF fi if test -f 'strcoll.c' then echo shar: "will not over-write existing file 'strcoll.c'" else cat << \SHAR_EOF > 'strcoll.c' /* strcoll.c */ /* Compares the strings s1 and s2 in light of the current locale setting */ /* WARNING: This is a bogus implementation, since I have no idea what */ /* ANSI is prattling about with respect to locale. */ #include int strcoll(s1, s2) char *s1; char *s2; { return strcmp(s1, s2); } SHAR_EOF fi if test -f 'strxfrm.c' then echo shar: "will not over-write existing file 'strxfrm.c'" else cat << \SHAR_EOF > 'strxfrm.c' /* strxfrm.c */ /* Transforms s2 into s1. The effect is to make strcmp() act on the */ /* transformed strings exactly as strcoll() does on original strings. */ /* WARNING: This is a bogus implementation, since I have no idea what */ /* ANSI is prattling about with respect to locale. */ #include size_t strxfrm(s1, s2, n) char *s1; char *s2; size_t n; { strncpy(s1, s2, n); return strlen(s2); } SHAR_EOF fi exit 0 # End of shell archive