mirror of
https://frontier.innolan.net/rainlance/amiga-tz.git
synced 2025-12-09 13:10:50 +00:00
more STDC work
SCCS-file: localtime.c SCCS-SID: 3.7
This commit is contained in:
committed by
Paul Eggert
parent
9e13c00551
commit
08566f58e3
72
localtime.c
72
localtime.c
@ -1,4 +1,4 @@
|
|||||||
/*LINTLIBRARY*/
|
#include "stdio.h"
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
#ifndef NOID
|
#ifndef NOID
|
||||||
@ -6,49 +6,42 @@ static char elsieid[] = "%W%";
|
|||||||
#endif /* !defined NOID */
|
#endif /* !defined NOID */
|
||||||
#endif /* !defined lint */
|
#endif /* !defined lint */
|
||||||
|
|
||||||
|
/*LINTLIBRARY*/
|
||||||
|
|
||||||
#include "tzfile.h"
|
#include "tzfile.h"
|
||||||
#include "time.h"
|
#include "time.h"
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
|
|
||||||
|
#ifdef MODERN
|
||||||
|
|
||||||
|
#include "stdlib.h"
|
||||||
|
#include "time.h"
|
||||||
|
|
||||||
|
#ifdef FILENAME_MAX
|
||||||
|
#define MAXPATHLEN FILENAME_MAX
|
||||||
|
#endif /* defined FILENAME_MAX */
|
||||||
|
|
||||||
|
#else /* !defined MODERN */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** sys/types.h is included to get time_t.
|
** sys/types.h is included to get time_t.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __STDC__
|
|
||||||
#include "sys/types.h"
|
#include "sys/types.h"
|
||||||
#endif /* !defined __STDC */
|
|
||||||
|
|
||||||
/*
|
|
||||||
** getenv. . .
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef __STDC__
|
|
||||||
#include "stdlib.h"
|
|
||||||
#else /* !defined __STDC__ */
|
|
||||||
extern char * getenv();
|
extern char * getenv();
|
||||||
#endif /* !defined __STDC__ */
|
|
||||||
|
|
||||||
/*
|
|
||||||
** MAXPATHLEN. . .
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef __STDC__
|
|
||||||
#ifdef FILENAME_MAX
|
|
||||||
#define MAXPATHLEN FILENAME_MAX
|
|
||||||
#else /* !defined FILENAME_MAX */
|
|
||||||
#define MAXPATHLEN 512
|
|
||||||
#endif /* !defined FILENAME_MAX */
|
|
||||||
#endif /* defined __STDC__ */
|
|
||||||
#ifndef MAXPATHLEN
|
#ifndef MAXPATHLEN
|
||||||
#include "sys/param.h"
|
#include "sys/param.h"
|
||||||
|
#endif /* !defined MAXPATHLEN */
|
||||||
|
|
||||||
|
#define const
|
||||||
|
|
||||||
|
#endif /* !defined MODERN */
|
||||||
|
|
||||||
#ifndef MAXPATHLEN
|
#ifndef MAXPATHLEN
|
||||||
#define MAXPATHLEN 1024
|
#define MAXPATHLEN 1024
|
||||||
#endif /* !defined MAXPATHLEN */
|
#endif /* !defined MAXPATHLEN */
|
||||||
#endif /* !defined MAXPATHLEN */
|
|
||||||
|
|
||||||
#ifndef __STDC__
|
|
||||||
#define const
|
|
||||||
#endif /* !defined __STDC__ */
|
|
||||||
|
|
||||||
#ifndef TRUE
|
#ifndef TRUE
|
||||||
#define TRUE 1
|
#define TRUE 1
|
||||||
@ -118,6 +111,24 @@ char * codep;
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __TURBOC__
|
||||||
|
#include "fcntl.h"
|
||||||
|
#endif /* defined __TURBOC__ */
|
||||||
|
|
||||||
|
#ifdef unix
|
||||||
|
#include "fcntl.h"
|
||||||
|
#endif /* defined unix */
|
||||||
|
|
||||||
|
#ifdef O_BINARY
|
||||||
|
#ifdef O_RDONLY
|
||||||
|
#define MODE O_BINARY | O_RDONLY
|
||||||
|
#endif /* defined O_RDONLY */
|
||||||
|
#endif /* defined O_BINARY */
|
||||||
|
|
||||||
|
#ifndef MODE
|
||||||
|
#define MODE 0
|
||||||
|
#endif /* !defined MODE */
|
||||||
|
|
||||||
static
|
static
|
||||||
tzload(name, sp)
|
tzload(name, sp)
|
||||||
register char * name;
|
register char * name;
|
||||||
@ -152,7 +163,7 @@ register struct state * sp;
|
|||||||
}
|
}
|
||||||
if (doaccess && access(name, 4) != 0)
|
if (doaccess && access(name, 4) != 0)
|
||||||
return -1;
|
return -1;
|
||||||
if ((fid = open(name, 0)) == -1)
|
if ((fid = open(name, MODE)) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
@ -250,7 +261,7 @@ register struct state * sp;
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static void
|
||||||
tzsetgmt(sp)
|
tzsetgmt(sp)
|
||||||
register struct state * sp;
|
register struct state * sp;
|
||||||
{
|
{
|
||||||
@ -475,3 +486,6 @@ time_t * timep;
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif /* defined BSD_COMPAT */
|
#endif /* defined BSD_COMPAT */
|
||||||
|
/*
|
||||||
|
** UNIX is a registered trademark of AT&T.
|
||||||
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user