more work
This commit is contained in:
parent
c98cf1e6df
commit
8bc2f4770d
|
|
@ -1,15 +1,12 @@
|
|||
__callex.o __callex.c C
|
||||
atof.o atof.s ASM
|
||||
cnvt.o cnvt.c C
|
||||
ctermid.o ctermid.c C
|
||||
cuserid.o cuserid.c C
|
||||
decimal.o decimal.s ASM
|
||||
doprnt.o doprnt.c C
|
||||
ecvt.o ecvt.s ASM
|
||||
ffltioc.o ffltioc.c C
|
||||
fltioc.o fltioc.c C
|
||||
goodmagic.o goodmagic.c C
|
||||
index.o index.c C
|
||||
length.o length.c C
|
||||
mpx.o mpx.c C
|
||||
pow10.o pow10.s ASM
|
||||
|
|
|
|||
|
|
@ -154,3 +154,6 @@ strout.o strout.c C
|
|||
system.o system.c C
|
||||
ungetc.o ungetc.c C
|
||||
tmpnam.o tmpnam.c C
|
||||
ctermid.o ctermid.c C
|
||||
cuserid.o cuserid.c C
|
||||
index.o index.c C
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
/* @[$] tmpnam.c 2.1 09/12/83 11:18:21 - 87wega3.2 */
|
||||
|
||||
/*LINTLIBRARY*/
|
||||
#include <stdio.h>
|
||||
|
||||
char *tmpnam(s)
|
||||
|
|
|
|||
Loading…
Reference in New Issue