Added a bunch of stuff
This commit is contained in:
parent
66350160b0
commit
77c2abd247
66 changed files with 1808 additions and 0 deletions
12
include/assert.h
Normal file
12
include/assert.h
Normal file
|
@ -0,0 +1,12 @@
|
|||
#ifndef _ASSERT_H
|
||||
#define _ASSERT_H
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef NDEBUG
|
||||
#define assert(ignore) ((void) 0)
|
||||
#else
|
||||
#define assert(expression) (expression || (fprintf(stderr, "%s: %d: %s", __FILE__, __LINE__, __func__) && abort()))
|
||||
#endif
|
||||
|
||||
#endif
|
34
include/cpio.h
Normal file
34
include/cpio.h
Normal file
|
@ -0,0 +1,34 @@
|
|||
#ifndef _CPIO_H
|
||||
#define _CPIO_H
|
||||
|
||||
/* Constants needed by the c_mode field of the cpio archive format */
|
||||
/* User permissions */
|
||||
#define C_IRUSR 0000400
|
||||
#define C_IWUSR 0000200
|
||||
#define C_IXUSR 0000100
|
||||
|
||||
/* Group permissions */
|
||||
#define C_IRGRP 0000040
|
||||
#define C_IWGRP 0000020
|
||||
#define C_IXGRP 0000010
|
||||
|
||||
/* Other folx permission */
|
||||
#define C_IROTH 0000004
|
||||
#define C_IWOTH 0000002
|
||||
#define C_IXOTH 0000001
|
||||
|
||||
#define C_ISUID 0004000 /* Set UID */
|
||||
#define C_ISGID 0002000 /* Set GID */
|
||||
#define C_ISVTX 0001000 /* Restricted deletion flag for directories */
|
||||
|
||||
#define C_ISFIFO 0010000 /* FIFO/Pipe */
|
||||
#define C_ISREG 0100000 /* Regular file */
|
||||
#define C_ISBLK 0060000 /* Block device */
|
||||
#define C_ISCHR 0020000 /* Character special */
|
||||
#define C_ISCTG 0110000 /* Reserved */
|
||||
#define C_ISLNK 0120000 /* Symbolic link */
|
||||
#define C_ISSOCK 0140000 /* Socket */
|
||||
|
||||
#define MAGIC "070707"
|
||||
|
||||
#endif
|
47
include/ctype.h
Normal file
47
include/ctype.h
Normal file
|
@ -0,0 +1,47 @@
|
|||
#ifndef _CTYPE_H
|
||||
#define _CTYPE_H
|
||||
|
||||
#include <types/locale_t.h>
|
||||
|
||||
/* C standard functions */
|
||||
int isalnum(int);
|
||||
int isalpha(int);
|
||||
int isblank(int);
|
||||
int iscntrl(int);
|
||||
int isdigit(int);
|
||||
int isgraph(int);
|
||||
int islower(int);
|
||||
int isprint(int);
|
||||
int ispunct(int);
|
||||
int isspace(int);
|
||||
int isupper(int);
|
||||
int isxdigit(int);
|
||||
|
||||
/* POSIX extensions */
|
||||
int isalnum_l(int, locale_t);
|
||||
int isalpha_l(int, locale_t);
|
||||
int isblank_l(int, locale_t);
|
||||
int iscntrl_l(int, locale_t);
|
||||
int isdigit_l(int, locale_t);
|
||||
int isgraph_l(int, locale_t);
|
||||
int islower_l(int, locale_t);
|
||||
int isprint_l(int, locale_t);
|
||||
int ispunct_l(int, locale_t);
|
||||
int isspace_l(int, locale_t);
|
||||
int isupper_l(int, locale_t);
|
||||
int isxdigit_l(int, locale_t);
|
||||
|
||||
/* C standard stuff */
|
||||
int toascii(int);
|
||||
int tolower(int);
|
||||
int toupper(int);
|
||||
|
||||
/* POSIX extensions */
|
||||
int tolower_l(int, locale_t);
|
||||
int toupper_l(int, locale_t);
|
||||
|
||||
/* Obsolete XSI macros */
|
||||
#define _toupper(x) toupper(x)
|
||||
#define _tolower(x) tolower(x)
|
||||
|
||||
#endif
|
24
include/float.h
Normal file
24
include/float.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
#ifndef _FLOAT_H
|
||||
#define _FLOAT_H
|
||||
|
||||
#define FLT_ROUNDS 1
|
||||
|
||||
#define FLT_EVAL_METHOD 0
|
||||
|
||||
#define FLT_RADIX 2
|
||||
|
||||
#define FLT_MANT_DIG 24
|
||||
#define DBL_MANT_DIG 53
|
||||
#define LDBL_MANT_DIG 113
|
||||
|
||||
#define DECIMAL_DIG 10
|
||||
|
||||
#define FLT_DIG 6
|
||||
#define DBL_DIG 10
|
||||
#define LDBL_DIG 10
|
||||
|
||||
#define FLT_MIN_10_EXP -37
|
||||
#define DBL_MIN_10_EXP -37
|
||||
#define LDBL_MIN_10_EXP -37
|
||||
|
||||
#endif
|
55
include/netinet/in.h
Normal file
55
include/netinet/in.h
Normal file
|
@ -0,0 +1,55 @@
|
|||
#ifndef _NETINET_IN_H
|
||||
#define _NETINET_IN_H
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#ifndef __have_in_port_t
|
||||
#define __have_in_port_t
|
||||
typedef uint16_t in_port_t;
|
||||
#endif
|
||||
|
||||
#ifndef __have_in_addr_t
|
||||
#define __have_in_addr_t
|
||||
typedef uint32_t in_addr_t;
|
||||
#endif
|
||||
|
||||
typedef struct _ipv4_in_addr {
|
||||
in_addr_t s_addr;
|
||||
} in_addr;
|
||||
|
||||
typedef struct _ipv4_sockaddr_in {
|
||||
sa_family_t sin_family;
|
||||
in_port_t sin_port;
|
||||
in_addr sin_addr;
|
||||
} sockaddr_in;
|
||||
|
||||
typedef struct _ipv6_in_addr {
|
||||
uint8_t s6_addr[16];
|
||||
} in6_addr;
|
||||
|
||||
typedef struct _ipv6_sockaddr_in {
|
||||
sa_family_t sin6_family;
|
||||
in_port_t sin6_port;
|
||||
uint32_t sin6_flowinfo;
|
||||
in6_addr sin6_addr;
|
||||
uint32_t sin6_scope_id;
|
||||
} sockaddr_in6;
|
||||
|
||||
extern const in6_addr in6addr_any;
|
||||
extern const in6_addr in6addr_loopback;
|
||||
/* Need INIT macros for the above */
|
||||
|
||||
typedef struct _ipv6_mreq {
|
||||
int6_addr ipv6mr_multiaddr;
|
||||
unsigned ipv6mr_interface;
|
||||
} ipv6_mreq;
|
||||
|
||||
#define IPPROTO_IP 4
|
||||
#define IPPROTO_IPV6 6
|
||||
#define IPPROTO_ICMP 1
|
||||
#define IPPROTO_RAW 2
|
||||
#define IPPROTO_TCP 5
|
||||
#define IPPROTO_UDP 7
|
||||
|
||||
#endif
|
6
include/sys/io.h
Normal file
6
include/sys/io.h
Normal file
|
@ -0,0 +1,6 @@
|
|||
#ifndef _SYS_IO_H
|
||||
#define _SYS_IO_H
|
||||
|
||||
extern unsigned char inb(unsigned short int port);
|
||||
|
||||
#endif
|
24
include/sys/socket.h
Normal file
24
include/sys/socket.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* <sys/socket.h> - main sockets header
|
||||
*
|
||||
* This header is a part of the FENIX C Library and is free software.
|
||||
* You can redistribute and/or modify it subject to the terms of the
|
||||
* Clumsy Wolf Public License v4. For more details, see the file COPYING.
|
||||
*
|
||||
* The FENIX C Library is distributed WITH NO WARRANTY WHATSOEVER. See
|
||||
* The CWPL for more details.
|
||||
*/
|
||||
|
||||
#ifndef _SYS_SOCKET_H
|
||||
#define _SYS_SOCKET_H
|
||||
|
||||
typedef long int socklen_t;
|
||||
#include <types/sa_family_t.h>
|
||||
|
||||
typedef struct _socket_address {
|
||||
sa_family_t sa_family;
|
||||
char sa_data[];
|
||||
} sockaddr;
|
||||
|
||||
|
||||
#endif
|
22
include/sys/un.h
Normal file
22
include/sys/un.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* <sys/un.h> - definitions for UNIX domain sockets
|
||||
*
|
||||
* This header is a part of the FENIX C Library and is free software.
|
||||
* You can redistribute and/or modify it subject to the terms of the
|
||||
* Clumsy Wolf Public License v4. For more details, see the file COPYING.
|
||||
*
|
||||
* The FENIX C Library is distributed WITH NO WARRANTY WHATSOEVER. See
|
||||
* The CWPL for more details.
|
||||
*/
|
||||
|
||||
#ifndef _SYS_UN_H
|
||||
#define _SYS_UN_H
|
||||
|
||||
#include <types/sa_family_t.h>
|
||||
|
||||
typedef struct _un_sockaddr {
|
||||
sa_family_t sun_family
|
||||
char sun_path[108];
|
||||
} sockaddr_un;
|
||||
|
||||
#endif
|
14
include/sys/utsname.h
Normal file
14
include/sys/utsname.h
Normal file
|
@ -0,0 +1,14 @@
|
|||
#ifndef _SYS_UTSNAME_H
|
||||
#define _SYS_UTSNAME_H
|
||||
|
||||
typedef struct _uname {
|
||||
char sysname[70];
|
||||
char nodename[70];
|
||||
char release[70];
|
||||
char version[70];
|
||||
char machine[70];
|
||||
} utsname;
|
||||
|
||||
int uname(utsname *);
|
||||
|
||||
#endif
|
34
include/sys/wait.h
Normal file
34
include/sys/wait.h
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* <sys/wait.h> - declarations for waiting
|
||||
*
|
||||
* This header is a part of the FENIX C Library and is free software.
|
||||
* You can redistribute and/or modify it subject to the terms of the
|
||||
* Clumsy Wolf Public License v4. For more details, see the file COPYING.
|
||||
*
|
||||
* The FENIX C Library is distributed WITH NO WARRANTY WHATSOEVER. See
|
||||
* The CWPL for more details.
|
||||
*/
|
||||
|
||||
#ifndef _SYS_WAIT_H
|
||||
#define _SYS_WAIT_H
|
||||
|
||||
/* Constants for waitpid() */
|
||||
#define WCONTINUED 1
|
||||
#define WNOHANG 2
|
||||
#define WUNTRACED 3
|
||||
|
||||
/* Options for waitid() */
|
||||
#define WEXITED 1
|
||||
#define WNOWAIT 2
|
||||
#define WSTOPPED 3
|
||||
|
||||
enum idtype_t {P_ALL, P_PGID, P_PID};
|
||||
|
||||
#include <types/pid_t.h>
|
||||
#include <signal.h>
|
||||
|
||||
pid_t wait(int *);
|
||||
int waitid(idtype_t, id_t, siginfo_t *, int);
|
||||
pid_t waitpid(pid_t, int *, int);
|
||||
|
||||
#endif
|
48
include/syslog.h
Normal file
48
include/syslog.h
Normal file
|
@ -0,0 +1,48 @@
|
|||
#ifndef _SYSLOG_H
|
||||
#define _SYSLOG_H
|
||||
|
||||
/* logopt option for openlog() */
|
||||
#define LOG_PID 001
|
||||
#define LOG_CONS 002
|
||||
#define LOG_NDELAY 004
|
||||
#define LOG_ODELAY 010
|
||||
#define LOG_NOWAIT 020
|
||||
|
||||
/* facility argument for openlog() */
|
||||
#define LOG_KERN 1
|
||||
#define LOG_USER 2
|
||||
#define LOG_MAIL 3
|
||||
#define LOG_NEWS 4
|
||||
#define LOG_UUCP 5
|
||||
#define LOG_DAEMON 6
|
||||
#define LOG_AUTH 7
|
||||
#define LOG_CRON 8
|
||||
#define LOG_LPR 9
|
||||
#define LOG_LOCAL0 10
|
||||
#define LOG_LOCAL1 11
|
||||
#define LOG_LOCAL2 12
|
||||
#define LOG_LOCAL3 13
|
||||
#define LOG_LOCAL4 14
|
||||
#define LOG_LOCAL5 15
|
||||
#define LOG_LOCAL6 16
|
||||
#define LOG_LOCAL7 17
|
||||
|
||||
/* priority argument for syslog() */
|
||||
#define LOG_EMERG 1
|
||||
#define LOG_CRIT 2
|
||||
#define LOG_ALERT 3
|
||||
#define LOG_ERROR 4
|
||||
#define LOG_WARNING 5
|
||||
#define LOG_NOTICE 6
|
||||
#define LOG_INFO 7
|
||||
#define LOG_DEBUG 8
|
||||
|
||||
/* I'm not 100% sure how this is supposed to work -Kat */
|
||||
#define LOG_MASK(pri) (pri)
|
||||
|
||||
void closelog(void);
|
||||
void openlog(const char *, int, int);
|
||||
int setlogmask(int);
|
||||
void syslog(int, const char *, ...);
|
||||
|
||||
#endif
|
32
include/tar.h
Normal file
32
include/tar.h
Normal file
|
@ -0,0 +1,32 @@
|
|||
#ifndef _TAR_H
|
||||
#define _TAR_H
|
||||
|
||||
#define TMAGIC "ustar"
|
||||
#define TMAGLEN 6
|
||||
#define TVERSION "00"
|
||||
#define TVERSLEN 2
|
||||
|
||||
#define REGTYPE '0' /* Regular file */
|
||||
#define AREGTYPE '\0' /* Regular file */
|
||||
#define LNKTYPE '1' /* Link */
|
||||
#define SYMTYPE '2' /* Symbolic link */
|
||||
#define CHRTYPE '3' /* Character special */
|
||||
#define BLKTYPE '4' /* Block special */
|
||||
#define DIRTYPE '5' /* Directory */
|
||||
#define FIFOTYPE '6' /* FIFO */
|
||||
#define CONTTYPE '7' /* Reserved */
|
||||
|
||||
#define TSUID 04000 /* Set UID on exec. */
|
||||
#define TSGID 02000 /* Set GID on exec. */
|
||||
#define TSVTX 01000 /* On dirs, restricted deletion flag */
|
||||
#define TUREAD 00400 /* Read by owner */
|
||||
#define TUWRITE 00200 /* Write by owner */
|
||||
#define TUEXEC 00100 /* Exec./search by owner */
|
||||
#define TGREAD 00040 /* Read by group */
|
||||
#define TGWRITE 00020 /* Write by group */
|
||||
#define TGEXEC 00010 /* Exec./search by group */
|
||||
#define TOREAD 00004 /* Read by others */
|
||||
#define TOWRITE 00002 /* Write by others */
|
||||
#define TOEXEC 00001 /* Exec./search by others */
|
||||
|
||||
#endif
|
30
include/time.h
Normal file
30
include/time.h
Normal file
|
@ -0,0 +1,30 @@
|
|||
#ifndef _TIME_H
|
||||
#define _TIME_H
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL (void *) 0
|
||||
#endif
|
||||
|
||||
#include <types/clock_t.h>
|
||||
#include <types/size_t.h>
|
||||
#include <types/time_t.h>
|
||||
#include <types/clockid_t.h>
|
||||
#include <types/timer_t.h>
|
||||
#include <types/locale_t.h>
|
||||
#include <types/pid_t.h>
|
||||
|
||||
typedef struct _time {
|
||||
unsigned int tm_sec : 6;
|
||||
unsigned int tm_min : 6;
|
||||
unsigned int tm_hour : 5;
|
||||
unsigned int tm_mday : 5;
|
||||
unsigned int tm_mon : 4;
|
||||
unsigned int tm_year;
|
||||
unsigned int tm_wday : 3;
|
||||
unsigned int tm_yday : 9;
|
||||
int tm_isdst : 2;
|
||||
} tm;
|
||||
|
||||
time_t time(time_t *);
|
||||
|
||||
#endif /* not _HEADER */
|
6
include/types/clock_t.h
Normal file
6
include/types/clock_t.h
Normal file
|
@ -0,0 +1,6 @@
|
|||
#ifndef _TYPES_CLOCK_T_H
|
||||
#define _TYPES_CLOCK_T_H
|
||||
|
||||
typedef unsigned long long int clock_t;
|
||||
|
||||
#endif
|
6
include/types/clockid_t.h
Normal file
6
include/types/clockid_t.h
Normal file
|
@ -0,0 +1,6 @@
|
|||
#ifndef _TYPES_CLOCKID_T_H
|
||||
#define _TYPES_CLOCKID_T_H
|
||||
|
||||
typedef int clockid_t;
|
||||
|
||||
#endif
|
6
include/types/dev_t.h
Normal file
6
include/types/dev_t.h
Normal file
|
@ -0,0 +1,6 @@
|
|||
#ifndef _TYPES_DEV_T_H
|
||||
#define _TYPES_DEV_T_H
|
||||
|
||||
typedef int dev_t;
|
||||
|
||||
#endif
|
8
include/types/gid_t.h
Normal file
8
include/types/gid_t.h
Normal file
|
@ -0,0 +1,8 @@
|
|||
#ifndef _TYPES_GID_T_H
|
||||
#define _TYPES_GID_T_H
|
||||
|
||||
#include <types/id_t.h>
|
||||
|
||||
typedef unsigned id_t gid_t;
|
||||
|
||||
#endif
|
6
include/types/id_t.h
Normal file
6
include/types/id_t.h
Normal file
|
@ -0,0 +1,6 @@
|
|||
#ifndef _TYPES_ID_T_H
|
||||
#define _TYPES_ID_T_H
|
||||
|
||||
typedef long int id_t;
|
||||
|
||||
#endif
|
4
include/types/locale_t.h
Normal file
4
include/types/locale_t.h
Normal file
|
@ -0,0 +1,4 @@
|
|||
#ifndef _TYPES_LOCALE_T_H
|
||||
#define _TYPES_LOCALE_T_H
|
||||
|
||||
#endif
|
6
include/types/mode_t.h
Normal file
6
include/types/mode_t.h
Normal file
|
@ -0,0 +1,6 @@
|
|||
#ifndef _TYPES_MODE_T_H
|
||||
#define _TYPES_MODE_T_H
|
||||
|
||||
typedef int mode_t;
|
||||
|
||||
#endif
|
6
include/types/off_t.h
Normal file
6
include/types/off_t.h
Normal file
|
@ -0,0 +1,6 @@
|
|||
#ifndef _TYPES_OFF_T_H
|
||||
#define _TYPES_OFF_T_H
|
||||
|
||||
typedef long long int off_t;
|
||||
|
||||
#endif
|
8
include/types/pid_t.h
Normal file
8
include/types/pid_t.h
Normal file
|
@ -0,0 +1,8 @@
|
|||
#ifndef _TYPES_PID_T_H
|
||||
#define _TYPES_PID_T_H
|
||||
|
||||
#include <types/id_t.h>
|
||||
|
||||
typedef id_t pid_t;
|
||||
|
||||
#endif
|
6
include/types/ptrdiff_t.h
Normal file
6
include/types/ptrdiff_t.h
Normal file
|
@ -0,0 +1,6 @@
|
|||
#ifndef _TYPES_PTRDIFF_T_H
|
||||
#define _TYPES_PTRDIFF_T_H
|
||||
|
||||
typedef signed int ptrdiff_t;
|
||||
|
||||
#endif
|
6
include/types/sa_family_t.h
Normal file
6
include/types/sa_family_t.h
Normal file
|
@ -0,0 +1,6 @@
|
|||
#ifndef _TYPES_SA_FAMILY_T_H
|
||||
#define _TYPES_SA_FAMILY_T_H
|
||||
|
||||
typedef unsigned int sa_family_t;
|
||||
|
||||
#endif
|
6
include/types/size_t.h
Normal file
6
include/types/size_t.h
Normal file
|
@ -0,0 +1,6 @@
|
|||
#ifndef _TYPES_SIZE_T_H
|
||||
#define _TYPES_SIZE_T_H
|
||||
|
||||
typedef unsigned int size_t;
|
||||
|
||||
#endif
|
6
include/types/ssize_t.h
Normal file
6
include/types/ssize_t.h
Normal file
|
@ -0,0 +1,6 @@
|
|||
#ifndef _TYPES_SSIZE_T_H
|
||||
#define _TYPES_SSIZE_T_H
|
||||
|
||||
typedef unsigned int ssize_t;
|
||||
|
||||
#endif
|
6
include/types/suseconds_t.h
Normal file
6
include/types/suseconds_t.h
Normal file
|
@ -0,0 +1,6 @@
|
|||
#ifndef _TYPES_SUSECONDS_T_H
|
||||
#define _TYPES_SUSECONDS_T_H
|
||||
|
||||
typedef long long int suseconds_t;
|
||||
|
||||
#endif /* not _HEADER */
|
6
include/types/time_t.h
Normal file
6
include/types/time_t.h
Normal file
|
@ -0,0 +1,6 @@
|
|||
#ifndef _TYPES_TIME_T_H
|
||||
#define _TYPES_TIME_T_H
|
||||
|
||||
typedef unsigned long int time_t;
|
||||
|
||||
#endif
|
6
include/types/timer_t.h
Normal file
6
include/types/timer_t.h
Normal file
|
@ -0,0 +1,6 @@
|
|||
#ifndef _TYPES_TIMER_T_H
|
||||
#define _TYPES_TIMER_T_H
|
||||
|
||||
typedef int timer_t;
|
||||
|
||||
#endif
|
8
include/types/uid_t.h
Normal file
8
include/types/uid_t.h
Normal file
|
@ -0,0 +1,8 @@
|
|||
#ifndef _TYPES_UID_T_H
|
||||
#define _TYPES_UID_T_H
|
||||
|
||||
#include <types/id_t.h>
|
||||
|
||||
typedef unsigned id_t uid_t;
|
||||
|
||||
#endif
|
6
include/types/wchar_t.h
Normal file
6
include/types/wchar_t.h
Normal file
|
@ -0,0 +1,6 @@
|
|||
#ifndef _TYPES_WCHAR_T_H
|
||||
#define _TYPES_WCHAR_T_H
|
||||
|
||||
typedef unsigned int wchar_t;
|
||||
|
||||
#endif
|
20
include/ulimit.h
Normal file
20
include/ulimit.h
Normal file
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* <ulimit.h> - ulimit
|
||||
*
|
||||
* This header is a part of the FENIX C Library and is free software.
|
||||
* You can redistribute and/or modify it subject to the terms of the
|
||||
* Clumsy Wolf Public License v4. For more details, see the file COPYING.
|
||||
*
|
||||
* The FENIX C Library is distributed WITH NO WARRANTY WHATSOEVER. See
|
||||
* The CWPL for more details.
|
||||
*/
|
||||
|
||||
#ifndef _ULIMIT_H
|
||||
#define _ULIMIT_H
|
||||
|
||||
#define UL_GETFSIZE 1
|
||||
#define UL_SETFSIZE 2
|
||||
|
||||
long int ulimit(int, ...);
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue