more work

This commit is contained in:
Oliver Lehmann 2009-08-27 18:52:05 +00:00
parent c98cf1e6df
commit 8bc2f4770d
6 changed files with 65 additions and 4 deletions

View File

@ -1,15 +1,12 @@
__callex.o __callex.c C __callex.o __callex.c C
atof.o atof.s ASM atof.o atof.s ASM
cnvt.o cnvt.c C cnvt.o cnvt.c C
ctermid.o ctermid.c C
cuserid.o cuserid.c C
decimal.o decimal.s ASM decimal.o decimal.s ASM
doprnt.o doprnt.c C doprnt.o doprnt.c C
ecvt.o ecvt.s ASM ecvt.o ecvt.s ASM
ffltioc.o ffltioc.c C ffltioc.o ffltioc.c C
fltioc.o fltioc.c C fltioc.o fltioc.c C
goodmagic.o goodmagic.c C goodmagic.o goodmagic.c C
index.o index.c C
length.o length.c C length.o length.c C
mpx.o mpx.c C mpx.o mpx.c C
pow10.o pow10.s ASM pow10.o pow10.s ASM

View File

@ -154,3 +154,6 @@ strout.o strout.c C
system.o system.c C system.o system.c C
ungetc.o ungetc.c C ungetc.o ungetc.c C
tmpnam.o tmpnam.c C tmpnam.o tmpnam.c C
ctermid.o ctermid.c C
cuserid.o cuserid.c C
index.o index.c C

View File

@ -0,0 +1,19 @@
/* @[$] index.c 2.1 09/12/83 11:25:08 - 87wega3.2 */
/*
* Return the ptr in sp at which the character c appears;
* NULL if not found
*/
#define NULL 0
char *
index(sp, c)
register char *sp, c;
{
do {
if (*sp == c)
return(sp);
} while (*sp++);
return(NULL);
}

View File

@ -0,0 +1,14 @@
/* @[$] ctermid.c 2.1 09/12/83 11:17:07 - 87wega3.2 */
#include <stdio.h>
char *ctermid(s)
char *s;
{
static char res[L_ctermid];
register char *r;
r = s==NULL? res: s;
strcpy (r, "/dev/tty");
return r;
}

View File

@ -0,0 +1,29 @@
/* @[$] cuserid.c 2.1 09/12/83 11:17:20 - 87wega3.2 */
#include <stdio.h>
#include <pwd.h>
char *cuserid(s)
char *s;
{
static char res[L_cuserid];
struct passwd *pw, *getpwuid();
char *getlogin();
int getuid();
register char *p, *r;
r = s==NULL? res: s;
p = getlogin();
if(p != NULL)
strcpy(r, p);
else {
pw = getpwuid(getuid());
if(pw == NULL) {
*r = '\0';
r = NULL;
} else
strcpy(r, pw->pw_name);
endpwent();
}
return(r);
}

View File

@ -1,6 +1,5 @@
/* @[$] tmpnam.c 2.1 09/12/83 11:18:21 - 87wega3.2 */ /* @[$] tmpnam.c 2.1 09/12/83 11:18:21 - 87wega3.2 */
/*LINTLIBRARY*/
#include <stdio.h> #include <stdio.h>
char *tmpnam(s) char *tmpnam(s)