/programs/develop/libraries/menuetlibc/include/libc/Makefile |
---|
0,0 → 1,12 |
all: |
make -C linuxtools |
make -C linuxtools install |
make -C src |
make -C stub |
make -C programs |
clean: |
make -C src clean |
make -C linuxtools clean |
make -C stub clean |
make -C programs clean |
/programs/develop/libraries/menuetlibc/include/libc/asm.h |
---|
0,0 → 1,18 |
#ifndef __LIBC_ASM_H |
#define __LIBC_ASM_H |
#include __DEV_CONFIG_H |
#ifndef NEEDS_UNDERSCORES |
#define C_SYM(x) x |
#else |
#define C_SYM(x) _##x |
#endif |
#define MK_C_SYM(x) C_SYM(x) : ; \ |
.globl C_SYM(x) |
#endif |
/programs/develop/libraries/menuetlibc/include/libc/asmdefs.h |
---|
0,0 → 1,52 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#ifndef __dj_include_libc_asmdefs_h__ |
#define __dj_include_libc_asmdefs_h__ |
.file __BASE_FILE__ |
#ifdef USE_EBX |
#define PUSHL_EBX pushl %ebx; |
#define POPL_EBX popl %ebx; |
#else |
#define PUSHL_EBX |
#define POPL_EBX |
#endif |
#ifdef USE_ESI |
#define PUSHL_ESI pushl %esi; |
#define POPL_ESI popl %esi; |
#else |
#define PUSHL_ESI |
#define POPL_ESI |
#endif |
#ifdef USE_EDI |
#define PUSHL_EDI pushl %edi; |
#define POPL_EDI popl %edi; |
#else |
#define PUSHL_EDI |
#define POPL_EDI |
#endif |
#define FUNC(x) .globl x; \ |
x: |
#define ENTER pushl %ebp; movl %esp,%ebp; PUSHL_EBX PUSHL_ESI PUSHL_EDI |
#define LEAVE L_leave: POPL_EDI POPL_ESI POPL_EBX movl %ebp,%esp; popl %ebp; ret |
#define LEAVEP(x) L_leave: x; POPL_EDI POPL_ESI POPL_EBX movl %ebp,%esp; popl %ebp; ret |
#define RET jmp L_leave |
#define ARG1 8(%ebp) |
#define ARG1h 10(%ebp) |
#define ARG2 12(%ebp) |
#define ARG2h 14(%ebp) |
#define ARG3 16(%ebp) |
#define ARG4 20(%ebp) |
#define ARG5 24(%ebp) |
#define ARG6 28(%ebp) |
#define ARG7 32(%ebp) |
#define ARG8 36(%ebp) |
#endif /* __dj_include_libc_asmdefs_h__ */ |
/programs/develop/libraries/menuetlibc/include/libc/atexit.h |
---|
0,0 → 1,34 |
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */ |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#ifndef __dj_include_libc_atexit_h__ |
#define __dj_include_libc_atexit_h__ |
#ifdef __cplusplus |
extern "C" { |
#endif |
#ifndef __dj_ENFORCE_ANSI_FREESTANDING |
#ifndef __STRICT_ANSI__ |
#ifndef _POSIX_SOURCE |
struct __atexit { |
struct __atexit *__next; |
void (*__function)(void); |
}; |
extern struct __atexit *__atexit_ptr; |
#endif /* !_POSIX_SOURCE */ |
#endif /* !__STRICT_ANSI__ */ |
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */ |
#ifndef __dj_ENFORCE_FUNCTION_CALLS |
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */ |
#ifdef __cplusplus |
} |
#endif |
#endif /* __dj_include_libc_atexit_h__ */ |
/programs/develop/libraries/menuetlibc/include/libc/bss.h |
---|
0,0 → 1,34 |
/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */ |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#ifndef __dj_include_bss_h_ |
#define __dj_include_bss_h_ |
#ifdef __cplusplus |
extern "C" { |
#endif |
#ifndef __dj_ENFORCE_ANSI_FREESTANDING |
#ifndef __STRICT_ANSI__ |
#ifndef _POSIX_SOURCE |
/* this gets *incremented* at startup, so that if a program dumps |
itself (emacs) you still have a way of telling. Compare this value |
with a static, and if it's different, you've been restarted. |
First time through on a non-unexec'd program, it's greater than 0 */ |
extern int __bss_count; |
#endif /* !_POSIX_SOURCE */ |
#endif /* !__STRICT_ANSI__ */ |
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */ |
#ifndef __dj_ENFORCE_FUNCTION_CALLS |
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */ |
#ifdef __cplusplus |
} |
#endif |
#endif /* !__dj_include_bss_h_ */ |
/programs/develop/libraries/menuetlibc/include/libc/dosexec.h |
---|
0,0 → 1,38 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#ifndef __dj_include_libc_dosexec_h__ |
#define __dj_include_libc_dosexec_h__ |
#ifdef __cplusplus |
extern "C" { |
#endif |
#ifndef __dj_ENFORCE_ANSI_FREESTANDING |
#ifndef __STRICT_ANSI__ |
#ifndef _POSIX_SOURCE |
extern char *__dosexec_find_on_path(const char *program, char *envp[], char *buf); |
extern int __dosexec_in_system; |
#define scan_ptr() \ |
const char **ptr; \ |
union { const char **ccpp; const char *ccp; } u; \ |
for (ptr = &argv0; *ptr; ptr++); \ |
u.ccp = *++ptr; \ |
ptr = u.ccpp; |
extern int __dosexec_command_exec(const char *program, char **argv, char **envp); |
#endif /* !_POSIX_SOURCE */ |
#endif /* !__STRICT_ANSI__ */ |
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */ |
#ifndef __dj_ENFORCE_FUNCTION_CALLS |
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */ |
#ifdef __cplusplus |
} |
#endif |
#endif /* __dj_include_libc_dosexec_h__ */ |
/programs/develop/libraries/menuetlibc/include/libc/dosio.h |
---|
0,0 → 1,44 |
/* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */ |
/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */ |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#ifndef __dj_include_libc_dosio_h__ |
#define __dj_include_libc_dosio_h__ |
#ifdef __cplusplus |
extern "C" { |
#endif |
#ifndef __dj_ENFORCE_ANSI_FREESTANDING |
#ifndef __STRICT_ANSI__ |
#ifndef _POSIX_SOURCE |
/* set to O_BINARY or O_TEXT */ |
extern char *__file_handle_modes; |
extern void __file_handle_set(int fd, int mode); |
int __doserr_to_errno(int doserr); |
/* puts "path" in the transfer buffer, fixing |
unix-allowed multi-slashes */ |
void _put_path(const char * ); |
void _put_path2(const char * , int); |
/* Convenience functions for setting up transfers */ |
#define __tb_offset 0 /* (__tb & 15) Always paragraph aligned */ |
#define __tb_segment (_go32_info_block.linear_address_of_transfer_buffer / 16) |
#endif /* !_POSIX_SOURCE */ |
#endif /* !__STRICT_ANSI__ */ |
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */ |
#ifndef __dj_ENFORCE_FUNCTION_CALLS |
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */ |
#ifdef __cplusplus |
} |
#endif |
#endif /* __dj_include_libc_dosio_h__ */ |
/programs/develop/libraries/menuetlibc/include/libc/environ.h |
---|
0,0 → 1,38 |
/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */ |
#ifndef __dj_include_libc_environ_h_ |
#define __dj_include_libc_environ_h_ |
#ifdef __cplusplus |
extern "C" { |
#endif |
#ifndef __dj_ENFORCE_ANSI_FREESTANDING |
#ifndef __STRICT_ANSI__ |
#ifndef _POSIX_SOURCE |
/* This starts at 1 and gets incremented every time some |
variable in the environment is added, deleted, or changes |
its value. It is meant to be used by functions that depend |
on values of environment variables, but don't want to call |
`getenv' unnecessarily (example: `__use_lfn'). |
To use this feature, define a static variable that is |
initialized to zero, and compare its value with the value of |
`__environ_changed': if they differ, you should call `getenv' |
(and record the last value of `__environ_changed' you've seen). */ |
extern unsigned __environ_changed; |
#endif /* !_POSIX_SOURCE */ |
#endif /* !__STRICT_ANSI__ */ |
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */ |
#ifndef __dj_ENFORCE_FUNCTION_CALLS |
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */ |
#ifdef __cplusplus |
} |
#endif |
#endif /* !__dj_include_environ_h_ */ |
/programs/develop/libraries/menuetlibc/include/libc/farptrgs.h |
---|
0,0 → 1,249 |
/* special version for libc - uses %gs instead of %fs. Ignore comments */ |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
/* Copyright (c) 1995 DJ Delorie. Permission granted to use for any |
purpose, provided this copyright remains attached and unmodified. |
THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR |
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED |
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» |
º Far Pointer Simulation Functions º |
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ |
This file attempts to make up for the lack of a "far" keyword in GCC. |
Although it doesn't provide access to far call APIs (like Windows), it |
does allow you to do far pointer data access without the overhead of |
movedata() or dosmemget/dosmemput(). |
You should *always* include this file when using these functions and |
compile with optimization enabled. They don't exist as normal functions |
in any library, and they compile down to only a few opcodes when used |
this way. They are almost as fast as native pointer operations, and |
about as fast as far pointers can get. |
If you don't use optimization, this file becomes prototypes for |
farptr.c, which generates real functions for these when not optimizing. |
When optimizing, farptr.c compiles to nothing. |
There are two types of functions here - standalone and invariant. The |
standalone functions take a selector and offset. These are used when |
you need only a few accesses, time isn't critical, or you don't know |
what's in the %gs register. The invariant ones don't take a selector, |
they only take an offset. These are used inside loops and in |
time-critical accesses where the selector doesn't change. To specify |
the selector, use the farsetsel() function. That selector is used for |
all farns*() functions until changed. You can use _fargetsel() if you |
want to temporary change the selector with _farsetsel() and restore |
it afterwards. |
The farpoke* and farpeek* take selectors. |
The farnspoke* and farnspeek* don't (note the `ns' for `no selector'). |
Warning: These routines all use the %gs register for their accesses. |
GCC normally uses only %ds and %es, and libc functions (movedata, |
dosmemget, dosmemput) use %gs. Still, you should be careful about |
assumptions concerning whether or not the value you put in %gs will be |
preserved across calls to other functions. If you guess wrong, your |
program will crash. Better safe than sorry. |
*/ |
#ifndef __dj_include_sys_farptr_h_ |
#define __dj_include_sys_farptr_h_ |
#ifdef __cplusplus |
extern "C" { |
#endif |
#ifndef __dj_ENFORCE_ANSI_FREESTANDING |
#ifndef __STRICT_ANSI__ |
#ifndef _POSIX_SOURCE |
void _farpokeb(unsigned short, unsigned long, unsigned char); |
void _farpokew(unsigned short, unsigned long, unsigned short); |
void _farpokel(unsigned short, unsigned long, unsigned long); |
unsigned char _farpeekb(unsigned short, unsigned long); |
unsigned short _farpeekw(unsigned short, unsigned long); |
unsigned long _farpeekl(unsigned short, unsigned long); |
void _farsetsel(unsigned short); |
unsigned short _fargetsel(void); |
void _farnspokeb(unsigned long, unsigned char); |
void _farnspokew(unsigned long, unsigned short); |
void _farnspokel(unsigned long, unsigned long); |
unsigned char _farnspeekb(unsigned long); |
unsigned short _farnspeekw(unsigned long); |
unsigned long _farnspeekl(unsigned long); |
extern __inline__ void |
_farpokeb(unsigned short selector, |
unsigned long offset, |
unsigned char value) |
{ |
__asm__ __volatile__ ("movw %w0,%%gs\n" |
" .byte 0x65 \n" |
" movb %b1,(%k2)" |
: |
: "rm" (selector), "qi" (value), "r" (offset)); |
} |
extern __inline__ void |
_farpokew(unsigned short selector, |
unsigned long offset, |
unsigned short value) |
{ |
__asm__ __volatile__ ("movw %w0,%%gs \n" |
" .byte 0x65 \n" |
" movw %w1,(%k2)" |
: |
: "rm" (selector), "ri" (value), "r" (offset)); |
} |
extern __inline__ void |
_farpokel(unsigned short selector, |
unsigned long offset, |
unsigned long value) |
{ |
__asm__ __volatile__ ("movw %w0,%%gs \n" |
" .byte 0x65 \n" |
" movl %k1,(%k2)" |
: |
: "rm" (selector), "ri" (value), "r" (offset)); |
} |
extern __inline__ unsigned char |
_farpeekb(unsigned short selector, |
unsigned long offset) |
{ |
unsigned char result; |
__asm__ __volatile__ ("movw %w1,%%gs \n" |
" .byte 0x65 \n" |
" movb (%k2),%b0" |
: "=q" (result) |
: "rm" (selector), "r" (offset)); |
return result; |
} |
extern __inline__ unsigned short |
_farpeekw(unsigned short selector, |
unsigned long offset) |
{ |
unsigned short result; |
__asm__ __volatile__ ("movw %w1, %%gs \n" |
" .byte 0x65 \n" |
" movw (%k2),%w0 \n" |
: "=r" (result) |
: "rm" (selector), "r" (offset)); |
return result; |
} |
extern __inline__ unsigned long |
_farpeekl(unsigned short selector, |
unsigned long offset) |
{ |
unsigned long result; |
__asm__ __volatile__ ("movw %w1,%%gs\n" |
" .byte 0x65\n" |
" movl (%k2),%k0" |
: "=r" (result) |
: "rm" (selector), "r" (offset)); |
return result; |
} |
extern __inline__ void |
_farsetsel(unsigned short selector) |
{ |
__asm__ __volatile__ ("movw %w0,%%gs" |
: |
: "rm" (selector)); |
} |
extern __inline__ unsigned short |
_fargetsel(void) |
{ |
unsigned short selector; |
__asm__ __volatile__ ("movw %%gs,%w0 \n" |
: "=r" (selector) |
: ); |
return selector; |
} |
extern __inline__ void |
_farnspokeb(unsigned long offset, |
unsigned char value) |
{ |
__asm__ __volatile__ (".byte 0x65\n" |
" movb %b0,(%k1)" |
: |
: "qi" (value), "r" (offset)); |
} |
extern __inline__ void |
_farnspokew(unsigned long offset, |
unsigned short value) |
{ |
__asm__ __volatile__ (".byte 0x65\n" |
" movw %w0,(%k1)" |
: |
: "ri" (value), "r" (offset)); |
} |
extern __inline__ void |
_farnspokel(unsigned long offset, |
unsigned long value) |
{ |
__asm__ __volatile__ (".byte 0x65\n" |
" movl %k0,(%k1)" |
: |
: "ri" (value), "r" (offset)); |
} |
extern __inline__ unsigned char |
_farnspeekb(unsigned long offset) |
{ |
unsigned char result; |
__asm__ __volatile__ (".byte 0x65\n" |
" movb (%k1),%b0" |
: "=q" (result) |
: "r" (offset)); |
return result; |
} |
extern __inline__ unsigned short |
_farnspeekw(unsigned long offset) |
{ |
unsigned short result; |
__asm__ __volatile__ (".byte 0x65\n" |
" movw (%k1),%w0" |
: "=r" (result) |
: "r" (offset)); |
return result; |
} |
extern __inline__ unsigned long |
_farnspeekl(unsigned long offset) |
{ |
unsigned long result; |
__asm__ __volatile__ (".byte 0x65\n" |
" movl (%k1),%k0" |
: "=r" (result) |
: "r" (offset)); |
return result; |
} |
#endif /* !_POSIX_SOURCE */ |
#endif /* !__STRICT_ANSI__ */ |
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */ |
#ifndef __dj_ENFORCE_FUNCTION_CALLS |
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */ |
#ifdef __cplusplus |
} |
#endif |
#endif /* !__dj_include_sys_farptr_h_ */ |
/programs/develop/libraries/menuetlibc/include/libc/file.h |
---|
0,0 → 1,119 |
/* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */ |
/* Copyright (C) 1997 DJ Delorie, see COPYING.DJ for details */ |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#ifndef __dj_include_libc_file_h__ |
#define __dj_include_libc_file_h__ |
#include <fcntl.h> |
#include <libc/dosio.h> |
#include <libc/ttyprvt.h> |
#ifdef __cplusplus |
extern "C" { |
#endif |
#ifndef __dj_ENFORCE_ANSI_FREESTANDING |
#ifndef __STRICT_ANSI__ |
#ifndef _POSIX_SOURCE |
#define _IOREAD 000010 |
#define _IOWRT 000020 |
#define _IOMYBUF 000040 |
#define _IOEOF 000100 |
#define _IOERR 000200 |
#define _IOSTRG 000400 |
#define _IORW 001000 |
#define _IOAPPEND 002000 |
#define _IORMONCL 004000 /* remove on close, for temp files */ |
/* if _flag & _IORMONCL, ._name_to_remove needs freeing */ |
#define _IOUNGETC 010000 /* there is an ungetc'ed character in the buffer */ |
#define _IOTERM 020000 /* file's handle hooked by termios */ |
#define _IONTERM 040000 /* file's handle not hooked by termios */ |
int _flsbuf(int, FILE*); |
int _filbuf(FILE *); |
void _fwalk(void (*)(FILE *)); |
static __inline__ int __getc_raw(FILE *const p) |
{ |
if(p->_cnt>0) |
{ |
p->_cnt--; |
return((unsigned char)*(p->_ptr++)); |
} |
return(_filbuf(p)); |
} |
static __inline__ int __putc_raw(int const x,FILE *const p) |
{ |
if(p->_cnt>0) |
{ |
p->_cnt--; |
return((unsigned char)(*(p->_ptr++)=(unsigned char)x)); |
} |
return(_flsbuf((unsigned char)x,p)); |
} |
static __inline__ int __is_text_file(FILE *const p) |
{ |
return(!((p)->_flag & (_IOSTRG | _IOTERM)) |
&& (__file_handle_modes[(p)->_file]&O_TEXT)); |
} |
static __inline__ int __getc(FILE *const p) |
{ |
int __c; |
if (__libc_read_termios_hook |
&& ((p)->_flag & (_IOTERM | _IONTERM)) == 0) |
{ |
extern int __isatty(int); |
/* first time we see this handle--see if termios hooked it */ |
if (!((p)->_flag & _IOSTRG) && __isatty((p)->_file)) |
(p)->_flag |= _IOTERM; |
else |
(p)->_flag |= _IONTERM; |
} |
__c = __getc_raw(p); |
if (__c=='\r' && __is_text_file(p)) |
return __getc_raw(p); |
return __c; |
} |
static __inline__ int __putc(const int x,FILE *const p) |
{ |
if (__libc_write_termios_hook |
&& ((p)->_flag & (_IOTERM | _IONTERM)) == 0) |
{ |
extern int __isatty(int); |
/* first time we see this handle--see if termios hooked it */ |
if (!((p)->_flag & _IOSTRG) && __isatty((p)->_file)) |
(p)->_flag |= _IOTERM; |
else |
(p)->_flag |= _IONTERM; |
} |
if(x=='\n' && __is_text_file(p)) |
__putc_raw('\r',p); |
return __putc_raw(x,p); |
} |
#undef fileno |
#define fileno(f) (f->_file) |
#undef feof |
#define feof(f) (((f)->_flag&_IOEOF)!=0) |
#undef ferror |
#define ferror(f) (((f)->_flag&_IOERR)!=0) |
#endif /* !_POSIX_SOURCE */ |
#endif /* !__STRICT_ANSI__ */ |
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */ |
#ifndef __dj_ENFORCE_FUNCTION_CALLS |
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */ |
#ifdef __cplusplus |
} |
#endif |
#endif /* __dj_include_libc_file_h__ */ |
/programs/develop/libraries/menuetlibc/include/libc/ieee.h |
---|
0,0 → 1,46 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#ifndef __dj_include_libc_ieee_h__ |
#define __dj_include_libc_ieee_h__ |
#ifdef __cplusplus |
extern "C" { |
#endif |
#ifndef __dj_ENFORCE_ANSI_FREESTANDING |
#ifndef __STRICT_ANSI__ |
#ifndef _POSIX_SOURCE |
typedef struct { |
unsigned mantissa:23; |
unsigned exponent:8; |
unsigned sign:1; |
} float_t; |
typedef struct { |
unsigned mantissal:32; |
unsigned mantissah:20; |
unsigned exponent:11; |
unsigned sign:1; |
} double_t; |
typedef struct { |
unsigned mantissal:32; |
unsigned mantissah:32; |
unsigned exponent:15; |
unsigned sign:1; |
} long_double_t; |
#endif /* !_POSIX_SOURCE */ |
#endif /* !__STRICT_ANSI__ */ |
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */ |
#ifndef __dj_ENFORCE_FUNCTION_CALLS |
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */ |
#ifdef __cplusplus |
} |
#endif |
#endif /* __dj_include_libc_ieee_h__ */ |
/programs/develop/libraries/menuetlibc/include/libc/internal.h |
---|
0,0 → 1,26 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#ifndef __dj_include_libc_internal_h__ |
#define __dj_include_libc_internal_h__ |
#ifdef __cplusplus |
extern "C" { |
#endif |
void __crt1_startup(void); |
void __main(void); |
void _npxsetup(char *argv0); |
void __emu387_exception_handler(void); |
void __djgpp_exception_processor(void); |
void __djgpp_exception_setup(void); |
static inline int str_check_ptr(void * ptr) |
{ |
unsigned long p=(unsigned long)ptr; |
if(p<64 || p>(64*1024*1024)) return 0; |
return 1; |
} |
#ifdef __cplusplus |
} |
#endif |
#endif /* __dj_include_libc_internal_h__ */ |
/programs/develop/libraries/menuetlibc/include/libc/local.h |
---|
0,0 → 1,39 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#ifndef __dj_include_libc_local_h__ |
#define __dj_include_libc_local_h__ |
#ifdef __cplusplus |
extern "C" { |
#endif |
#ifndef __dj_ENFORCE_ANSI_FREESTANDING |
#ifndef __STRICT_ANSI__ |
#ifndef _POSIX_SOURCE |
FILE * __alloc_file(void); |
/* A FILE* is considered "free" if its flag is zero. */ |
#define __FILE_REC_MAX 20 |
typedef struct __file_rec { |
struct __file_rec *next; |
int count; |
FILE *files[__FILE_REC_MAX]; |
} __file_rec; |
extern __file_rec *__file_rec_list; |
#endif /* !_POSIX_SOURCE */ |
#endif /* !__STRICT_ANSI__ */ |
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */ |
#ifndef __dj_ENFORCE_FUNCTION_CALLS |
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */ |
#ifdef __cplusplus |
} |
#endif |
#endif /* __dj_include_libc_local_h__ */ |
/programs/develop/libraries/menuetlibc/include/libc/mkfargs.bat |
---|
0,0 → 1,5 |
@echo off |
echo /* special version for libc - uses %%gs instead of %%fs. Ignore comments */> farptrgs.h |
echo.>>farptrgs.h |
sed -e 's/%%fs/%%gs/g' -e 's/0x64/0x65/g' < ..\sys\farptr.h >> farptrgs.h |
/programs/develop/libraries/menuetlibc/include/libc/stdiohk.h |
---|
0,0 → 1,38 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#ifndef __dj_include_libc_stdiohk_h__ |
#define __dj_include_libc_stdiohk_h__ |
#ifdef __cplusplus |
extern "C" { |
#endif |
#ifndef __dj_ENFORCE_ANSI_FREESTANDING |
#ifndef __STRICT_ANSI__ |
#ifndef _POSIX_SOURCE |
/* Force stdiohk.o to get linked in, and that module has the |
code for the stdio flush/fclose stuff. That .o causes the |
hook function to get initialized also. */ |
#include __DEV_CONFIG_H |
#ifndef NEEDS_UNDERSCORES |
__asm__(".long __stdio_cleanup_proc"); |
#else |
__asm__(".long ___stdio_cleanup_proc"); |
#endif |
#endif /* !_POSIX_SOURCE */ |
#endif /* !__STRICT_ANSI__ */ |
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */ |
#ifndef __dj_ENFORCE_FUNCTION_CALLS |
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */ |
#ifdef __cplusplus |
} |
#endif |
#endif /* __dj_include_libc_stdiohk_h__ */ |
/programs/develop/libraries/menuetlibc/include/libc/stubs.h |
---|
0,0 → 1,53 |
/* Copyright (C) 1997 DJ Delorie, see COPYING.DJ for details */ |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#ifndef __dj_include_libc_stubs_h__ |
#define __dj_include_libc_stubs_h__ |
#ifdef __cplusplus |
extern "C" { |
#endif |
#ifndef __dj_ENFORCE_ANSI_FREESTANDING |
#ifndef __STRICT_ANSI__ |
#ifndef _POSIX_SOURCE |
/* POSIX functions (for when compiling an ANSI function) */ |
/* DJGPP functions (for compiling POSIX or ANSI functions) */ |
#define crlf2nl __crlf2nl |
#define dosmemget __dosmemget |
#define dosmemput __dosmemput |
#define filelength __filelength |
#define findfirst __findfirst |
#define findnext __findnext |
#define fsync __fsync |
#define getdisk __getdisk |
#define getdtablesize __getdtablesize |
#define getitimer __getitimer |
#define modfl __modfl |
#define movedata __movedata |
#define pow10 __pow10 |
#define pow2 __pow2 |
#define putenv __putenv |
#define sbrk __sbrk |
#define setitimer __setitimer |
#define setmode __setmode |
#define spawnve __spawnve |
#define spawnvpe __spawnvpe |
#define stricmp __stricmp |
#define sync __sync |
#endif /* !_POSIX_SOURCE */ |
#endif /* !__STRICT_ANSI__ */ |
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */ |
#ifndef __dj_ENFORCE_FUNCTION_CALLS |
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */ |
#ifdef __cplusplus |
} |
#endif |
#endif /* __dj_include_libc_stubs_h__ */ |
/programs/develop/libraries/menuetlibc/include/libc/ttyprvt.h |
---|
0,0 → 1,138 |
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */ |
#ifndef __dj_include_libc_ttyprvt_h__ |
#define __dj_include_libc_ttyprvt_h__ |
#ifdef __cplusplus |
extern "C" { |
#endif |
#ifndef __dj_ENFORCE_ANSI_FREESTANDING |
#ifndef __STRICT_ANSI__ |
#ifndef _POSIX_SOURCE |
#include <termios.h> |
#include <unistd.h> |
#define _TTY_CTRL(x) ((x) & 0x1f) |
#define _TTY_QUEUE_SIZE 2048 |
#define _TTY_EDITLINE_SIZE ((_TTY_QUEUE_SIZE) / 2) |
#define _TTY_EDITLINE_CTRL 0 |
#define _TTY_EDITLINE_SINGLE 1 |
#define _TTY_EDITLINE_INVALID -1 |
struct tty_queue |
{ |
int size; |
unsigned char *top; |
unsigned char *bottom; |
int count; |
unsigned char *rpos; |
unsigned char *wpos; |
}; |
struct tty |
{ |
struct termios __libc_termios; |
struct tty_queue __libc_tty_queue; |
int __libc_tty_status; |
}; |
struct tty_editline |
{ |
int col; |
char flag[_TTY_EDITLINE_SIZE]; |
unsigned char buf[_TTY_EDITLINE_SIZE]; |
}; |
#if !defined (_POSIX_VDISABLE) || (_POSIX_VDISABLE == 0) |
#error _POSIX_VDISABLE is undefine or zero. |
#endif |
#define TTYDEFAULT \ |
{ \ |
{ \ |
/* c_cc[] */ \ |
{ \ |
(cc_t) 0, /* pad */ \ |
(cc_t) _TTY_CTRL ('d'), /* VEOF */ \ |
(cc_t) _POSIX_VDISABLE, /* VEOL */ \ |
(cc_t) _TTY_CTRL ('h'), /* VERASE */ \ |
(cc_t) _TTY_CTRL ('c'), /* VINTR */ \ |
(cc_t) _TTY_CTRL ('u'), /* VKILL */ \ |
(cc_t) 1, /* VMIN */ \ |
(cc_t) _TTY_CTRL ('\\'),/* VQUIT */ \ |
(cc_t) _TTY_CTRL ('q'), /* VSTART */ \ |
(cc_t) _TTY_CTRL ('s'), /* VSTOP */ \ |
(cc_t) _TTY_CTRL ('z'), /* VSUSP */ \ |
(cc_t) 0, /* VTIME */ \ |
}, \ |
(tcflag_t) (CS8|CREAD|CLOCAL), /* c_cflag */ \ |
(tcflag_t) (BRKINT|ICRNL|IMAXBEL), /* c_iflag */ \ |
(tcflag_t) (ISIG|ICANON|ECHO|IEXTEN|ECHOE|ECHOKE|ECHOCTL), /* c_lflag */ \ |
(tcflag_t) (OPOST|ONLCR|ONOEOT), /* c_oflag */ \ |
(speed_t) (B9600), /* c_ispeed */ \ |
(speed_t) (B9600), /* c_ospeed */ \ |
}, \ |
/* struct tty_queue __libc_tty_queue */ \ |
{ \ |
_TTY_QUEUE_SIZE, \ |
__libc_tty_queue_buffer, \ |
__libc_tty_queue_buffer + _TTY_QUEUE_SIZE, \ |
0, \ |
__libc_tty_queue_buffer, \ |
__libc_tty_queue_buffer, \ |
}, \ |
/* __libc_tty_status */ \ |
0, \ |
} |
#define t_termios __libc_termios |
#define t_iflag __libc_termios.c_iflag |
#define t_oflag __libc_termios.c_oflag |
#define t_cflag __libc_termios.c_cflag |
#define t_lflag __libc_termios.c_lflag |
#define t_ispeed __libc_termios.c_ispeed |
#define t_ospeed __libc_termios.c_ospeed |
#define t_cc __libc_termios.c_cc |
#define t_status __libc_tty_status |
#define t_size __libc_tty_queue.size |
#define t_top __libc_tty_queue.top |
#define t_bottom __libc_tty_queue.bottom |
#define t_count __libc_tty_queue.count |
#define t_rpos __libc_tty_queue.rpos |
#define t_wpos __libc_tty_queue.wpos |
#define _TS_LNCH 0x01 /* next character is literal */ |
#define _CC_EQU(v,c) (((c) == (unsigned char) __libc_tty_p->t_cc[(v)]) \ |
&& ((c) != (unsigned char) _POSIX_VDISABLE)) |
#define _CC_NEQU(v,c) (((c) != (unsigned char)__libc_tty_p->t_cc[(v)]) \ |
&& ((c) != (unsigned char) _POSIX_VDISABLE)) |
/* internal buffers */ |
extern unsigned char __libc_tty_queue_buffer[]; |
extern struct tty __libc_tty_internal; |
extern struct tty *__libc_tty_p; |
extern struct tty_editline __libc_tty_editline; |
/* termios hooks */ |
extern ssize_t (*__libc_read_termios_hook)(int handle, void *buffer, size_t count, |
ssize_t *rv); |
extern ssize_t (*__libc_write_termios_hook)(int handle, const void *buffer, size_t count, |
ssize_t *rv); |
extern int __libc_termios_hook_common_count; |
/* functions */ |
void __libc_termios_init (void); |
#endif /* !_POSIX_SOURCE */ |
#endif /* !__STRICT_ANSI__ */ |
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */ |
#ifdef __cplusplus |
} |
#endif |
#endif /* !__dj_include_libc_ttyprvt_h__ */ |
/programs/develop/libraries/menuetlibc/include/libc/unconst.h |
---|
0,0 → 1,28 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#ifndef __dj_include_libc_unconst_h__ |
#define __dj_include_libc_unconst_h__ |
#ifdef __cplusplus |
extern "C" { |
#endif |
#ifndef __dj_ENFORCE_ANSI_FREESTANDING |
#ifndef __STRICT_ANSI__ |
#ifndef _POSIX_SOURCE |
#define unconst(__v, __t) __extension__ ({union { const __t __cp; __t __p; } __q; __q.__cp = __v; __q.__p;}) |
#endif /* !_POSIX_SOURCE */ |
#endif /* !__STRICT_ANSI__ */ |
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */ |
#ifndef __dj_ENFORCE_FUNCTION_CALLS |
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */ |
#ifdef __cplusplus |
} |
#endif |
#endif /* __dj_include_libc_unconst_h__ */ |