Commit eece08b2 authored by Linus Tolke's avatar Linus Tolke
Browse files

First version, mostly needed from sequent

parent 997ae7ef
/*
* $Id: missing.c,v 1.1 1993/10/03 20:40:52 linus Exp $
* Copyright (C) 1991 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
*
* LysKOM is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 1, or (at your option)
* any later version.
*
* LysKOM is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License
* along with LysKOM; see the file COPYING. If not, write to
* Lysator, c/o ISY, Linkoping University, S-581 83 Linkoping, SWEDEN,
* or the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
* MA 02139, USA.
*
* Please mail bug reports to bug-lyskom@lysator.liu.se.
*/
/*
* Missing functions.
*/
static char *rcsid = "$Id: missing.c,v 1.1 1993/10/03 20:40:52 linus Exp $";
#ifdef __sequent__
#include <stdio.h>
#include <strings.h>
#include <time.h>
char *
cuserid(char *s)
{
char *tmp;
tmp = getenv("USER");
if ( tmp == NULL )
{
if ( s != NULL )
*s = '\n';
return NULL;
}
else
{
if ( s != NULL )
strcpy(s, tmp);
return tmp;
}
}
void *
memcpy (void * s1, const void * s2, unsigned int n)
{
extern bcopy(const char *b1, char *b2, unsigned int length);
bcopy(s2, s1, n);
return s1;
}
char *memchr(s, c, n)
char *s;
int c, n;
{
int r = 0;
while (r <= n) {
if (s[r] == c)
return s + r;
r++;
}
return NULL;
}
char *strchr(s, c)
char *s;
int c;
{
return memchr(s, c, strlen(s));
}
char * memset(s, c, n)
char *s;
int c, n;
{
while(n>=0) {
s[n] = c;
n--;
}
return s;
}
#if 0
extern struct tm
mktime (const struct tm * temeptr )
{
int nyears;
int nleaps;
int ndays;
nyears = temeptr->tm_year - 70;
nleaps = (nyears+2) / 4;
ndays = 365 * nyears + nleaps + temeptr->tm_yday;
return (struct tm) ( temeptr->tm_sec
+ 60 * ( temeptr->tm_min
+ 60 * ( temeptr->tm_hour
+ 24 * ndays )));
}
#endif
/* Mathematical things. */
#include <math.h>
double fmod(double t, double n)
{
double lastt = t;
while((n > 0.0 && t > n)
|| (n < 0.0 && t < n))
if (t == lastt)
return HUGE;
else
t = t - n;
return t;
}
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment