Skip to content

Commit e994021

Browse files
author
Espressif Systems
committed
add extra_include folder, don't need to download xtense related header files separately
1 parent fe12fed commit e994021

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+16185
-0
lines changed

extra_include/_ansi.h

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
/* Provide support for both ANSI and non-ANSI environments. */
2+
3+
/* Some ANSI environments are "broken" in the sense that __STDC__ cannot be
4+
relied upon to have it's intended meaning. Therefore we must use our own
5+
concoction: _HAVE_STDC. Always use _HAVE_STDC instead of __STDC__ in newlib
6+
sources!
7+
8+
To get a strict ANSI C environment, define macro __STRICT_ANSI__. This will
9+
"comment out" the non-ANSI parts of the ANSI header files (non-ANSI header
10+
files aren't affected). */
11+
12+
#ifndef _ANSIDECL_H_
13+
#define _ANSIDECL_H_
14+
15+
#include <newlib.h>
16+
#include <sys/config.h>
17+
18+
/* First try to figure out whether we really are in an ANSI C environment. */
19+
/* FIXME: This probably needs some work. Perhaps sys/config.h can be
20+
prevailed upon to give us a clue. */
21+
22+
#ifdef __STDC__
23+
#define _HAVE_STDC
24+
#endif
25+
26+
#ifdef _HAVE_STDC
27+
#define _PTR void *
28+
#define _AND ,
29+
#define _NOARGS void
30+
#define _CONST const
31+
#define _VOLATILE volatile
32+
#define _SIGNED signed
33+
#define _DOTS , ...
34+
#define _VOID void
35+
#ifdef __CYGWIN__
36+
#define _EXFUN(name, proto) __cdecl name proto
37+
#define _EXPARM(name, proto) (* __cdecl name) proto
38+
#else
39+
#define _EXFUN(name, proto) name proto
40+
#define _EXPARM(name, proto) (* name) proto
41+
#endif
42+
#define _DEFUN(name, arglist, args) name(args)
43+
#define _DEFUN_VOID(name) name(_NOARGS)
44+
#define _CAST_VOID (void)
45+
#ifndef _LONG_DOUBLE
46+
#define _LONG_DOUBLE long double
47+
#endif
48+
#ifndef _PARAMS
49+
#define _PARAMS(paramlist) paramlist
50+
#endif
51+
#else
52+
#define _PTR char *
53+
#define _AND ;
54+
#define _NOARGS
55+
#define _CONST
56+
#define _VOLATILE
57+
#define _SIGNED
58+
#define _DOTS
59+
#define _VOID void
60+
#define _EXFUN(name, proto) name()
61+
#define _DEFUN(name, arglist, args) name arglist args;
62+
#define _DEFUN_VOID(name) name()
63+
#define _CAST_VOID
64+
#define _LONG_DOUBLE double
65+
#ifndef _PARAMS
66+
#define _PARAMS(paramlist) ()
67+
#endif
68+
#endif
69+
70+
/* Support gcc's __attribute__ facility. */
71+
72+
#ifdef __GNUC__
73+
#define _ATTRIBUTE(attrs) __attribute__ (attrs)
74+
#else
75+
#define _ATTRIBUTE(attrs)
76+
#endif
77+
78+
/* ISO C++. */
79+
80+
#ifdef __cplusplus
81+
#if !(defined(_BEGIN_STD_C) && defined(_END_STD_C))
82+
#ifdef _HAVE_STD_CXX
83+
#define _BEGIN_STD_C namespace std { extern "C" {
84+
#define _END_STD_C } }
85+
#else
86+
#define _BEGIN_STD_C extern "C" {
87+
#define _END_STD_C }
88+
#endif
89+
#endif
90+
#else
91+
#define _BEGIN_STD_C
92+
#define _END_STD_C
93+
#endif
94+
95+
#endif /* _ANSIDECL_H_ */

extra_include/_syslist.h

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/* internal use only -- mapping of "system calls" for libraries that lose
2+
and only provide C names, so that we end up in violation of ANSI */
3+
#ifndef __SYSLIST_H
4+
#define __SYSLIST_H
5+
#ifdef MISSING_SYSCALL_NAMES
6+
#define _close close
7+
#define _execve execve
8+
#define _fcntl fcntl
9+
#define _fork fork
10+
#define _fstat fstat
11+
#define _getpid getpid
12+
#define _gettimeofday gettimeofday
13+
#define _kill kill
14+
#define _link link
15+
#define _lseek lseek
16+
#define _open open
17+
#define _read read
18+
#define _sbrk sbrk
19+
#define _stat stat
20+
#define _times times
21+
#define _unlink unlink
22+
#define _wait wait
23+
#define _write write
24+
/* functions not yet sysfaked */
25+
#define _opendir opendir
26+
#define _readdir readdir
27+
#define _closedir closedir
28+
#endif
29+
#endif

extra_include/alloca.h

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/* libc/include/alloca.h - Allocate memory on stack */
2+
3+
/* Written 2000 by Werner Almesberger */
4+
/* Rearranged for general inclusion by stdlib.h.
5+
2001, Corinna Vinschen <vinschen@redhat.com> */
6+
7+
#ifndef _NEWLIB_ALLOCA_H
8+
#define _NEWLIB_ALLOCA_H
9+
10+
#include "_ansi.h"
11+
#include <sys/reent.h>
12+
13+
#ifdef __GNUC__
14+
#define alloca(size) __builtin_alloca(size)
15+
#else
16+
void * _EXFUN(alloca,(size_t));
17+
#endif
18+
19+
#endif

extra_include/ar.h

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/* $NetBSD: ar.h,v 1.4 1994/10/26 00:55:43 cgd Exp $ */
2+
3+
/*-
4+
* Copyright (c) 1991, 1993
5+
* The Regents of the University of California. All rights reserved.
6+
* (c) UNIX System Laboratories, Inc.
7+
* All or some portions of this file are derived from material licensed
8+
* to the University of California by American Telephone and Telegraph
9+
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
10+
* the permission of UNIX System Laboratories, Inc.
11+
*
12+
* This code is derived from software contributed to Berkeley by
13+
* Hugh Smith at The University of Guelph.
14+
*
15+
* Redistribution and use in source and binary forms, with or without
16+
* modification, are permitted provided that the following conditions
17+
* are met:
18+
* 1. Redistributions of source code must retain the above copyright
19+
* notice, this list of conditions and the following disclaimer.
20+
* 2. Redistributions in binary form must reproduce the above copyright
21+
* notice, this list of conditions and the following disclaimer in the
22+
* documentation and/or other materials provided with the distribution.
23+
* 3. All advertising materials mentioning features or use of this software
24+
* must display the following acknowledgement:
25+
* This product includes software developed by the University of
26+
* California, Berkeley and its contributors.
27+
* 4. Neither the name of the University nor the names of its contributors
28+
* may be used to endorse or promote products derived from this software
29+
* without specific prior written permission.
30+
*
31+
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
32+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
33+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
34+
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
35+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37+
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
39+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
40+
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
41+
* SUCH DAMAGE.
42+
*
43+
* @(#)ar.h 8.2 (Berkeley) 1/21/94
44+
*/
45+
46+
#ifndef _AR_H_
47+
#define _AR_H_
48+
49+
/* Pre-4BSD archives had these magic numbers in them. */
50+
#define OARMAG1 0177555
51+
#define OARMAG2 0177545
52+
53+
#define ARMAG "!<arch>\n" /* ar "magic number" */
54+
#define SARMAG 8 /* strlen(ARMAG); */
55+
56+
#define AR_EFMT1 "#1/" /* extended format #1 */
57+
58+
struct ar_hdr {
59+
char ar_name[16]; /* name */
60+
char ar_date[12]; /* modification time */
61+
char ar_uid[6]; /* user id */
62+
char ar_gid[6]; /* group id */
63+
char ar_mode[8]; /* octal file permissions */
64+
char ar_size[10]; /* size in bytes */
65+
#define ARFMAG "`\n"
66+
char ar_fmag[2]; /* consistency check */
67+
};
68+
69+
#endif /* !_AR_H_ */

extra_include/argz.h

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
2+
*
3+
* Permission to use, copy, modify, and distribute this software
4+
* is freely granted, provided that this notice is preserved.
5+
*/
6+
7+
#include <errno.h>
8+
#include <sys/types.h>
9+
10+
/* The newlib implementation of these functions assumes that sizeof(char) == 1. */
11+
error_t argz_create (char *const argv[], char **argz, size_t *argz_len);
12+
error_t argz_create_sep (const char *string, int sep, char **argz, size_t *argz_len);
13+
size_t argz_count (const char *argz, size_t argz_len);
14+
void argz_extract (char *argz, size_t argz_len, char **argv);
15+
void argz_stringify (char *argz, size_t argz_len, int sep);
16+
error_t argz_add (char **argz, size_t *argz_len, const char *str);
17+
error_t argz_add_sep (char **argz, size_t *argz_len, const char *str, int sep);
18+
error_t argz_append (char **argz, size_t *argz_len, const char *buf, size_t buf_len);
19+
error_t argz_delete (char **argz, size_t *argz_len, char *entry);
20+
error_t argz_insert (char **argz, size_t *argz_len, char *before, const char *entry);
21+
char * argz_next (char *argz, size_t argz_len, const char *entry);
22+
error_t argz_replace (char **argz, size_t *argz_len, const char *str, const char *with, unsigned *replace_count);

extra_include/assert.h

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
assert.h
3+
*/
4+
5+
#ifdef __cplusplus
6+
extern "C" {
7+
#endif
8+
9+
#include "_ansi.h"
10+
11+
#undef assert
12+
13+
#ifdef NDEBUG /* required by ANSI standard */
14+
#define assert(p) ((void)0)
15+
#else
16+
17+
#ifdef __STDC__
18+
#define assert(e) ((e) ? (void)0 : __assert(__FILE__, __LINE__, #e))
19+
#else /* PCC */
20+
#define assert(e) ((e) ? (void)0 : __assert(__FILE__, __LINE__, "e"))
21+
#endif
22+
23+
#endif /* NDEBUG */
24+
25+
void _EXFUN(__assert,(const char *, int, const char *));
26+
27+
#ifdef __cplusplus
28+
}
29+
#endif

extra_include/ctype.h

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#ifndef _CTYPE_H_
2+
#define _CTYPE_H_
3+
4+
#include "_ansi.h"
5+
6+
_BEGIN_STD_C
7+
8+
int _EXFUN(isalnum, (int __c));
9+
int _EXFUN(isalpha, (int __c));
10+
int _EXFUN(iscntrl, (int __c));
11+
int _EXFUN(isdigit, (int __c));
12+
int _EXFUN(isgraph, (int __c));
13+
int _EXFUN(islower, (int __c));
14+
int _EXFUN(isprint, (int __c));
15+
int _EXFUN(ispunct, (int __c));
16+
int _EXFUN(isspace, (int __c));
17+
int _EXFUN(isupper, (int __c));
18+
int _EXFUN(isxdigit,(int __c));
19+
int _EXFUN(tolower, (int __c));
20+
int _EXFUN(toupper, (int __c));
21+
22+
#ifndef __STRICT_ANSI__
23+
int _EXFUN(isblank, (int __c));
24+
int _EXFUN(isascii, (int __c));
25+
int _EXFUN(toascii, (int __c));
26+
int _EXFUN(_tolower, (int __c));
27+
int _EXFUN(_toupper, (int __c));
28+
#endif
29+
30+
#define _U 01
31+
#define _L 02
32+
#define _N 04
33+
#define _S 010
34+
#define _P 020
35+
#define _C 040
36+
#define _X 0100
37+
#define _B 0200
38+
39+
extern __IMPORT _CONST char _ctype_[];
40+
41+
#ifndef __cplusplus
42+
#define isalpha(c) ((_ctype_+1)[(unsigned)(c)]&(_U|_L))
43+
#define isupper(c) ((_ctype_+1)[(unsigned)(c)]&_U)
44+
#define islower(c) ((_ctype_+1)[(unsigned)(c)]&_L)
45+
#define isdigit(c) ((_ctype_+1)[(unsigned)(c)]&_N)
46+
#define isxdigit(c) ((_ctype_+1)[(unsigned)(c)]&(_X|_N))
47+
#define isspace(c) ((_ctype_+1)[(unsigned)(c)]&_S)
48+
#define ispunct(c) ((_ctype_+1)[(unsigned)(c)]&_P)
49+
#define isalnum(c) ((_ctype_+1)[(unsigned)(c)]&(_U|_L|_N))
50+
#define isprint(c) ((_ctype_+1)[(unsigned)(c)]&(_P|_U|_L|_N|_B))
51+
#define isgraph(c) ((_ctype_+1)[(unsigned)(c)]&(_P|_U|_L|_N))
52+
#define iscntrl(c) ((_ctype_+1)[(unsigned)(c)]&_C)
53+
/* Non-gcc versions will get the library versions, and will be
54+
slightly slower */
55+
#ifdef __GNUC__
56+
# define toupper(c) \
57+
__extension__ ({ int __x = (c); islower(__x) ? (__x - 'a' + 'A') : __x;})
58+
# define tolower(c) \
59+
__extension__ ({ int __x = (c); isupper(__x) ? (__x - 'A' + 'a') : __x;})
60+
#endif
61+
#endif /* !__cplusplus */
62+
63+
#ifndef __STRICT_ANSI__
64+
#define isascii(c) ((unsigned)(c)<=0177)
65+
#define toascii(c) ((c)&0177)
66+
#endif
67+
68+
_END_STD_C
69+
70+
#endif /* _CTYPE_H_ */

extra_include/dirent.h

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#ifndef _DIRENT_H_
2+
#define _DIRENT_H_
3+
#ifdef __cplusplus
4+
extern "C" {
5+
#endif
6+
#include <sys/dirent.h>
7+
8+
#if !defined(MAXNAMLEN) && !defined(_POSIX_SOURCE)
9+
#define MAXNAMLEN 1024
10+
#endif
11+
12+
#ifdef __cplusplus
13+
}
14+
#endif
15+
#endif /*_DIRENT_H_*/

extra_include/envz.h

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
2+
*
3+
* Permission to use, copy, modify, and distribute this software
4+
* is freely granted, provided that this notice is preserved.
5+
*/
6+
7+
#include <errno.h>
8+
#include <sys/types.h>
9+
10+
/* The newlib implementation of these functions assumes that sizeof(char) == 1. */
11+
char * envz_entry (const char *envz, size_t envz_len, const char *name);
12+
char * envz_get (const char *envz, size_t envz_len, const char *name);
13+
error_t envz_add (char **envz, size_t *envz_len, const char *name, const char *value);
14+
error_t envz_merge (char **envz, size_t *envz_len, const char *envz2, size_t envz2_len, int override);
15+
void envz_remove(char **envz, size_t *envz_len, const char *name);
16+
void envz_strip (char **envz, size_t *envz_len);

extra_include/errno.h

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#ifndef __ERRNO_H__
2+
#define __ERRNO_H__
3+
4+
#ifndef __error_t_defined
5+
typedef int error_t;
6+
#define __error_t_defined 1
7+
#endif
8+
9+
#include <sys/errno.h>
10+
11+
#endif /* !__ERRNO_H__ */

extra_include/fastmath.h

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#ifndef _FASTMATH_H_
2+
#ifdef __cplusplus
3+
extern "C" {
4+
#endif
5+
#define _FASTMATH_H_
6+
7+
#include <math.h>
8+
#include <machine/fastmath.h>
9+
10+
#ifdef __cplusplus
11+
}
12+
#endif
13+
#endif /* _FASTMATH_H_ */

0 commit comments

Comments
 (0)