diff --git a/.cvsignore b/.cvsignore
new file mode 100644
index 0000000..d31d286
--- /dev/null
+++ b/.cvsignore
@@ -0,0 +1,7 @@
+ne2k-rx.log
+ne2k-rxdump.txt
+ne2k-tx.log
+ne2k-txdump.txt
+ne2k.raw
+ne2k.txt
+snapshot.txt
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..07e78a8
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,48 @@
+# $Id$
+# The System Makefile (C) 2002 The UbixOS Project
+
+all: kernel libc ubix objgfx40 libcpp libstdc++ views bin tools
+# depend kernel tools
+
+libc: src
+ (cd src/lib/libc;make)
+
+objgfx40: src
+ (cd src/lib/objgfx40;make)
+
+views: src
+ (cd src/lib/views/sunlight;make)
+
+ubix: src
+ (cd src/lib/ubix;make)
+
+libcpp: src
+ (cd src/lib/libcpp;make)
+
+depend: src
+ (cd src/lib/ubix;make)
+
+bin: src
+ (cd src/bin;make)
+
+libstdc++: src
+ (cd src/lib/libstdc++;make)
+
+kernel: src
+ (cd src/sys;make)
+
+tools: src
+ (cd src/tools;make)
+
+install:
+ (cd src/sys;make install)
+
+clean:
+ (cd src/sys;make clean)
+ (cd src/lib/libc;make clean)
+ (cd src/bin;make clean)
+ (cd src/lib/ubix;make clean)
+ (cd src/lib/objgfx40;make clean)
+ (cd src/lib/libcpp;make clean)
+ (cd src/lib/views/sunlight;make clean)
+ (cd src/lib/libstdc++;make clean)
diff --git a/README b/README
new file mode 100644
index 0000000..a5653e9
--- /dev/null
+++ b/README
@@ -0,0 +1,9 @@
+Installation:
+
+ make all install <- This will build the kernel and components and put them onto a floppy
+ To make a bootable floppy do the following:
+ 1) cd src/sys/boot/btx;make
+ 2) cd ../boot2;make
+ 3) cat boot1 boot2 > /dev/fd0
+ 4) gcc -o test test.c;./test /dev/fd0 1;rm ./test
+
diff --git a/doc/doxygen/html/8259_8h-source.html b/doc/doxygen/html/8259_8h-source.html
new file mode 100644
index 0000000..c7a38de
--- /dev/null
+++ b/doc/doxygen/html/8259_8h-source.html
@@ -0,0 +1,58 @@
+
+
+Ubixos: 8259.h Source File
+
+
+
+
8259.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _8259_H
+00025 #define _8259_H
+00026
+00027 #include <ubixos/types.h>
+00028
+00029 #define mPic 0x20 // I/O for master PIC
+00030 #define mImr 0x21 // I/O for master IMR
+00031 #define sPic 0xA0 // I/O for slave PIC
+00032 #define sImr 0xA1 // I/O for slace IMR
+00033 #define eoi 0x20 // EOI command
+00034 #define icw1 0x11 // Cascade, Edge triggered
+00035 #define icw4 0x01 // 8088 mode
+00036 #define mVec 0x68 // Vector for master
+00037 #define sVec 0x70 // Vector for slave
+00038 #define ocw3Irr 0x0A // Read IRR
+00039 #define ocw3Isr 0x0B // Read ISR
+00040
+00041 int init8259();
+00042 void irqEnable(uInt16 irqNo);
+00043 void irqDisable(uInt16 irqNo);
+00044
+00045 #endif
+00046
+
Generated on Wed Apr 28 17:49:28 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/8259_8h.html b/doc/doxygen/html/8259_8h.html
new file mode 100644
index 0000000..7bf76e3
--- /dev/null
+++ b/doc/doxygen/html/8259_8h.html
@@ -0,0 +1,378 @@
+
+
+Ubixos: 8259.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:19 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/__types_8h-source.html b/doc/doxygen/html/__types_8h-source.html
new file mode 100644
index 0000000..3445756
--- /dev/null
+++ b/doc/doxygen/html/__types_8h-source.html
@@ -0,0 +1,45 @@
+
+
+Ubixos: _types.h Source File
+
+
+
+
_types.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef __TYPES_H
+00025 #define __TYPES_H
+00026
+00027 #include <ubixos/types.h>
+00028
+00029 typedefunsignedlong __clock_t;
+00030 typedeflong __time_t;
+00031
+00032 #endif
+00033
+
Generated on Wed Apr 28 17:49:29 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/__types_8h.html b/doc/doxygen/html/__types_8h.html
new file mode 100644
index 0000000..3668178
--- /dev/null
+++ b/doc/doxygen/html/__types_8h.html
@@ -0,0 +1,68 @@
+
+
+Ubixos: _types.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:19 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/api__msg_8h-source.html b/doc/doxygen/html/api__msg_8h-source.html
new file mode 100644
index 0000000..2fd46f3
--- /dev/null
+++ b/doc/doxygen/html/api__msg_8h-source.html
@@ -0,0 +1,108 @@
+
+
+Ubixos: api_msg.h Source File
+
+
+
+
api_msg.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035 #ifndef __LWIP_API_MSG_H__
+00036 #define __LWIP_API_MSG_H__
+00037
+00038 #include "net/opt.h"
+00039 #include "net/pbuf.h"
+00040 #include "net/sys.h"
+00041
+00042 #include "net/ipv4/ip.h"
+00043
+00044 #include "net/udp.h"
+00045 #include "net/tcp.h"
+00046
+00047 #include "net/api.h"
+00048
+00049 enum api_msg_type {
+00050 API_MSG_NEWCONN,
+00051 API_MSG_DELCONN,
+00052
+00053 API_MSG_BIND,
+00054 API_MSG_CONNECT,
+00055
+00056 API_MSG_LISTEN,
+00057 API_MSG_ACCEPT,
+00058
+00059 API_MSG_SEND,
+00060 API_MSG_RECV,
+00061 API_MSG_WRITE,
+00062
+00063 API_MSG_CLOSE,
+00064
+00065 API_MSG_MAX
+00066 };
+00067
+00068 struct api_msg_msg {
+00069 struct netconn *conn;
+00070 enum netconn_type conntype;
+00071 union {
+00072 struct pbuf *p;
+00073 struct {
+00074 struct ip_addr *ipaddr;
+00075 uInt16 port;
+00076 } bc;
+00077 struct {
+00078 void *dataptr;
+00079 uInt16 len;
+00080 unsignedchar copy;
+00081 } w;
+00082 sys_mbox_t mbox;
+00083 uInt16 len;
+00084 } msg;
+00085 };
+00086
+00087 struct api_msg {
+00088 enum api_msg_type type;
+00089 struct api_msg_msg msg;
+00090 };
+00091
+00092 void api_msg_input(struct api_msg *msg);
+00093 void api_msg_post(struct api_msg *msg);
+00094
+00095 #endif /* __LWIP_API_MSG_H__ */
+00096
+
Generated on Wed Apr 28 17:49:30 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/api__msg_8h.html b/doc/doxygen/html/api__msg_8h.html
new file mode 100644
index 0000000..f290a3f
--- /dev/null
+++ b/doc/doxygen/html/api__msg_8h.html
@@ -0,0 +1,160 @@
+
+
+Ubixos: api_msg.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:19 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/arch_8h-source.html b/doc/doxygen/html/arch_8h-source.html
new file mode 100644
index 0000000..d9e9635
--- /dev/null
+++ b/doc/doxygen/html/arch_8h-source.html
@@ -0,0 +1,73 @@
+
+
+Ubixos: arch.h Source File
+
+
+
+
arch.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035 #ifndef __LWIP_ARCH_H__
+00036 #define __LWIP_ARCH_H__
+00037
+00038 #ifndef LITTLE_ENDIAN
+00039 #define LITTLE_ENDIAN 1234
+00040 #endif
+00041
+00042 #ifndef BIG_ENDIAN
+00043 #define BIG_ENDIAN 4321
+00044 #endif
+00045
+00046 #include "arch/cpu.h"
+00047 #include "arch/cc.h"
+00048
+00049 #ifndef PACK_STRUCT_BEGIN
+00050 #define PACK_STRUCT_BEGIN
+00051 #endif /* PACK_STRUCT_BEGIN */
+00052
+00053 #ifndef PACK_STRUCT_END
+00054 #define PACK_STRUCT_END
+00055 #endif /* PACK_STRUCT_END */
+00056
+00057 #ifndef PACK_STRUCT_FIELD
+00058 #define PACK_STRUCT_FIELD(x) x
+00059 #endif /* PACK_STRUCT_FIELD */
+00060
+00061 #endif /* __LWIP_ARCH_H__ */
+
Generated on Wed Apr 28 17:49:30 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/arch_8h.html b/doc/doxygen/html/arch_8h.html
new file mode 100644
index 0000000..3efe7a4
--- /dev/null
+++ b/doc/doxygen/html/arch_8h.html
@@ -0,0 +1,69 @@
+
+
+Ubixos: arch.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:19 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/arp_8h-source.html b/doc/doxygen/html/arp_8h-source.html
new file mode 100644
index 0000000..520b8b1
--- /dev/null
+++ b/doc/doxygen/html/arp_8h-source.html
@@ -0,0 +1,107 @@
+
+
+Ubixos: arp.h Source File
+
+
+
+
arp.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. All advertising materials mentioning features or use of this software
+00014 * must display the following acknowledgement:
+00015 * This product includes software developed by the Swedish Institute
+00016 * of Computer Science and its contributors.
+00017 * 4. Neither the name of the Institute nor the names of its contributors
+00018 * may be used to endorse or promote products derived from this software
+00019 * without specific prior written permission.
+00020 *
+00021 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00022 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00023 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00024 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00025 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00026 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00027 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00028 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00029 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00030 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00031 * SUCH DAMAGE.
+00032 *
+00033 * This file is part of the lwIP TCP/IP stack.
+00034 *
+00035 * Author: Adam Dunkels <adam@sics.se>
+00036 *
+00037 * $Id$
+00038 *
+00039 */
+00040
+00041 #ifndef __NETIF_ARP_H__
+00042 #define __NETIF_ARP_H__
+00043
+00044 #include "net/pbuf.h"
+00045 #include "net/ipv4/ip_addr.h"
+00046 #include "net/netif.h"
+00047
+00048 struct eth_addr {
+00049 PACK_STRUCT_FIELD(uInt8 addr[6]);
+00050 } PACK_STRUCT_STRUCT;
+00051
+00052 struct eth_hdr {
+00053 PACK_STRUCT_FIELD(struct eth_addr dest);
+00054 PACK_STRUCT_FIELD(struct eth_addr src);
+00055 PACK_STRUCT_FIELD(uInt16 type);
+00056 } PACK_STRUCT_STRUCT;
+00057
+00058 #define ARP_TMR_INTERVAL 10000
+00059
+00060 #define ETHTYPE_ARP 0x0806
+00061 #define ETHTYPE_IP 0x0800
+00062
+00063 /* Initializes ARP. */
+00064 void arp_init(void);
+00065
+00066 /* The arp_tmr() function should be called every ARP_TMR_INTERVAL
+00067 microseconds (10 seconds). This function is responsible for
+00068 expiring old entries in the ARP table. */
+00069 void arp_tmr(void);
+00070
+00071 /* Should be called for all incoming packets of IP kind. The function
+00072 does not alter the packet in any way, it just updates the ARP
+00073 table. After this function has been called, the normal TCP/IP stack
+00074 input function should be called. */
+00075 void arp_ip_input(struct netif *netif, struct pbuf *p);
+00076
+00077 /* Should be called for incoming ARP packets. The pbuf in the argument
+00078 is freed by this function. If the function returns a pbuf (i.e.,
+00079 returns non-NULL), that pbuf constitutes an ARP reply and should be
+00080 sent out on the Ethernet. */
+00081 struct pbuf *arp_arp_input(struct netif *netif, struct eth_addr *ethaddr,
+00082 struct pbuf *p);
+00083
+00084 /* arp_loopup() is called to do an IP address -> Ethernet address
+00085 translation. If the function returns NULL, there is no mapping and
+00086 the arp_query() function should be called. */
+00087 struct eth_addr *arp_lookup(struct ip_addr *ipaddr);
+00088
+00089 /* Constructs an ARP query packet for the given IP address. The
+00090 function returns a pbuf that contains the reply and that should be
+00091 sent out on the Ethernet. */
+00092 struct pbuf *arp_query(struct netif *netif, struct eth_addr *ethaddr,
+00093 struct ip_addr *ipaddr);
+00094
+00095 #endif /* __NETIF_ARP_H__ */
+
Generated on Wed Apr 28 17:49:30 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/arp_8h.html b/doc/doxygen/html/arp_8h.html
new file mode 100644
index 0000000..27e1972
--- /dev/null
+++ b/doc/doxygen/html/arp_8h.html
@@ -0,0 +1,352 @@
+
+
+Ubixos: arp.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:19 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/atkbd_8h-source.html b/doc/doxygen/html/atkbd_8h-source.html
new file mode 100644
index 0000000..4f40ec2
--- /dev/null
+++ b/doc/doxygen/html/atkbd_8h-source.html
@@ -0,0 +1,52 @@
+
+
+Ubixos: atkbd.h Source File
+
+
+
+
atkbd.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _KEYBOARD_H
+00025 #define _KEYBOARD_H
+00026
+00027 #define shiftKey 1
+00028 #define controlKey 2
+00029 #define altKey 4
+00030 #define ledNumlock 2
+00031 #define ledScrolllock 1
+00032 #define ledCapslock 4
+00033
+00034 int keyboardInit();
+00035 void keyboardISR();
+00036 void keyboardHandler();
+00037 void setLED();
+00038
+00039 #endif
+00040
+
Generated on Wed Apr 28 17:49:30 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/atkbd_8h.html b/doc/doxygen/html/atkbd_8h.html
new file mode 100644
index 0000000..e07cbe2
--- /dev/null
+++ b/doc/doxygen/html/atkbd_8h.html
@@ -0,0 +1,285 @@
+
+
+Ubixos: atkbd.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:19 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/boot_2boot2_2lib_8h-source.html b/doc/doxygen/html/boot_2boot2_2lib_8h-source.html
new file mode 100644
index 0000000..a3a2535
--- /dev/null
+++ b/doc/doxygen/html/boot_2boot2_2lib_8h-source.html
@@ -0,0 +1,36 @@
+
+
+Ubixos: lib.h Source File
+
+
+
+
lib.h
00001 /*
+00002 * Copyright (c) 1998 Robert Nordier
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms are freely
+00006 * permitted provided that the above copyright notice and this
+00007 * paragraph and the following disclaimer are duplicated in all
+00008 * such forms.
+00009 *
+00010 * This software is provided "AS IS" and without any express or
+00011 * implied warranties, including, without limitation, the implied
+00012 * warranties of merchantability and fitness for a particular
+00013 * purpose.
+00014 */
+00015
+00016 /*
+00017 * $FreeBSD: src/sys/boot/i386/boot2/lib.h,v 1.2 1999/08/28 00:40:02 peter Exp $
+00018 */
+00019
+00020 void sio_init(void);
+00021 void sio_flush(void);
+00022 void sio_putc(int);
+00023 int sio_getc(void);
+00024 int sio_ischar(void);
+
Generated on Wed Apr 28 17:49:36 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/boot_2boot2_2ubixfs_8h-source.html b/doc/doxygen/html/boot_2boot2_2ubixfs_8h-source.html
new file mode 100644
index 0000000..63883a6
--- /dev/null
+++ b/doc/doxygen/html/boot_2boot2_2ubixfs_8h-source.html
@@ -0,0 +1,56 @@
+
+
+Ubixos: ubixfs.h Source File
+
+
+
+
ubixfs.h
00001 #define DOSPTYP_UBX 0x2A /* UbixFS partition type */
+00002 #define UBIXDISKMAGIC ((u_int32_t)0x45) /* The disk magic number */
+00003 #define MAXUBIXPARTITIONS 16
+00004 #define UBIXFSMAGIC ((u_int32_t)0x69) /* The File System Magic Number */
+00005
+00006 typedefunsignedlong uLong;
+00007 typedefunsignedshort uShort;
+00008
+00009
+00010 struct ubixDiskLabel {
+00011 u_int32_t magicNum;
+00012 u_int32_t magicNum2;
+00013 u_int16_t driveType;
+00014 u_int16_t numPartitions;
+00015 struct ubixPartitions { /* the partition table */
+00016 u_int32_t p_size; /* number of sectors in partition */
+00017 u_int32_t p_offset; /* starting sector */
+00018 u_int32_t p_fsize; /* filesystem basic fragment size */
+00019 u_int32_t p_bsize; /* BAT size */
+00020 u_int8_t p_fstype; /* filesystem type, see below */
+00021 u_int8_t p_frag; /* filesystem fragments per block */
+00022 } partitions[MAXUBIXPARTITIONS];
+00023 };
+00024
+00025 //Block Allocation Table Entry
+00026 struct blockAllocationTableEntry {
+00027 long attributes; //Block Attributes
+00028 long realSector; //Real Sector
+00029 long nextBlock; //Sector Of Next Block
+00030 long reserved; //Reserved
+00031 };
+00032
+00033
+00034 struct directoryEntry {
+00035 uLong startCluster; //Starting Cluster Of File
+00036 uLong size; //Size Of File
+00037 uLong creationDate; //Date Created
+00038 uLong lastModified; //Date Last Modified
+00039 uLong uid; //UID Of Owner
+00040 uLong gid; //GID Of Owner
+00041 uShort attributes; //Files Attributes
+00042 uShort permissions; //Files Permissions
+00043 char fileName[256]; //File Name
+00044 };
+
Generated on Wed Apr 28 17:49:42 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/btxv86_8h-source.html b/doc/doxygen/html/btxv86_8h-source.html
new file mode 100644
index 0000000..6771ad5
--- /dev/null
+++ b/doc/doxygen/html/btxv86_8h-source.html
@@ -0,0 +1,75 @@
+
+
+Ubixos: btxv86.h Source File
+
+
+
+
btxv86.h
00001 /*
+00002 * Copyright (c) 1998 Robert Nordier
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms are freely
+00006 * permitted provided that the above copyright notice and this
+00007 * paragraph and the following disclaimer are duplicated in all
+00008 * such forms.
+00009 *
+00010 * This software is provided "AS IS" and without any express or
+00011 * implied warranties, including, without limitation, the implied
+00012 * warranties of merchantability and fitness for a particular
+00013 * purpose.
+00014 */
+00015
+00016 /*
+00017 * $FreeBSD: src/sys/boot/i386/btx/lib/btxv86.h,v 1.5 1999/08/28 00:40:08 peter Exp $
+00018 */
+00019
+00020 #ifndef _BTXV86_H_
+00021 #define _BTXV86_H_
+00022
+00023 #include <sys/types.h>
+00024
+00025 #define V86_ADDR 0x10000 /* Segment:offset address */
+00026 #define V86_CALLF 0x20000 /* Emulate far call */
+00027 #define V86_FLAGS 0x40000 /* Return flags */
+00028
+00029 struct __v86 {
+00030 uint32_t ctl; /* Control flags */
+00031 uint32_t addr; /* Interrupt number or address */
+00032 uint32_t es; /* V86 ES register */
+00033 uint32_t ds; /* V86 DS register */
+00034 uint32_t fs; /* V86 FS register */
+00035 uint32_t gs; /* V86 GS register */
+00036 uint32_t eax; /* V86 EAX register */
+00037 uint32_t ecx; /* V86 ECX register */
+00038 uint32_t edx; /* V86 EDX register */
+00039 uint32_t ebx; /* V86 EBX register */
+00040 uint32_t efl; /* V86 eflags register */
+00041 uint32_t ebp; /* V86 EBP register */
+00042 uint32_t esi; /* V86 ESI register */
+00043 uint32_t edi; /* V86 EDI register */
+00044 };
+00045
+00046 externstruct __v86 __v86; /* V86 interface structure */
+00047 void __v86int(void);
+00048
+00049 #define v86 __v86
+00050 #define v86int __v86int
+00051
+00052 extern u_int32_t __base;
+00053 extern u_int32_t __args;
+00054
+00055 #define PTOV(pa) ((caddr_t)(pa) - __base)
+00056 #define VTOP(va) ((vm_offset_t)(va) + __base)
+00057 #define VTOPSEG(va) (u_int16_t)(VTOP((caddr_t)va) >> 4)
+00058 #define VTOPOFF(va) (u_int16_t)(VTOP((caddr_t)va) & 0xf)
+00059
+00060 void __exit(int) __attribute__((__noreturn__));
+00061 void __exec(caddr_t, ...);
+00062
+00063 #endif /* !_BTXV86_H_ */
+
Generated on Wed Apr 28 17:49:31 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/cc_8h-source.html b/doc/doxygen/html/cc_8h-source.html
new file mode 100644
index 0000000..ff81a9a
--- /dev/null
+++ b/doc/doxygen/html/cc_8h-source.html
@@ -0,0 +1,55 @@
+
+
+Ubixos: cc.h Source File
+
+
+
+
cc.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035 #ifndef __ARCH_CC_H__
+00036 #define __ARCH_CC_H__
+00037
+00038 #define PACK_STRUCT_FIELD(x) x __attribute__((packed))
+00039 #define PACK_STRUCT_STRUCT __attribute__((packed))
+00040 #define PACK_STRUCT_BEGIN
+00041 #define PACK_STRUCT_END
+00042
+00043 #endif /* __ARCH_CC_H__ */
+
Generated on Wed Apr 28 17:49:31 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/cc_8h.html b/doc/doxygen/html/cc_8h.html
new file mode 100644
index 0000000..3a47fd5
--- /dev/null
+++ b/doc/doxygen/html/cc_8h.html
@@ -0,0 +1,120 @@
+
+
+Ubixos: cc.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:19 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/cdefs_8h-source.html b/doc/doxygen/html/cdefs_8h-source.html
new file mode 100644
index 0000000..4568f6f
--- /dev/null
+++ b/doc/doxygen/html/cdefs_8h-source.html
@@ -0,0 +1,49 @@
+
+
+Ubixos: cdefs.h Source File
+
+
+
+
cdefs.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _CDEFS_H
+00025 #define _CDRES_H
+00026
+00027 #include <ubixos/types.h>
+00028
+00029 #define __dead2 __attribute__((__noreturn__))
+00030
+00031
+00032 #endif
+00033
+00034 /***
+00035 END
+00036 ***/
+00037
+
Generated on Wed Apr 28 17:49:31 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/cdefs_8h.html b/doc/doxygen/html/cdefs_8h.html
new file mode 100644
index 0000000..fdd1dda
--- /dev/null
+++ b/doc/doxygen/html/cdefs_8h.html
@@ -0,0 +1,68 @@
+
+
+Ubixos: cdefs.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:25 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/cpu_8h-source.html b/doc/doxygen/html/cpu_8h-source.html
new file mode 100644
index 0000000..c169488
--- /dev/null
+++ b/doc/doxygen/html/cpu_8h-source.html
@@ -0,0 +1,54 @@
+
+
+Ubixos: cpu.h Source File
+
+
+
+
cpu.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035 #ifndef __ARCH_CPU_H__
+00036 #define __ARCH_CPU_H__
+00037
+00038 #ifndef BYTE_ORDER
+00039 #define BYTE_ORDER LITTLE_ENDIAN
+00040 #endif /* BYTE_ORDER */
+00041
+00042 #endif /* __ARCH_CPU_H__ */
+
Generated on Wed Apr 28 17:49:32 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/cpu_8h.html b/doc/doxygen/html/cpu_8h.html
new file mode 100644
index 0000000..9c1afc7
--- /dev/null
+++ b/doc/doxygen/html/cpu_8h.html
@@ -0,0 +1,43 @@
+
+
+Ubixos: cpu.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:19 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/debug_8h-source.html b/doc/doxygen/html/debug_8h-source.html
new file mode 100644
index 0000000..42ebb27
--- /dev/null
+++ b/doc/doxygen/html/debug_8h-source.html
@@ -0,0 +1,151 @@
+
+
+Ubixos: debug.h Source File
+
+
+
+
debug.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035 #ifndef __LWIP_DEBUG_H__
+00036 #define __LWIP_DEBUG_H__
+00037
+00038 #ifdef LWIP_DEBUG
+00039
+00040 #define ASSERT(x,y) if(!(y)) {printf("Assertion \"%s\" failed at line %d in %s\n", \
+00041 x, __LINE__, __FILE__); fflush(NULL); abort();}
+00042
+00043 /* These defines control the amount of debugging output: */
+00044 #define MEM_TRACKING
+00045
+00046 #define DEMO_DEBUG 1
+00047
+00048 #define ARP_DEBUG 0
+00049
+00050 #define NETIF_DEBUG 1
+00051 #define PBUF_DEBUG 0
+00052 #define DELIF_DEBUG 0
+00053 #define DROPIF_DEBUG 0
+00054 #define TUNIF_DEBUG 0
+00055 #define UNIXIF_DEBUG 0
+00056 #define TAPIF_DEBUG 0
+00057
+00058 #define API_LIB_DEBUG 0
+00059 #define API_MSG_DEBUG 0
+00060 #define SOCKETS_DEBUG 1
+00061 #define ICMP_DEBUG 0
+00062 #define INET_DEBUG 0
+00063 #define IP_DEBUG 0
+00064 #define IP_REASS_DEBUG 1
+00065 #define MEM_DEBUG 0
+00066 #define MEMP_DEBUG 0
+00067 #define SYS_DEBUG 0
+00068 #define TCP_DEBUG 0
+00069 #define TCP_INPUT_DEBUG 0
+00070 #define TCP_FR_DEBUG 0
+00071 #define TCP_RTO_DEBUG 0
+00072 #define TCP_REXMIT_DEBUG 0
+00073 #define TCP_CWND_DEBUG 0
+00074 #define TCP_WND_DEBUG 0
+00075 #define TCP_OUTPUT_DEBUG 0
+00076 #define TCP_RST_DEBUG 0
+00077 #define TCP_QLEN_DEBUG 0
+00078 #define UDP_DEBUG 0
+00079 #define TCPIP_DEBUG 0
+00080 #define TCPDUMP_DEBUG 0
+00081 #define DHCP_DEBUG 1
+00082
+00083 #include <stdio.h>
+00084 #define DEBUGF(debug, x) do { if(debug){ printf x; } } while(0)
+00085
+00086
+00087 #else /* LWIP_DEBUG */
+00088
+00089 /* DEBUG is not defined, so we define null macros for ASSERT and DEBUGF */
+00090
+00091 #define ASSERT(x,y)
+00092 #define DEBUGF(debug, x)
+00093
+00094 /* And we define those to be zero: */
+00095
+00096 #define DEMO_DEBUG 0
+00097 #define ARP_DEBUG 0
+00098 #define NETIF_DEBUG 0
+00099 #define PBUF_DEBUG 0
+00100 #define DELIF_DEBUG 0
+00101 #define DROPIF_DEBUG 0
+00102 #define TUNIF_DEBUG 0
+00103 #define UNIXIF_DEBUG 0
+00104 #define TAPIF_DEBUG 0
+00105 #define API_LIB_DEBUG 0
+00106 #define API_MSG_DEBUG 0
+00107 #define SOCKETS_DEBUG 0
+00108 #define ICMP_DEBUG 0
+00109 #define INET_DEBUG 0
+00110 #define IP_DEBUG 0
+00111 #define IP_REASS_DEBUG 0
+00112 #define MEM_DEBUG 0
+00113 #define MEMP_DEBUG 0
+00114 #define SYS_DEBUG 0
+00115 #define TCP_DEBUG 0
+00116 #define TCP_INPUT_DEBUG 0
+00117 #define TCP_FR_DEBUG 0
+00118 #define TCP_RTO_DEBUG 0
+00119 #define TCP_REXMIT_DEBUG 0
+00120 #define TCP_CWND_DEBUG 0
+00121 #define TCP_WND_DEBUG 0
+00122 #define TCP_OUTPUT_DEBUG 0
+00123 #define TCP_RST_DEBUG 0
+00124 #define TCP_QLEN_DEBUG 0
+00125 #define UDP_DEBUG 0
+00126 #define TCPIP_DEBUG 0
+00127 #define TCPDUMP_DEBUG 0
+00128 #define DHCP_DEBUG 0
+00129
+00130 #endif /* LWIP_DEBUG */
+00131
+00132
+00133 #endif /* __LWIP_DEBUG_H__ */
+00134
+00135
+00136
+00137
+00138
+00139
+
Generated on Wed Apr 28 17:49:32 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/debug_8h.html b/doc/doxygen/html/debug_8h.html
new file mode 100644
index 0000000..69765e3
--- /dev/null
+++ b/doc/doxygen/html/debug_8h.html
@@ -0,0 +1,875 @@
+
+
+Ubixos: debug.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:19 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/def_8h-source.html b/doc/doxygen/html/def_8h-source.html
new file mode 100644
index 0000000..178a10b
--- /dev/null
+++ b/doc/doxygen/html/def_8h-source.html
@@ -0,0 +1,59 @@
+
+
+Ubixos: def.h Source File
+
+
+
+
def.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035 #ifndef __LWIP_DEF_H__
+00036 #define __LWIP_DEF_H__
+00037
+00038 #define UMAX(a, b) ((a) > (b) ? (a) : (b))
+00039
+00040 #ifndef NULL
+00041 #define NULL ((void *)0)
+00042 #endif
+00043
+00044 #include "arch/lib.h"
+00045
+00046 #endif /* __LWIP_DEF_H__ */
+00047
+
Generated on Wed Apr 28 17:49:32 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/def_8h.html b/doc/doxygen/html/def_8h.html
new file mode 100644
index 0000000..b4dad4a
--- /dev/null
+++ b/doc/doxygen/html/def_8h.html
@@ -0,0 +1,76 @@
+
+
+Ubixos: def.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:19 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/devfs_8h-source.html b/doc/doxygen/html/devfs_8h-source.html
new file mode 100644
index 0000000..2f3b740
--- /dev/null
+++ b/doc/doxygen/html/devfs_8h-source.html
@@ -0,0 +1,62 @@
+
+
+Ubixos: devfs.h Source File
+
+
+
+
devfs.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The DevOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the DevOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _DEVFS_H
+00025 #define _DEVFS_H
+00026
+00027 #include <ubixos/types.h>
+00028 #include <vfs/file.h>
+00029
+00030 struct devFsDevices {
+00031 struct devFsDevices *next;
+00032 struct devFsDevices *prev;
+00033 uInt8 devType;
+00034 uInt16 devMajor;
+00035 uInt16 devMinor;
+00036 char devName[32];
+00037 };
+00038
+00039 struct devFsInfo {
+00040 struct devFsDevices *deviceList;
+00041 };
+00042
+00043 int devFSOpen(char *file,fileDescriptor *fd);
+00044 void devFSInit(struct mountPoints *mp);
+00045 int devFSEnable();
+00046 int devFSRead(fileDescriptor *fd,char *data,long offset,long size);
+00047 int devFSWrite(fileDescriptor *fd,char *data,long offset,long size);
+00048 int devFsMkNod(char *name,uInt8 type,uInt16 major,uInt16 minor);
+00049
+00050 #endif
+
Generated on Wed Apr 28 17:49:32 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/devfs_8h.html b/doc/doxygen/html/devfs_8h.html
new file mode 100644
index 0000000..75f476a
--- /dev/null
+++ b/doc/doxygen/html/devfs_8h.html
@@ -0,0 +1,283 @@
+
+
+Ubixos: devfs.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:19 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/device_8h-source.html b/doc/doxygen/html/device_8h-source.html
new file mode 100644
index 0000000..5bfe312
--- /dev/null
+++ b/doc/doxygen/html/device_8h-source.html
@@ -0,0 +1,68 @@
+
+
+Ubixos: device.h Source File
+
+
+
+
device.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _DEVICE_H
+00025 #define _DEVICE_H
+00026
+00027 #include <ubixos/types.h>
+00028
+00029 struct deviceNode {
+00030 struct deviceNode *prev;
+00031 struct deviceNode *next;
+00032 char type;
+00033 int major;
+00034 int minor;
+00035 uInt32 size;
+00036 void *info;
+00037 void (*read)(void *,void *,uInt32,uInt32);
+00038 void (*write)(void *,void *,uInt32,uInt32);
+00039 void (*reset)(void *);
+00040 void (*init)(void *);
+00041 void (*ioctl)(void *);
+00042 void (*stop)(void *);
+00043 void (*start)(void *);
+00044 void (*standby)(void *);
+00045 };
+00046
+00047
+00048 void deviceAdd(int major,int minor,char type,void *read,void *write,void *reset,void *init,void *ioctl,void *stop,void *start,void *standby,void *info);
+00049 struct deviceNode *deviceFind(int major,int minor);
+00050
+00051 #endif
+00052
+00053 /***
+00054 END
+00055 ***/
+00056
+
Generated on Wed Apr 28 17:49:32 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/device_8h.html b/doc/doxygen/html/device_8h.html
new file mode 100644
index 0000000..e53427e
--- /dev/null
+++ b/doc/doxygen/html/device_8h.html
@@ -0,0 +1,163 @@
+
+
+Ubixos: device.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:19 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/device_8old_8h-source.html b/doc/doxygen/html/device_8old_8h-source.html
new file mode 100644
index 0000000..3d0438e
--- /dev/null
+++ b/doc/doxygen/html/device_8old_8h-source.html
@@ -0,0 +1,70 @@
+
+
+Ubixos: device.old.h Source File
+
+
+
+
device.old.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _DEVICE_H
+00025 #define _DEVICE_H
+00026
+00027 #include <ubixos/types.h>
+00028
+00029 struct device {
+00030 struct net *net;
+00031 uInt16 ioAddr;
+00032 uInt32 irq;
+00033 struct ei_device *priv;
+00034 uInt32 mtu;
+00035 };
+00036
+00037 struct net {
+00038 char mac[6];
+00039 char broadcast[6];
+00040 };
+00041
+00042 struct ei_device {
+00043 int txStartPage;
+00044 int rxStartPage;
+00045 int stopPage;
+00046 int currentPage;
+00047 uInt16 word16;
+00048 uInt32 pingPong;
+00049 int tx1;
+00050 int tx2;
+00051 };
+00052
+00053 #endif
+00054
+00055 /***
+00056 END
+00057 ***/
+00058
+
Generated on Wed Apr 28 17:49:32 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/device_8old_8h.html b/doc/doxygen/html/device_8old_8h.html
new file mode 100644
index 0000000..ce321ee
--- /dev/null
+++ b/doc/doxygen/html/device_8old_8h.html
@@ -0,0 +1,25 @@
+
+
+Ubixos: device.old.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:19 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/disklabel_8h-source.html b/doc/doxygen/html/disklabel_8h-source.html
new file mode 100644
index 0000000..8754933
--- /dev/null
+++ b/doc/doxygen/html/disklabel_8h-source.html
@@ -0,0 +1,501 @@
+
+
+Ubixos: disklabel.h Source File
+
+
+
+
disklabel.h
00001 /*
+00002 * Copyright (c) 1987, 1988, 1993
+00003 * The Regents of the University of California. All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. All advertising materials mentioning features or use of this software
+00014 * must display the following acknowledgement:
+00015 * This product includes software developed by the University of
+00016 * California, Berkeley and its contributors.
+00017 * 4. Neither the name of the University nor the names of its contributors
+00018 * may be used to endorse or promote products derived from this software
+00019 * without specific prior written permission.
+00020 *
+00021 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+00022 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00023 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00024 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+00025 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00026 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00027 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00028 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00029 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00030 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00031 * SUCH DAMAGE.
+00032 *
+00033 * @(#)disklabel.h 8.2 (Berkeley) 7/10/94
+00034 * $FreeBSD: src/sys/sys/disklabel.h,v 1.49.2.7 2001/05/27 05:58:26 jkh Exp $
+00035 */
+00036
+00037 #ifndef _SYS_DISKLABEL_H_
+00038 #define _SYS_DISKLABEL_H_
+00039
+00040 #ifndef _KERNEL
+00041 #include <sys/types.h>
+00042 #endif
+00043 #include <sys/ioccom.h>
+00044
+00045 /*
+00046 * Disk description table, see disktab(5)
+00047 */
+00048 #define _PATH_DISKTAB "/etc/disktab"
+00049 #define DISKTAB "/etc/disktab" /* deprecated */
+00050
+00051 /*
+00052 * Each disk has a label which includes information about the hardware
+00053 * disk geometry, filesystem partitions, and drive specific information.
+00054 * The label is in block 0 or 1, possibly offset from the beginning
+00055 * to leave room for a bootstrap, etc.
+00056 */
+00057
+00058 /* XXX these should be defined per controller (or drive) elsewhere, not here! */
+00059 #ifdef __i386__
+00060 #define LABELSECTOR 1 /* sector containing label */
+00061 #define LABELOFFSET 0 /* offset of label in sector */
+00062 #endif
+00063
+00064 #ifdef __alpha__
+00065 #define LABELSECTOR 0
+00066 #define LABELOFFSET 64
+00067 #endif
+00068
+00069 #ifndef LABELSECTOR
+00070 #define LABELSECTOR 0 /* sector containing label */
+00071 #endif
+00072
+00073 #ifndef LABELOFFSET
+00074 #define LABELOFFSET 64 /* offset of label in sector */
+00075 #endif
+00076
+00077 #define DISKMAGIC ((u_int32_t)0x82564557) /* The disk magic number */
+00078 #ifndef MAXPARTITIONS
+00079 #define MAXPARTITIONS 8
+00080 #endif
+00081
+00082 #define LABEL_PART 2 /* partition containing label */
+00083 #define RAW_PART 2 /* partition containing whole disk */
+00084 #define SWAP_PART 1 /* partition normally containing swap */
+00085
+00086 #ifndef LOCORE
+00087 struct disklabel {
+00088 u_int32_t d_magic; /* the magic number */
+00089 u_int16_t d_type; /* drive type */
+00090 u_int16_t d_subtype; /* controller/d_type specific */
+00091 char d_typename[16]; /* type name, e.g. "eagle" */
+00092
+00093 /*
+00094 * d_packname contains the pack identifier and is returned when
+00095 * the disklabel is read off the disk or in-core copy.
+00096 * d_boot0 and d_boot1 are the (optional) names of the
+00097 * primary (block 0) and secondary (block 1-15) bootstraps
+00098 * as found in /boot. These are returned when using
+00099 * getdiskbyname(3) to retrieve the values from /etc/disktab.
+00100 */
+00101 union {
+00102 char un_d_packname[16]; /* pack identifier */
+00103 struct {
+00104 char *un_d_boot0; /* primary bootstrap name */
+00105 char *un_d_boot1; /* secondary bootstrap name */
+00106 } un_b;
+00107 } d_un;
+00108 #define d_packname d_un.un_d_packname
+00109 #define d_boot0 d_un.un_b.un_d_boot0
+00110 #define d_boot1 d_un.un_b.un_d_boot1
+00111
+00112 /* disk geometry: */
+00113 u_int32_t d_secsize; /* # of bytes per sector */
+00114 u_int32_t d_nsectors; /* # of data sectors per track */
+00115 u_int32_t d_ntracks; /* # of tracks per cylinder */
+00116 u_int32_t d_ncylinders; /* # of data cylinders per unit */
+00117 u_int32_t d_secpercyl; /* # of data sectors per cylinder */
+00118 u_int32_t d_secperunit; /* # of data sectors per unit */
+00119
+00120 /*
+00121 * Spares (bad sector replacements) below are not counted in
+00122 * d_nsectors or d_secpercyl. Spare sectors are assumed to
+00123 * be physical sectors which occupy space at the end of each
+00124 * track and/or cylinder.
+00125 */
+00126 u_int16_t d_sparespertrack; /* # of spare sectors per track */
+00127 u_int16_t d_sparespercyl; /* # of spare sectors per cylinder */
+00128 /*
+00129 * Alternate cylinders include maintenance, replacement, configuration
+00130 * description areas, etc.
+00131 */
+00132 u_int32_t d_acylinders; /* # of alt. cylinders per unit */
+00133
+00134 /* hardware characteristics: */
+00135 /*
+00136 * d_interleave, d_trackskew and d_cylskew describe perturbations
+00137 * in the media format used to compensate for a slow controller.
+00138 * Interleave is physical sector interleave, set up by the
+00139 * formatter or controller when formatting. When interleaving is
+00140 * in use, logically adjacent sectors are not physically
+00141 * contiguous, but instead are separated by some number of
+00142 * sectors. It is specified as the ratio of physical sectors
+00143 * traversed per logical sector. Thus an interleave of 1:1
+00144 * implies contiguous layout, while 2:1 implies that logical
+00145 * sector 0 is separated by one sector from logical sector 1.
+00146 * d_trackskew is the offset of sector 0 on track N relative to
+00147 * sector 0 on track N-1 on the same cylinder. Finally, d_cylskew
+00148 * is the offset of sector 0 on cylinder N relative to sector 0
+00149 * on cylinder N-1.
+00150 */
+00151 u_int16_t d_rpm; /* rotational speed */
+00152 u_int16_t d_interleave; /* hardware sector interleave */
+00153 u_int16_t d_trackskew; /* sector 0 skew, per track */
+00154 u_int16_t d_cylskew; /* sector 0 skew, per cylinder */
+00155 u_int32_t d_headswitch; /* head switch time, usec */
+00156 u_int32_t d_trkseek; /* track-to-track seek, usec */
+00157 u_int32_t d_flags; /* generic flags */
+00158 #define NDDATA 5
+00159 u_int32_t d_drivedata[NDDATA]; /* drive-type specific information */
+00160 #define NSPARE 5
+00161 u_int32_t d_spare[NSPARE]; /* reserved for future use */
+00162 u_int32_t d_magic2; /* the magic number (again) */
+00163 u_int16_t d_checksum; /* xor of data incl. partitions */
+00164
+00165 /* filesystem and partition information: */
+00166 u_int16_t d_npartitions; /* number of partitions in following */
+00167 u_int32_t d_bbsize; /* size of boot area at sn0, bytes */
+00168 u_int32_t d_sbsize; /* max size of fs superblock, bytes */
+00169 struct partition { /* the partition table */
+00170 u_int32_t p_size; /* number of sectors in partition */
+00171 u_int32_t p_offset; /* starting sector */
+00172 u_int32_t p_fsize; /* filesystem basic fragment size */
+00173 u_int8_t p_fstype; /* filesystem type, see below */
+00174 u_int8_t p_frag; /* filesystem fragments per block */
+00175 union {
+00176 u_int16_t cpg; /* UFS: FS cylinders per group */
+00177 u_int16_t sgs; /* LFS: FS segment shift */
+00178 } __partition_u1;
+00179 #define p_cpg __partition_u1.cpg
+00180 #define p_sgs __partition_u1.sgs
+00181 } d_partitions[MAXPARTITIONS]; /* actually may be more */
+00182 };
+00183
+00184 static u_int16_t dkcksum(struct disklabel *lp);
+00185
+00186 static __inline u_int16_t
+00187 dkcksum(struct disklabel *lp)
+00188 {
+00189 u_int16_t *start, *end;
+00190 u_int16_t sum = 0;
+00191
+00192 start = (u_int16_t *)lp;
+00193 end = (u_int16_t *)&lp->d_partitions[lp->d_npartitions];
+00194 while (start < end)
+00195 sum ^= *start++;
+00196 return (sum);
+00197 }
+00198
+00199 #else /* LOCORE */
+00200 /*
+00201 * offsets for asm boot files.
+00202 */
+00203 .set d_secsize,40
+00204 .set d_nsectors,44
+00205 .set d_ntracks,48
+00206 .set d_ncylinders,52
+00207 .set d_secpercyl,56
+00208 .set d_secperunit,60
+00209 .set d_end_,276 /* size of disk label */
+00210 #endif /* LOCORE */
+00211
+00212 /* d_type values: */
+00213 #define DTYPE_SMD 1 /* SMD, XSMD; VAX hp/up */
+00214 #define DTYPE_MSCP 2 /* MSCP */
+00215 #define DTYPE_DEC 3 /* other DEC (rk, rl) */
+00216 #define DTYPE_SCSI 4 /* SCSI */
+00217 #define DTYPE_ESDI 5 /* ESDI interface */
+00218 #define DTYPE_ST506 6 /* ST506 etc. */
+00219 #define DTYPE_HPIB 7 /* CS/80 on HP-IB */
+00220 #define DTYPE_HPFL 8 /* HP Fiber-link */
+00221 #define DTYPE_FLOPPY 10 /* floppy */
+00222 #define DTYPE_CCD 11 /* concatenated disk */
+00223 #define DTYPE_VINUM 12 /* vinum volume */
+00224 #define DTYPE_DOC2K 13 /* Msys DiskOnChip */
+00225
+00226 #if defined(PC98) && !defined(PC98_ATCOMPAT)
+00227 #define DSTYPE_SEC256 0x80 /* physical sector size=256 */
+00228 #endif
+00229
+00230 #ifdef DKTYPENAMES
+00231 staticchar *dktypenames[] = {
+00232 "unknown",
+00233 "SMD",
+00234 "MSCP",
+00235 "old DEC",
+00236 "SCSI",
+00237 "ESDI",
+00238 "ST506",
+00239 "HP-IB",
+00240 "HP-FL",
+00241 "type 9",
+00242 "floppy",
+00243 "CCD",
+00244 "Vinum",
+00245 "DOC2K",
+00246 NULL
+00247 };
+00248 #define DKMAXTYPES (sizeof(dktypenames) / sizeof(dktypenames[0]) - 1)
+00249 #endif
+00250
+00251 /*
+00252 * Filesystem type and version.
+00253 * Used to interpret other filesystem-specific
+00254 * per-partition information.
+00255 */
+00256 #define FS_UNUSED 0 /* unused */
+00257 #define FS_SWAP 1 /* swap */
+00258 #define FS_V6 2 /* Sixth Edition */
+00259 #define FS_V7 3 /* Seventh Edition */
+00260 #define FS_SYSV 4 /* System V */
+00261 #define FS_V71K 5 /* V7 with 1K blocks (4.1, 2.9) */
+00262 #define FS_V8 6 /* Eighth Edition, 4K blocks */
+00263 #define FS_BSDFFS 7 /* 4.2BSD fast file system */
+00264 #define FS_MSDOS 8 /* MSDOS file system */
+00265 #define FS_BSDLFS 9 /* 4.4BSD log-structured file system */
+00266 #define FS_OTHER 10 /* in use, but unknown/unsupported */
+00267 #define FS_HPFS 11 /* OS/2 high-performance file system */
+00268 #define FS_ISO9660 12 /* ISO 9660, normally CD-ROM */
+00269 #define FS_BOOT 13 /* partition contains bootstrap */
+00270 #define FS_VINUM 14 /* Vinum drive */
+00271
+00272 #ifdef DKTYPENAMES
+00273 staticchar *fstypenames[] = {
+00274 "unused",
+00275 "swap",
+00276 "Version 6",
+00277 "Version 7",
+00278 "System V",
+00279 "4.1BSD",
+00280 "Eighth Edition",
+00281 "4.2BSD",
+00282 "MSDOS",
+00283 "4.4LFS",
+00284 "unknown",
+00285 "HPFS",
+00286 "ISO9660",
+00287 "boot",
+00288 "vinum",
+00289 NULL
+00290 };
+00291 #define FSMAXTYPES (sizeof(fstypenames) / sizeof(fstypenames[0]) - 1)
+00292 #endif
+00293
+00294 /*
+00295 * flags shared by various drives:
+00296 */
+00297 #define D_REMOVABLE 0x01 /* removable media */
+00298 #define D_ECC 0x02 /* supports ECC */
+00299 #define D_BADSECT 0x04 /* supports bad sector forw. */
+00300 #define D_RAMDISK 0x08 /* disk emulator */
+00301 #define D_CHAIN 0x10 /* can do back-back transfers */
+00302
+00303 /*
+00304 * Drive data for SMD.
+00305 */
+00306 #define d_smdflags d_drivedata[0]
+00307 #define D_SSE 0x1 /* supports skip sectoring */
+00308 #define d_mindist d_drivedata[1]
+00309 #define d_maxdist d_drivedata[2]
+00310 #define d_sdist d_drivedata[3]
+00311
+00312 /*
+00313 * Drive data for ST506.
+00314 */
+00315 #define d_precompcyl d_drivedata[0]
+00316 #define d_gap3 d_drivedata[1] /* used only when formatting */
+00317
+00318 /*
+00319 * Drive data for SCSI.
+00320 */
+00321 #define d_blind d_drivedata[0]
+00322
+00323 #ifndef LOCORE
+00324 /*
+00325 * Structure used to perform a format or other raw operation, returning
+00326 * data and/or register values. Register identification and format
+00327 * are device- and driver-dependent.
+00328 */
+00329 struct format_op {
+00330 char *df_buf;
+00331 int df_count; /* value-result */
+00332 daddr_t df_startblk;
+00333 int df_reg[8]; /* result */
+00334 };
+00335
+00336 /*
+00337 * Structure used internally to retrieve information about a partition
+00338 * on a disk.
+00339 */
+00340 struct partinfo {
+00341 struct disklabel *disklab;
+00342 struct partition *part;
+00343 };
+00344
+00345 /* DOS partition table -- located in boot block */
+00346
+00347 #if defined(PC98) && !defined(PC98_ATCOMPAT)
+00348 #define DOSBBSECTOR 0 /* DOS boot block relative sector number */
+00349 #define DOSLABELSECTOR 1 /* 0: 256b/s, 1: 512b/s */
+00350 #define DOSPARTOFF 0
+00351 #define NDOSPART 16
+00352 #define DOSPTYP_386BSD 0x94 /* 386BSD partition type */
+00353 #define MBR_PTYPE_FreeBSD 0x94 /* FreeBSD partition type */
+00354
+00355 struct dos_partition {
+00356 unsignedchar dp_mid;
+00357 #define DOSMID_386BSD (0x14|0x80) /* 386bsd|bootable */
+00358 unsignedchar dp_sid;
+00359 #define DOSSID_386BSD (0x44|0x80) /* 386bsd|active */
+00360 unsignedchar dp_dum1;
+00361 unsignedchar dp_dum2;
+00362 unsignedchar dp_ipl_sct;
+00363 unsignedchar dp_ipl_head;
+00364 unsignedshort dp_ipl_cyl;
+00365 unsignedchar dp_ssect; /* starting sector */
+00366 unsignedchar dp_shd; /* starting head */
+00367 unsignedshort dp_scyl; /* starting cylinder */
+00368 unsignedchar dp_esect; /* end sector */
+00369 unsignedchar dp_ehd; /* end head */
+00370 unsignedshort dp_ecyl; /* end cylinder */
+00371 unsignedchar dp_name[16];
+00372 };
+00373
+00374 #else /* IBMPC */
+00375 #define DOSBBSECTOR 0 /* DOS boot block relative sector number */
+00376 #define DOSPARTOFF 446
+00377 #define NDOSPART 4
+00378 #define DOSPTYP_386BSD 0xa5 /* 386BSD partition type */
+00379 #define DOSPTYP_LINSWP 0x82 /* Linux swap partition */
+00380 #define DOSPTYP_LINUX 0x83 /* Linux partition */
+00381 #define DOSPTYP_EXT 5 /* DOS extended partition */
+00382
+00383 struct dos_partition {
+00384 unsignedchar dp_flag; /* bootstrap flags */
+00385 unsignedchar dp_shd; /* starting head */
+00386 unsignedchar dp_ssect; /* starting sector */
+00387 unsignedchar dp_scyl; /* starting cylinder */
+00388 unsignedchar dp_typ; /* partition type */
+00389 unsignedchar dp_ehd; /* end head */
+00390 unsignedchar dp_esect; /* end sector */
+00391 unsignedchar dp_ecyl; /* end cylinder */
+00392 u_int32_t dp_start; /* absolute starting sector number */
+00393 u_int32_t dp_size; /* partition size in sectors */
+00394 };
+00395 #endif
+00396
+00397 #define DPSECT(s) ((s) & 0x3f) /* isolate relevant bits of sector */
+00398 #define DPCYL(c, s) ((c) + (((s) & 0xc0)<<2)) /* and those that are cylinder */
+00399
+00400 /*
+00401 * Disk-specific ioctls.
+00402 */
+00403 /* get and set disklabel; DIOCGPART used internally */
+00404 #define DIOCGDINFO _IOR('d', 101, struct disklabel)/* get */
+00405 #define DIOCSDINFO _IOW('d', 102, struct disklabel)/* set */
+00406 #define DIOCWDINFO _IOW('d', 103, struct disklabel)/* set, update disk */
+00407 #define DIOCGPART _IOW('d', 104, struct partinfo) /* get partition */
+00408 #define DIOCGDVIRGIN _IOR('d', 105, struct disklabel) /* get virgin label */
+00409
+00410 #define DIOCWLABEL _IOW('d', 109, int) /* write en/disable label */
+00411
+00412 #ifdef _KERNEL
+00413
+00414 /*
+00415 * XXX encoding of disk minor numbers, should be elsewhere.
+00416 *
+00417 * See <sys/reboot.h> for a possibly better encoding.
+00418 *
+00419 * "cpio -H newc" can be used to back up device files with large minor
+00420 * numbers (but not ones >= 2^31). Old cpio formats and all tar formats
+00421 * don't have enough bits, and cpio and tar don't notice the lossage.
+00422 * There are also some sign extension bugs.
+00423 */
+00424
+00425 /*
+00426 3 2 1 0
+00427 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
+00428 _________________________________________________________________
+00429 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+00430 -----------------------------------------------------------------
+00431 | TYPE |UNIT_2 | SLICE | MAJOR? | UNIT |PART |
+00432 -----------------------------------------------------------------
+00433 */
+00434
+00435 #define DKMAXUNIT 0x1ff /* Highest disk unit number */
+00436
+00437 #define dkmakeminor(unit, slice, part) \
+00438 (((slice) << 16) | (((unit) & 0x1e0) << 16) | \
+00439 (((unit) & 0x1f) << 3) | (part))
+00440 static __inline dev_t
+00441 dkmodpart(dev_t dev, int part)
+00442 {
+00443 return (makedev(major(dev), (minor(dev) & ~7) | part));
+00444 }
+00445
+00446 static __inline dev_t
+00447 dkmodslice(dev_t dev, int slice)
+00448 {
+00449 return (makedev(major(dev), (minor(dev) & ~0x1f0000) | (slice << 16)));
+00450 }
+00451
+00452 #define dkpart(dev) (minor(dev) & 7)
+00453 #define dkslice(dev) ((minor(dev) >> 16) & 0x1f)
+00454 #define dktype(dev) ((minor(dev) >> 25) & 0x7f)
+00455
+00456 static __inline u_int
+00457 dkunit(dev_t dev)
+00458 {
+00459 return (((minor(dev) >> 16) & 0x1e0) | ((minor(dev) >> 3) & 0x1f));
+00460 }
+00461
+00462 struct buf;
+00463 struct buf_queue_head;
+00464
+00465 int bounds_check_with_label __P((struct buf *bp, struct disklabel *lp,
+00466 int wlabel));
+00467 void diskerr __P((struct buf *bp, char *what, int pri, int blkdone,
+00468 struct disklabel *lp));
+00469 void disksort __P((struct buf *ap, struct buf *bp));
+00470 char *readdisklabel __P((dev_t dev, struct disklabel *lp));
+00471 void bufqdisksort __P((struct buf_queue_head *ap, struct buf *bp));
+00472 int setdisklabel __P((struct disklabel *olp, struct disklabel *nlp,
+00473 u_long openmask));
+00474 int writedisklabel __P((dev_t dev, struct disklabel *lp));
+00475 #ifdef __alpha__
+00476 void alpha_fix_srm_checksum __P((struct buf *bp));
+00477 #endif
+00478
+00479 #endif /* _KERNEL */
+00480
+00481 #endif /* LOCORE */
+00482
+00483 #ifndef _KERNEL
+00484 __BEGIN_DECLS
+00485 struct disklabel *getdiskbyname __P((constchar *));
+00486 __END_DECLS
+00487 #endif
+00488
+00489 #endif /* !_SYS_DISKLABEL_H_ */
+
Generated on Wed Apr 28 17:49:33 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/diskslice_8h-source.html b/doc/doxygen/html/diskslice_8h-source.html
new file mode 100644
index 0000000..af4adaa
--- /dev/null
+++ b/doc/doxygen/html/diskslice_8h-source.html
@@ -0,0 +1,119 @@
+
+
+Ubixos: diskslice.h Source File
+
+
+
+
diskslice.h
00001 /*-
+00002 * Copyright (c) 1994 Bruce D. Evans.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 *
+00014 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+00015 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00016 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00017 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+00018 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00019 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00020 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00021 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00022 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00023 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00024 * SUCH DAMAGE.
+00025 *
+00026 * $FreeBSD: src/sys/sys/diskslice.h,v 1.36.2.1 2001/01/29 01:50:50 ken Exp $
+00027 */
+00028
+00029 #ifndef _SYS_DISKSLICE_H_
+00030 #define _SYS_DISKSLICE_H_
+00031
+00032 #ifndef _KERNEL
+00033 #include <sys/types.h>
+00034 #endif
+00035 #include <sys/ioccom.h>
+00036
+00037 #define BASE_SLICE 2
+00038 #define COMPATIBILITY_SLICE 0
+00039 #define DIOCGSLICEINFO _IOR('d', 111, struct diskslices)
+00040 #define DIOCSYNCSLICEINFO _IOW('d', 112, int)
+00041 #define MAX_SLICES 32
+00042 #define WHOLE_DISK_SLICE 1
+00043
+00044 struct diskslice {
+00045 u_long ds_offset; /* starting sector */
+00046 u_long ds_size; /* number of sectors */
+00047 int ds_type; /* (foreign) slice type */
+00048 #ifdef PC98
+00049 int ds_subtype; /* sub slice type */
+00050 u_char ds_name[16]; /* slice name */
+00051 #endif
+00052 struct disklabel *ds_label; /* BSD label, if any */
+00053 void *ds_dev; /* devfs token for raw whole slice */
+00054 #ifdef MAXPARTITIONS /* XXX don't depend on disklabel.h */
+00055 #if MAXPARTITIONS != 8 /* but check consistency if possible */
+00056 #error "inconsistent MAXPARTITIONS"
+00057 #endif
+00058 #else
+00059 #define MAXPARTITIONS 8
+00060 #endif
+00061 void *ds_devs[MAXPARTITIONS]; /* XXX s.b. in label */
+00062 u_char ds_openmask; /* devs open */
+00063 u_char ds_wlabel; /* nonzero if label is writable */
+00064 };
+00065
+00066 struct diskslices {
+00067 struct cdevsw *dss_cdevsw; /* for containing device */
+00068 int dss_first_bsd_slice; /* COMPATIBILITY_SLICE is mapped here */
+00069 u_int dss_nslices; /* actual dimension of dss_slices[] */
+00070 u_int dss_oflags; /* copy of flags for "first" open */
+00071 int dss_secmult; /* block to sector multiplier */
+00072 int dss_secshift; /* block to sector shift (or -1) */
+00073 int dss_secsize; /* sector size */
+00074 struct diskslice
+00075 dss_slices[MAX_SLICES]; /* actually usually less */
+00076 };
+00077
+00078 #ifdef _KERNEL
+00079
+00080 /* Flags for dsopen(). */
+00081 #define DSO_NOLABELS 1
+00082 #define DSO_ONESLICE 2
+00083 #define DSO_COMPATLABEL 4
+00084
+00085 #define dsgetlabel(dev, ssp) (ssp->dss_slices[dkslice(dev)].ds_label)
+00086
+00087 struct buf;
+00088 struct disklabel;
+00089
+00090 int dscheck __P((struct buf *bp, struct diskslices *ssp));
+00091 void dsclose __P((dev_t dev, int mode, struct diskslices *ssp));
+00092 void dsgone __P((struct diskslices **sspp));
+00093 int dsinit __P((dev_t dev, struct disklabel *lp,
+00094 struct diskslices **sspp));
+00095 int dsioctl __P((dev_t dev, u_long cmd, caddr_t data,
+00096 int flags, struct diskslices **sspp));
+00097 int dsisopen __P((struct diskslices *ssp));
+00098 struct diskslices *dsmakeslicestruct __P((int nslices, struct disklabel *lp));
+00099 char *dsname __P((dev_t dev, int unit, int slice, int part,
+00100 char *partname));
+00101 int dsopen __P((dev_t dev, int mode, u_int flags,
+00102 struct diskslices **sspp, struct disklabel *lp));
+00103 int dssize __P((dev_t dev, struct diskslices **sspp));
+00104
+00105 #endif /* _KERNEL */
+00106
+00107 #endif /* !_SYS_DISKSLICE_H_ */
+
Generated on Wed Apr 28 17:49:33 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/dma_8h-source.html b/doc/doxygen/html/dma_8h-source.html
new file mode 100644
index 0000000..8064903
--- /dev/null
+++ b/doc/doxygen/html/dma_8h-source.html
@@ -0,0 +1,45 @@
+
+
+Ubixos: dma.h Source File
+
+
+
+
dma.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _DMA_H
+00025 #define _DMA_H
+00026
+00027 #include <ubixos/types.h>
+00028
+00029 void dmaXfer(uChar channel,uLong address,uInt length,uChar read);
+00030 void _dmaXfer(uChar dmaChannel,uChar page,uInt offset,uInt length,uChar mode);
+00031
+00032 #endif
+00033
+
Generated on Wed Apr 28 17:49:33 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/dma_8h.html b/doc/doxygen/html/dma_8h.html
new file mode 100644
index 0000000..24a593a
--- /dev/null
+++ b/doc/doxygen/html/dma_8h.html
@@ -0,0 +1,130 @@
+
+
+Ubixos: dma.h File Reference
+
+
+
+
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _DRIVER_H
+00025 #define _DRIVER_H
+00026
+00027 #include <ubixos/types.h>
+00028
+00029
+00030 typedefstruct devMethodType devMethod;
+00031
+00032 struct devMethodType {
+00033 };
+00034
+00035 struct driverType {
+00036 constchar *devName;
+00037 devMethod *methods;
+00038 }
+00039
+00040
+00041
+00042
+00043 #endif
+00044
+00045 /***
+00046 END
+00047 ***/
+00048
+
Generated on Wed Apr 28 17:49:33 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/driver_8h.html b/doc/doxygen/html/driver_8h.html
new file mode 100644
index 0000000..b7dfa8a
--- /dev/null
+++ b/doc/doxygen/html/driver_8h.html
@@ -0,0 +1,49 @@
+
+
+Ubixos: driver.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:19 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/elf_8h-source.html b/doc/doxygen/html/elf_8h-source.html
new file mode 100644
index 0000000..b08108d
--- /dev/null
+++ b/doc/doxygen/html/elf_8h-source.html
@@ -0,0 +1,139 @@
+
+
+Ubixos: elf.h Source File
+
+
+
+
elf.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _ELF_H
+00025 #define _ELF_H
+00026
+00027 #include <ubixos/types.h>
+00028
+00029 #define elfExecutable 0x002
+00030 #define elfLibrary 0x003
+00031
+00032
+00033 /* Elf Types */
+00034 #define ET_NONE 0 // No file type
+00035 #define ET_REL 1 // Relocatable file
+00036 #define ET_EXEC 2 // Executable file
+00037 #define ET_DYN 3 // Shared object file
+00038 #define ET_CORE 4 // Core file
+00039 #define ET_LOPROC 0xff00 // Processor-specific
+00040 #define ET_HIPROC 0xffff
+00041 /* End Elf Types */
+00042
+00043 /* Elf Machine Types */
+00044 #define EM_NONE 0 // No machine
+00045 #define EM_M32 1 // AT&T WE 32100
+00046 #define EM_SPARC 2 // SPARC
+00047 #define EM_386 3 // Intel 80386
+00048 #define EM_68K 4 // Motorola 68000
+00049 #define EM_88K 5 // Motorola 88000
+00050 #define EM_860 7 // Intel 80860
+00051 #define EM_MIPS 8 // MIPS RS3000
+00052 /* End Elf Machines Types */
+00053
+00054 /* Elf Version */
+00055 #define EV_NONE 0 // Invalid version
+00056 #define EV_CURRENT 1 // Current version
+00057 /* End Elf Version */
+00058
+00059 /* Elf Program Header Types */
+00060 #define PT_NULL 0
+00061 #define PT_LOAD 1
+00062 #define PT_DYNAMIC 2
+00063 /* End Elf Program Header Types */
+00064
+00065 typedefstruct {
+00066 uChar eIdent[16]; /* File identification. */
+00067 uShort eType; /* File type. */
+00068 uShort eMachine; /* Machine architecture. */
+00069 uLong eVersion; /* ELF format version. */
+00070 uLong eEntry; /* Entry point. */
+00071 uLong ePhoff; /* Program header file offset. */
+00072 uLong eShoff; /* Section header file offset. */
+00073 uLong eFlags; /* Architecture-specific flags. */
+00074 uShort eEhsize; /* Size of ELF header in bytes. */
+00075 uShort ePhentsize; /* Size of program header entry. */
+00076 uShort ePhnum; /* Number of program header entries. */
+00077 uShort eShentsize; /* Size of section header entry. */
+00078 uShort eShnum; /* Number of section header entries. */
+00079 uShort eShstrndx; /* Section name strings section. */
+00080 } elfHeader;
+00081
+00082 typedefstruct {
+00083 uLong phType; /* Entry type. */
+00084 uLong phOffset; /* File offset of contents. */
+00085 uLong phVaddr; /* Virtual address in memory image. */
+00086 uLong phPaddr; /* Physical address (not used). */
+00087 uLong phFilesz; /* Size of contents in file. */
+00088 uLong phMemsz; /* Size of contents in memory. */
+00089 uLong phFlags; /* Access permission flags. */
+00090 uLong phAlign; /* Alignment in memory and file. */
+00091 } elfProgramheader;
+00092
+00093 typedefstruct {
+00094 uLong shName; /* Section name (index into the section header string table). */
+00095 uLong shType; /* Section type. */
+00096 uLong shFlags; /* Section flags. */
+00097 uLong shAddr; /* Address in memory image. */
+00098 uLong shOffset; /* Offset in file. */
+00099 uLong shSize; /* Size in bytes. */
+00100 uLong shLink; /* Index of a related section. */
+00101 uLong shInfo; /* Depends on section type. */
+00102 uLong shAddralign; /* Alignment in bytes. */
+00103 uLong shEntsize; /* Size of each entry in section. */
+00104 } elfSectionheader;
+00105
+00106 typedefstruct {
+00107 uLong pltOffset;
+00108 uLong pltInfo;
+00109 } elfPltInfo;
+00110
+00111 typedefstruct {
+00112 uLong dynName;
+00113 uLong dynValue;
+00114 uLong dynSize;
+00115 uLong dynInfo;
+00116 } elfDynsym;
+00117
+00118 typedefstruct {
+00119 uInt32 dynVal;
+00120 uInt32 dynPtr;
+00121 } elfDynamic;
+00122
+00123 char *elfGetShType(int);
+00124 char *elfGetPhType(int);
+00125
+00126 #endif
+00127
+
Generated on Wed Apr 28 17:49:33 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/elf_8h.html b/doc/doxygen/html/elf_8h.html
new file mode 100644
index 0000000..abab82a
--- /dev/null
+++ b/doc/doxygen/html/elf_8h.html
@@ -0,0 +1,673 @@
+
+
+Ubixos: elf.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:19 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/err_8h-source.html b/doc/doxygen/html/err_8h-source.html
new file mode 100644
index 0000000..912fcea
--- /dev/null
+++ b/doc/doxygen/html/err_8h-source.html
@@ -0,0 +1,85 @@
+
+
+Ubixos: err.h Source File
+
+
+
+
err.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035 #ifndef __LWIP_ERR_H__
+00036 #define __LWIP_ERR_H__
+00037
+00038 #include <ubixos/types.h>
+00039
+00040 #include "net/debug.h"
+00041
+00042 #include "net/arch/cc.h"
+00043
+00044 typedef Int8 err_t;
+00045
+00046 /* Definitions for error constants. */
+00047
+00048 #define ERR_OK 0 /* No error, everything OK. */
+00049 #define ERR_MEM -1 /* Out of memory error. */
+00050 #define ERR_BUF -2 /* Buffer error. */
+00051
+00052
+00053 #define ERR_ABRT -3 /* Connection aborted. */
+00054 #define ERR_RST -4 /* Connection reset. */
+00055 #define ERR_CLSD -5 /* Connection closed. */
+00056 #define ERR_CONN -6 /* Not connected. */
+00057
+00058 #define ERR_VAL -7 /* Illegal value. */
+00059
+00060 #define ERR_ARG -8 /* Illegal argument. */
+00061
+00062 #define ERR_RTE -9 /* Routing problem. */
+00063
+00064 #define ERR_USE -10 /* Address in use. */
+00065
+00066
+00067
+00068 #ifdef LWIP_DEBUG
+00069 externchar *lwip_strerr(err_t err);
+00070 #else
+00071 #define lwip_strerr(x) ""
+00072 #endif /* LWIP_DEBUG */
+00073 #endif /* __LWIP_ERR_H__ */
+
Generated on Wed Apr 28 17:49:33 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/err_8h.html b/doc/doxygen/html/err_8h.html
new file mode 100644
index 0000000..b8166cc
--- /dev/null
+++ b/doc/doxygen/html/err_8h.html
@@ -0,0 +1,341 @@
+
+
+Ubixos: err.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:19 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/ethernetif_8h-source.html b/doc/doxygen/html/ethernetif_8h-source.html
new file mode 100644
index 0000000..2748005
--- /dev/null
+++ b/doc/doxygen/html/ethernetif_8h-source.html
@@ -0,0 +1,54 @@
+
+
+Ubixos: ethernetif.h Source File
+
+
+
+
ethernetif.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035 #ifndef __NETIF_ETHERNETIF_H__
+00036 #define __NETIF_ETHERNETIF_H__
+00037
+00038 #include "net/netif.h"
+00039
+00040 void ethernetif_init(struct netif *netif);
+00041
+00042 #endif /* __NETIF_ETHERNETIF_H__ */
+
Generated on Wed Apr 28 17:49:33 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/ethernetif_8h.html b/doc/doxygen/html/ethernetif_8h.html
new file mode 100644
index 0000000..ca1de6a
--- /dev/null
+++ b/doc/doxygen/html/ethernetif_8h.html
@@ -0,0 +1,51 @@
+
+
+Ubixos: ethernetif.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:19 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/exec_8h-source.html b/doc/doxygen/html/exec_8h-source.html
new file mode 100644
index 0000000..c781d3d
--- /dev/null
+++ b/doc/doxygen/html/exec_8h-source.html
@@ -0,0 +1,45 @@
+
+
+Ubixos: exec.h Source File
+
+
+
+
exec.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _EXEC_H
+00025 #define _EXEC_H
+00026
+00027 #include <ubixos/types.h>
+00028 #include <ubixos/sched.h>
+00029
+00030 uInt32 execThread(void (* tproc)(void),int stack,char *arg,char *descr);
+00031 void execFile(char *file,int argc,char **argv,int console);
+00032
+00033 #endif
+
Generated on Wed Apr 28 17:49:34 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/exec_8h.html b/doc/doxygen/html/exec_8h.html
new file mode 100644
index 0000000..eed44f8
--- /dev/null
+++ b/doc/doxygen/html/exec_8h.html
@@ -0,0 +1,125 @@
+
+
+Ubixos: exec.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:19 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/fdc_8h-source.html b/doc/doxygen/html/fdc_8h-source.html
new file mode 100644
index 0000000..950285b
--- /dev/null
+++ b/doc/doxygen/html/fdc_8h-source.html
@@ -0,0 +1,91 @@
+
+
+Ubixos: fdc.h Source File
+
+
+
+
fdc.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _FDC_H
+00025 #define _FDC_H
+00026
+00027 #include <ubixos/types.h>
+00028
+00029 typedefstruct DrvGeom {
+00030 byte heads;
+00031 byte tracks;
+00032 byte spt;
+00033 } drvGeom;
+00034
+00035
+00036 #define fdcMsr (0x3f4)
+00037 #define fdcData (0x3f5)
+00038 #define fdcDir (0x3f7)
+00039 #define fdcCcr (0x3f7)
+00040 #define fdcDor (0x3f2)
+00041 #define fdcDrs (0x3f4)
+00042
+00043 #define cmdWrite (0xc5)
+00044 #define cmdRead (0xe6)
+00045 #define cmdSeek (0x0f)
+00046 #define cmdSensei (0x08)
+00047 #define cmdRecal (0x07)
+00048 #define cmdSpecify (0x03)
+00049
+00050 #define dg144Heads 2 /* heads per drive (1.44M) */
+00051 #define dg144Tracks 80
+00052 #define dg144Spt 18
+00053 #define dg144Gap3rw 0x1b
+00054 #define dg168Gap3rw 0x1c
+00055
+00056
+00057
+00058 void fdcInit();
+00059 void floppyIsr();
+00060 void floppyIsrhndlr();
+00061 void sendByte(int byte);
+00062 int getByte();
+00063 bool fdcRw(int block,byte *blockBuffer,bool read,unsignedlong numSectors);
+00064 void block2Hts(int block,int *head,int *track,int *sector);
+00065 void motorOn(void);
+00066 void motorOff(void);
+00067 bool seek(int track);
+00068 bool waitFdc(bool sensei);
+00069 int getByte();
+00070 void sendByte(int byte);
+00071 void recalibrate(void);
+00072 void reset(void);
+00073 bool writeBlock(int block,byte *blockBuffer, unsignedlong numSectors);
+00074 bool readBlock(int block,byte *blockBuffer, unsignedlong numSectors);
+00075 void fdcWrite(void *info,void *,uInt32 startSector,uInt32 sectorCount);
+00076 void fdcRead(void *info,void *,uInt32 startSector,uInt32 sectorCount);
+00077
+00078 #endif
+00079
+
Generated on Wed Apr 28 17:49:34 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/fdc_8h.html b/doc/doxygen/html/fdc_8h.html
new file mode 100644
index 0000000..20157ed
--- /dev/null
+++ b/doc/doxygen/html/fdc_8h.html
@@ -0,0 +1,1096 @@
+
+
+Ubixos: fdc.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:19 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/file_8h-source.html b/doc/doxygen/html/file_8h-source.html
new file mode 100644
index 0000000..0ee484a
--- /dev/null
+++ b/doc/doxygen/html/file_8h-source.html
@@ -0,0 +1,72 @@
+
+
+Ubixos: file.h Source File
+
+
+
+
file.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _FILE_H
+00025 #define _FILE_H
+00026
+00027 #include <ubixos/types.h>
+00028 #include <vfs/vfs.h>
+00029
+00030 #define SEEK_SET 0x0
+00031
+00032 struct taskFileInfo {
+00033 char *cwd;
+00034 };
+00035
+00036 typedefstruct userFileDescriptorStruct {
+00037 struct fileDescriptorStruct *fd;
+00038 uInt32 fdSize;
+00039 } userFileDescriptor;
+00040
+00041 extern fileDescriptor *fdTable;
+00042 extern fileDescriptor *lastFd;
+00043
+00044 fileDescriptor *fopen(constchar *file,constchar *flags);
+00045 int unlink(constchar *path);
+00046 int fclose(fileDescriptor *fd);
+00047 int feof(fileDescriptor *fd);
+00048 int fgetc(fileDescriptor *fd);
+00049 size_t fread(void *ptr, size_t size, size_t nmemb,fileDescriptor *fd);
+00050 size_t fwrite(void *ptr,int size,int nmemb,fileDescriptor *fd);
+00051 int fseek(fileDescriptor *,long,int);
+00052
+00053 void sysFseek(userFileDescriptor *,long,int);
+00054
+00055 //Good
+00056 void sysChDir(constchar *path);
+00057 void chDir(constchar *path);
+00058 char *verifyDir(constchar *path);
+00059
+00060 #endif
+
Generated on Wed Apr 28 17:49:34 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/file_8h.html b/doc/doxygen/html/file_8h.html
new file mode 100644
index 0000000..9cf7ad1
--- /dev/null
+++ b/doc/doxygen/html/file_8h.html
@@ -0,0 +1,581 @@
+
+
+Ubixos: file.h File Reference
+
+
+
+
+Generated on Wed Apr 28 17:49:27 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/fork_8h-source.html b/doc/doxygen/html/fork_8h-source.html
new file mode 100644
index 0000000..0a52ad3
--- /dev/null
+++ b/doc/doxygen/html/fork_8h-source.html
@@ -0,0 +1,47 @@
+
+
+Ubixos: fork.h Source File
+
+
+
+
fork.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _FORK_H
+00025 #define _FORK_H
+00026
+00027 #include <ubixos/types.h>
+00028 #include <ubixos/sched.h>
+00029
+00030 void sysFork();
+00031
+00032 int forkCopyProcess(struct taskStruct *newProcess,long ebp,long edi,long esi,long none,long ebx,long ecx,long edx,long eip,long cs,long eflags,long esp,long ss);
+00033
+00034 #endif
+00035
+
Generated on Wed Apr 28 17:49:34 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/fork_8h.html b/doc/doxygen/html/fork_8h.html
new file mode 100644
index 0000000..b1eb4d5
--- /dev/null
+++ b/doc/doxygen/html/fork_8h.html
@@ -0,0 +1,157 @@
+
+
+Ubixos: fork.h File Reference
+
+
+
+
forkCopyProcess (struct taskStruct *newProcess, long ebp, long edi, long esi, long none, long ebx, long ecx, long edx, long eip, long cs, long eflags, long esp, long ss)
+Generated on Sat May 8 09:28:20 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/functions.html b/doc/doxygen/html/functions.html
new file mode 100644
index 0000000..a308daa
--- /dev/null
+++ b/doc/doxygen/html/functions.html
@@ -0,0 +1,579 @@
+
+
+Ubixos: Compound Member Index
+
+
+
+
+Generated on Sat May 8 09:28:23 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/functions_func.html b/doc/doxygen/html/functions_func.html
new file mode 100644
index 0000000..602e3bc
--- /dev/null
+++ b/doc/doxygen/html/functions_func.html
@@ -0,0 +1,92 @@
+
+
+Ubixos: Compound Member Index
+
+
+
+
+Generated on Sat May 8 09:28:23 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/functions_vars.html b/doc/doxygen/html/functions_vars.html
new file mode 100644
index 0000000..9949359
--- /dev/null
+++ b/doc/doxygen/html/functions_vars.html
@@ -0,0 +1,532 @@
+
+
+Ubixos: Compound Member Index
+
+
+
+
+Generated on Sat May 8 09:28:24 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/gdt_8h-source.html b/doc/doxygen/html/gdt_8h-source.html
new file mode 100644
index 0000000..10bc52d
--- /dev/null
+++ b/doc/doxygen/html/gdt_8h-source.html
@@ -0,0 +1,100 @@
+
+
+Ubixos: gdt.h Source File
+
+
+
+
gdt.h
00001
+00002
+00003
+00004 /**************************************************************************************
+00005 Copyright (c) 2002 The UbixOS Project
+00006 All rights reserved.
+00007
+00008 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00009
+00010 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00011 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00012 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00013 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00014
+00015 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00016 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00017 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00018 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00019 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00020 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00021 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00022
+00023 $Id$
+00024
+00025 **************************************************************************************/
+00026
+00027 #ifndef _GDT_H
+00028 #define _GDT_H
+00029
+00030 /* Descriptor Definitions */
+00031 #define dCall 0x0C00 /* 386 Call Gate */
+00032 #define dCode 0x1800 /* Code Segment */
+00033 #define dData 0x1000 /* Data Segment */
+00034 #define dInt 0x0E00 /* 386 Interrupt Gate */
+00035 #define dLdt 0x200 /* Local Descriptor Table (LDT) */
+00036 #define dTask 0x500 /* Task gate */
+00037 #define dTrap 0x0F00 /* 386 Trap Gate */
+00038 #define dTss 0x900 /* Task State Segment (TSS) */
+00039
+00040 /* Descriptor Options */
+00041 #define dDpl3 0x6000 /* DPL3 or mask for DPL */
+00042 #define dDpl2 0x4000 /* DPL2 or mask for DPL */
+00043 #define dDpl1 0x2000 /* DPL1 or mask for DPL */
+00044 #define dPresent 0x8000 /* Present */
+00045 #define dNpresent 0x8000 /* Not Present */
+00046 #define dAcc 0x100 /* Accessed (Data or Code) */
+00047 #define dWrite 0x200 /* Writable (Data segments only) */
+00048 #define dRead 0x200 /* Readable (Code segments only) */
+00049 #define dBusy 0xB00 /* Busy (TSS only) was 200 */
+00050 #define dEexdown 0x400 /* Expand down (Data segments only) */
+00051 #define dConform 0x400 /* Conforming (Code segments only) */
+00052 #define dBig 0x40 /* Default to 32 bit mode */
+00053 #define dBiglim 0x80 /* Limit is in 4K units */
+00054
+00055 /* GDT Descriptor */
+00056 struct gdtDescriptor {
+00057 unsignedshort limitLow; /* Limit 0..15 */
+00058 unsignedshort baseLow; /* Base 0..15 */
+00059 unsignedchar baseMed; /* Base 16..23 */
+00060 unsignedchar access; /* Access Byte */
+00061 unsignedint limitHigh:4; /* Limit 16..19 */
+00062 unsignedint granularity:4; /* Granularity */
+00063 unsignedchar baseHigh; /* Base 24..31 */
+00064 } __attribute__ ((packed));
+00065
+00066 struct gdtGate {
+00067 unsignedshort offsetLow; /* Offset 0..15 */
+00068 unsignedshort selector; /* Selector */
+00069 unsignedshort access; /* Access Flags */
+00070 unsignedshort offsetHigh; /* Offset 16..31 */
+00071 } __attribute__ ((packed));
+00072
+00073 union descriptorTableunion {
+00074 struct gdtDescriptor descriptor; /* Normal descriptor */
+00075 struct gdtGate gate; /* Gate descriptor */
+00076 unsignedlong dummy; /* Any other info */
+00077 };
+00078
+00079
+00080 #define descriptorTable(name,length) union descriptorTableunion name[length] =
+00081 #define standardDescriptor(base, limit, control) {descriptor: {(limit & 0xffff), (base & 0xffff), ((base >> 16) & 0xff), \
+00082 ((control+dPresent) >> 8), (limit >> 16), \
+00083 ((control & 0xff) >> 4), (base >> 24)}}
+00084 #define gateDescriptor(offset, selector, control) {gate: {(offset & 0xffff), selector, \
+00085 (control+dPresent), (offset >> 16) }}
+00086
+00087 #endif
+00088
+
Generated on Wed Apr 28 17:49:34 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/gdt_8h.html b/doc/doxygen/html/gdt_8h.html
new file mode 100644
index 0000000..aa50482
--- /dev/null
+++ b/doc/doxygen/html/gdt_8h.html
@@ -0,0 +1,668 @@
+
+
+Ubixos: gdt.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:20 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/globals.html b/doc/doxygen/html/globals.html
new file mode 100644
index 0000000..2082413
--- /dev/null
+++ b/doc/doxygen/html/globals.html
@@ -0,0 +1,1187 @@
+
+
+Ubixos: File Member Index
+
+
+
+
+Generated on Sat May 8 09:28:26 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/globals_defs.html b/doc/doxygen/html/globals_defs.html
new file mode 100644
index 0000000..7bbcdc7
--- /dev/null
+++ b/doc/doxygen/html/globals_defs.html
@@ -0,0 +1,610 @@
+
+
+Ubixos: File Member Index
+
+
+
+
+Generated on Sat May 8 09:28:27 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/globals_enum.html b/doc/doxygen/html/globals_enum.html
new file mode 100644
index 0000000..16f3a5e
--- /dev/null
+++ b/doc/doxygen/html/globals_enum.html
@@ -0,0 +1,29 @@
+
+
+Ubixos: File Member Index
+
+
+
+
+Generated on Sat May 8 09:28:26 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/globals_eval.html b/doc/doxygen/html/globals_eval.html
new file mode 100644
index 0000000..9d00962
--- /dev/null
+++ b/doc/doxygen/html/globals_eval.html
@@ -0,0 +1,124 @@
+
+
+Ubixos: File Member Index
+
+
+
+
+Generated on Sat May 8 09:28:26 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/globals_func.html b/doc/doxygen/html/globals_func.html
new file mode 100644
index 0000000..1066fd2
--- /dev/null
+++ b/doc/doxygen/html/globals_func.html
@@ -0,0 +1,512 @@
+
+
+Ubixos: File Member Index
+
+
+
+
+Generated on Sat May 8 09:28:26 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/globals_type.html b/doc/doxygen/html/globals_type.html
new file mode 100644
index 0000000..1cb544b
--- /dev/null
+++ b/doc/doxygen/html/globals_type.html
@@ -0,0 +1,97 @@
+
+
+Ubixos: File Member Index
+
+
+
+
+Generated on Sat May 8 09:28:26 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/globals_vars.html b/doc/doxygen/html/globals_vars.html
new file mode 100644
index 0000000..bb7cd53
--- /dev/null
+++ b/doc/doxygen/html/globals_vars.html
@@ -0,0 +1,101 @@
+
+
+Ubixos: File Member Index
+
+
+
+
+Generated on Sat May 8 09:28:20 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/idletask_8h-source.html b/doc/doxygen/html/idletask_8h-source.html
new file mode 100644
index 0000000..aa4b856
--- /dev/null
+++ b/doc/doxygen/html/idletask_8h-source.html
@@ -0,0 +1,44 @@
+
+
+Ubixos: idletask.h Source File
+
+
+
+
idletask.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _IDLETASK_H
+00025 #define _IDLETASK_H
+00026
+00027 #include <ubixos/types.h>
+00028
+00029 void idleTask();
+00030
+00031 #endif
+00032
+
Generated on Wed Apr 28 17:49:35 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/idletask_8h.html b/doc/doxygen/html/idletask_8h.html
new file mode 100644
index 0000000..70e683c
--- /dev/null
+++ b/doc/doxygen/html/idletask_8h.html
@@ -0,0 +1,50 @@
+
+
+Ubixos: idletask.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:20 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/idt_8h-source.html b/doc/doxygen/html/idt_8h-source.html
new file mode 100644
index 0000000..958900c
--- /dev/null
+++ b/doc/doxygen/html/idt_8h-source.html
@@ -0,0 +1,69 @@
+
+
+Ubixos: idt.h Source File
+
+
+
+
idt.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _IDT_H
+00025 #define _IDT_H
+00026
+00027 #include <ubixos/types.h>
+00028 #include <sys/gdt.h>
+00029
+00030 #define EFLAG_TF 0x100
+00031 #define EFLAG_IF 0x200
+00032 #define EFLAG_IOPL3 0x3000
+00033 #define EFLAG_VM 0x20000
+00034
+00035 int idtInit();
+00036 void setVector(void *handler, unsignedchar interrupt, unsignedshort controlMajor);
+00037 void setTaskVector(uInt8 interrupt,uInt16 controlMajor,uInt8 selector);
+00038 void intNull();
+00039
+00040 void _int0();
+00041 void _int1();
+00042 void _int2();
+00043 void _int3();
+00044 void _int4();
+00045 void _int5();
+00046 void _int6();
+00047 void _int7();
+00048 void _int8();
+00049 void _int9();
+00050 void _int10();
+00051 void _int11();
+00052 void _int12();
+00053 void _int13();
+00054 void timerInt();
+00055
+00056 #endif
+00057
+
Generated on Wed Apr 28 17:49:35 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/idt_8h.html b/doc/doxygen/html/idt_8h.html
new file mode 100644
index 0000000..a05fcbb
--- /dev/null
+++ b/doc/doxygen/html/idt_8h.html
@@ -0,0 +1,721 @@
+
+
+Ubixos: idt.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:20 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/include_2net_2arch_2lib_8h-source.html b/doc/doxygen/html/include_2net_2arch_2lib_8h-source.html
new file mode 100644
index 0000000..b78c219
--- /dev/null
+++ b/doc/doxygen/html/include_2net_2arch_2lib_8h-source.html
@@ -0,0 +1,59 @@
+
+
+Ubixos: lib.h Source File
+
+
+
+
lib.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035 #ifndef __ARCH_LIB_H__
+00036 #define __ARCH_LIB_H__
+00037
+00038 #ifndef _STRING_H_
+00039 #ifndef _STRING_H
+00040 int strlen(constchar *str);
+00041 int strncmp(constchar *str1, constchar *str2, int len);
+00042 void bcopy(constvoid *src, void *dest, int len);
+00043 void bzero(void *data, int n);
+00044 #endif /* _STRING_H */
+00045 #endif /* _STRING_H_ */
+00046
+00047 #endif /* __ARCH_LIB_H__ */
+
Generated on Wed Apr 28 17:49:36 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/include_2ubixfs_2ubixfs_8h-source.html b/doc/doxygen/html/include_2ubixfs_2ubixfs_8h-source.html
new file mode 100644
index 0000000..10ce25f
--- /dev/null
+++ b/doc/doxygen/html/include_2ubixfs_2ubixfs_8h-source.html
@@ -0,0 +1,137 @@
+
+
+Ubixos: ubixfs.h Source File
+
+
+
+
ubixfs.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _UBIXFS_H
+00025 #define _UBIXFS_H
+00026
+00027 #include <ubixos/types.h>
+00028 #include <sys/device.h>
+00029 #include <vfs/file.h>
+00030
+00031 #define UBIXDISKMAGIC ((uInt32)0x45) /* The disk magic number */
+00032 #define MAXPARTITIONS 4
+00033 #define blockSize 8
+00034 #define blockByteSize blockSize*512
+00035
+00036 #define EOBC -1
+00037
+00038
+00039 #define typeFile 1
+00040 #define typeContainer 2
+00041 #define typeDirectory 4
+00042 #define typeDeleted 8
+00043
+00044 //Partition Information
+00045 struct ubixDiskLabel {
+00046 uInt32 magicNum;
+00047 uInt32 magicNum2;
+00048 uInt16 driveType;
+00049 uInt16 numPartitions;
+00050 struct drivePartitions { //the partition table
+00051 uInt32 pSize; //number of sectors in partition
+00052 uInt32 pOffset; //starting sector
+00053 uInt32 pFsSize; //filesystem basic fragment size
+00054 uInt32 pBatSize; //BAT size
+00055 uInt8 pFsType; //filesystem type, see below
+00056 uInt8 pFrag; //filesystem fragments per block
+00057 } partitions[MAXPARTITIONS];
+00058 };
+00059
+00060 struct partitionInformation {
+00061 uInt32 size; //Size In Sectors
+00062 uInt32 startSector; //Base Sector Of Partition
+00063 uInt32 blockAllocationTable; //Base Sector Of BAT
+00064 uInt32 rootDirectory; //Base Sector Of Root Directory
+00065 };
+00066
+00067 //Block Allocation Table Entry
+00068 struct blockAllocationTableEntry {
+00069 long attributes; //Block Attributes
+00070 long realSector; //Real Sector
+00071 long nextBlock; //Sector Of Next Block
+00072 long reserved; //Reserved
+00073 };
+00074
+00075 //UbixFS Directory Entry
+00076 struct directoryEntry {
+00077 uInt32 startCluster; //Starting Cluster Of File
+00078 uInt32 size; //Size Of File
+00079 uInt32 creationDate; //Date Created
+00080 uInt32 lastModified; //Date Last Modified
+00081 uInt32 uid; //UID Of Owner
+00082 uInt32 gid; //GID Of Owner
+00083 uShort attributes; //Files Attributes
+00084 uShort permissions; //Files Permissions
+00085 char fileName[256]; //File Name
+00086 };
+00087
+00088 struct bootSect {
+00089 uChar jmp[4];
+00090 uChar id[6];
+00091 uShort version;
+00092 uShort tmp;
+00093 uShort fsStart;
+00094 uShort tmp2;
+00095 uInt32 krnl_start;
+00096 uInt BytesPerSector;
+00097 uInt SectersPerTrack;
+00098 uInt TotalHeads;
+00099 uInt32 TotalSectors;
+00100 uChar code[479];
+00101 };
+00102
+00103 struct ubixFsInfo {
+00104 struct blockAllocationTableEntry *blockAllocationTable;
+00105 uInt32 batEntries;
+00106 };
+00107
+00108 int readFile(char *file);
+00109 int writeFileByte(int ch,fileDescriptor *fd,long offset);
+00110 int openFileUbixFS(char *file,fileDescriptor *fd);
+00111 int mkDirUbixFS(char *dir,fileDescriptor *fd);
+00112 int getFreeBlocks(int count,fileDescriptor *fd);
+00113 //extern struct ubixDiskLabel *diskLabel;
+00114
+00115 //Good Functions
+00116 void initUbixFS(struct mountPoints *mp);
+00117 int enableUbixFS();
+00118 int readUbixFS(fileDescriptor *fd,char *data,long offset,long size);
+00119 int writeUbixFS(fileDescriptor *fd,char *data,long offset,long size);
+00120 void syncBat(struct mountPoints *mp);
+00121 int freeBlocks(int block,fileDescriptor *fd);
+00122 int addDirEntry(struct directoryEntry *dir,fileDescriptor *fd);
+00123 void ubixFSUnlink(char *path,struct mountPoints *mp);
+00124
+00125 #endif
+
Generated on Wed Apr 28 17:49:42 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/index.html b/doc/doxygen/html/index.html
new file mode 100644
index 0000000..e05dc4a
--- /dev/null
+++ b/doc/doxygen/html/index.html
@@ -0,0 +1,16 @@
+
+
+Ubixos: Main Page
+
+
+
+
+Generated on Wed Apr 28 17:49:27 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/init_8h-source.html b/doc/doxygen/html/init_8h-source.html
new file mode 100644
index 0000000..321a851
--- /dev/null
+++ b/doc/doxygen/html/init_8h-source.html
@@ -0,0 +1,56 @@
+
+
+Ubixos: init.h Source File
+
+
+
+
init.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035 #ifndef __ARCH_INIT_H__
+00036 #define __ARCH_INIT_H__
+00037
+00038 #define TCPIP_INIT_DONE(arg) sys_sem_signal(*(sys_sem_t *)arg)
+00039
+00040 #endif /* __ARCH_INIT_H__ */
+00041
+00042
+00043
+00044
+
Generated on Wed Apr 28 17:49:35 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/init_8h.html b/doc/doxygen/html/init_8h.html
new file mode 100644
index 0000000..b3adff2
--- /dev/null
+++ b/doc/doxygen/html/init_8h.html
@@ -0,0 +1,48 @@
+
+
+Ubixos: init.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:20 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/io_8h-source.html b/doc/doxygen/html/io_8h-source.html
new file mode 100644
index 0000000..f5dc2f6
--- /dev/null
+++ b/doc/doxygen/html/io_8h-source.html
@@ -0,0 +1,48 @@
+
+
+Ubixos: io.h Source File
+
+
+
+
io.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _IO_H
+00025 #define _IO_H
+00026
+00027 inlineunsignedchar inportByte(unsignedint);
+00028 inlineunsignedshort inportWord(unsignedint);
+00029 inlineunsignedlong inportDWord(unsignedint);
+00030 inlinevoid outportByte(unsignedint,unsignedchar);
+00031 inlinevoid outportByteP(unsignedint port,unsignedchar value);
+00032 inlinevoid outportWord(unsignedint,unsignedshort);
+00033 inlinevoid outportDWord(unsignedint port,unsignedlong value);
+00034
+00035 #endif
+00036
+
Generated on Wed Apr 28 17:49:35 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/io_8h.html b/doc/doxygen/html/io_8h.html
new file mode 100644
index 0000000..a11053b
--- /dev/null
+++ b/doc/doxygen/html/io_8h.html
@@ -0,0 +1,272 @@
+
+
+Ubixos: io.h File Reference
+
+
+
+
outportDWord (unsigned int port, unsigned long value)
+
+
+
Function Documentation
+
+
+
+
+
+
+
unsigned char inportByte
+
(
+
unsigned
+
int
+
)
+
[inline]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
unsigned long inportDWord
+
(
+
unsigned
+
int
+
)
+
[inline]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
unsigned short inportWord
+
(
+
unsigned
+
int
+
)
+
[inline]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
void outportByte
+
(
+
unsigned
+
int,
+
+
+
+
+
unsigned
+
char
+
+
+
+
)
+
[inline]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
void outportByteP
+
(
+
unsigned int
+
port,
+
+
+
+
+
unsigned char
+
value
+
+
+
+
)
+
[inline]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
void outportDWord
+
(
+
unsigned int
+
port,
+
+
+
+
+
unsigned long
+
value
+
+
+
+
)
+
[inline]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
void outportWord
+
(
+
unsigned
+
int,
+
+
+
+
+
unsigned
+
short
+
+
+
+
)
+
[inline]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Generated on Sat May 8 09:28:20 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/ipv4_2icmp_8h-source.html b/doc/doxygen/html/ipv4_2icmp_8h-source.html
new file mode 100644
index 0000000..94e52e0
--- /dev/null
+++ b/doc/doxygen/html/ipv4_2icmp_8h-source.html
@@ -0,0 +1,116 @@
+
+
+Ubixos: icmp.h Source File
+
+
+
+
icmp.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035 #ifndef __LWIP_ICMP_H__
+00036 #define __LWIP_ICMP_H__
+00037
+00038 #include "net/arch.h"
+00039
+00040 #include "net/opt.h"
+00041 #include "net/pbuf.h"
+00042
+00043 #include "net/netif.h"
+00044
+00045 #define ICMP_ER 0 /* echo reply */
+00046 #define ICMP_DUR 3 /* destination unreachable */
+00047 #define ICMP_SQ 4 /* source quench */
+00048 #define ICMP_RD 5 /* redirect */
+00049 #define ICMP_ECHO 8 /* echo */
+00050 #define ICMP_TE 11 /* time exceeded */
+00051 #define ICMP_PP 12 /* parameter problem */
+00052 #define ICMP_TS 13 /* timestamp */
+00053 #define ICMP_TSR 14 /* timestamp reply */
+00054 #define ICMP_IRQ 15 /* information request */
+00055 #define ICMP_IR 16 /* information reply */
+00056
+00057 enum icmp_dur_type {
+00058 ICMP_DUR_NET = 0, /* net unreachable */
+00059 ICMP_DUR_HOST = 1, /* host unreachable */
+00060 ICMP_DUR_PROTO = 2, /* protocol unreachable */
+00061 ICMP_DUR_PORT = 3, /* port unreachable */
+00062 ICMP_DUR_FRAG = 4, /* fragmentation needed and DF set */
+00063 ICMP_DUR_SR = 5 /* source route failed */
+00064 };
+00065
+00066 enum icmp_te_type {
+00067 ICMP_TE_TTL = 0, /* time to live exceeded in transit */
+00068 ICMP_TE_FRAG = 1 /* fragment reassembly time exceeded */
+00069 };
+00070
+00071 void icmp_input(struct pbuf *p, struct netif *inp);
+00072
+00073 void icmp_dest_unreach(struct pbuf *p, enum icmp_dur_type t);
+00074 void icmp_time_exceeded(struct pbuf *p, enum icmp_te_type t);
+00075
+00076 struct icmp_echo_hdr {
+00077 PACK_STRUCT_FIELD(uInt16 _type_code);
+00078 PACK_STRUCT_FIELD(uInt16 chksum);
+00079 PACK_STRUCT_FIELD(uInt16 id);
+00080 PACK_STRUCT_FIELD(uInt16 seqno);
+00081 } PACK_STRUCT_STRUCT;
+00082
+00083
+00084
+00085 struct icmp_dur_hdr {
+00086 PACK_STRUCT_FIELD(uInt16 _type_code);
+00087 PACK_STRUCT_FIELD(uInt16 chksum);
+00088 PACK_STRUCT_FIELD(uInt32 unused);
+00089 } PACK_STRUCT_STRUCT;
+00090
+00091 struct icmp_te_hdr {
+00092 PACK_STRUCT_FIELD(uInt16 _type_code);
+00093 PACK_STRUCT_FIELD(uInt16 chksum);
+00094 PACK_STRUCT_FIELD(uInt32 unused);
+00095 } PACK_STRUCT_STRUCT;
+00096
+00097 #define ICMPH_TYPE(hdr) (NTOHS((hdr)->_type_code) >> 8)
+00098 #define ICMPH_CODE(hdr) (NTOHS((hdr)->_type_code) & 0xff)
+00099
+00100 #define ICMPH_TYPE_SET(hdr, type) ((hdr)->_type_code = HTONS(ICMPH_CODE(hdr) | ((type) << 8)))
+00101 #define ICMPH_CODE_SET(hdr, code) ((hdr)->_type_code = HTONS((code) | (ICMPH_TYPE(hdr) << 8)))
+00102
+00103 #endif /* __LWIP_ICMP_H__ */
+00104
+
Generated on Wed Apr 28 17:49:34 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/ipv4_2icmp_8h.html b/doc/doxygen/html/ipv4_2icmp_8h.html
new file mode 100644
index 0000000..0513269
--- /dev/null
+++ b/doc/doxygen/html/ipv4_2icmp_8h.html
@@ -0,0 +1,649 @@
+
+
+Ubixos: ipv4/icmp.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:20 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/ipv4_2ip_8h-source.html b/doc/doxygen/html/ipv4_2ip_8h-source.html
new file mode 100644
index 0000000..6668cdb
--- /dev/null
+++ b/doc/doxygen/html/ipv4_2ip_8h-source.html
@@ -0,0 +1,132 @@
+
+
+Ubixos: ip.h Source File
+
+
+
+
ip.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035 #ifndef __LWIP_IP_H__
+00036 #define __LWIP_IP_H__
+00037
+00038 #include "net/arch.h"
+00039
+00040 #include "net/def.h"
+00041 #include "net/pbuf.h"
+00042 #include "net/ipv4/ip_addr.h"
+00043 #include "net/netif.h"
+00044
+00045 #include "net/err.h"
+00046
+00047 void ip_init(void);
+00048 uInt8 ip_lookup(void *header, struct netif *inp);
+00049 struct netif *ip_route(struct ip_addr *dest);
+00050 err_t ip_input(struct pbuf *p, struct netif *inp);
+00051 err_t ip_output(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest,
+00052 uInt8 ttl, uInt8 proto);
+00053 err_t ip_output_if(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest,
+00054 uInt8 ttl, uInt8 proto,
+00055 struct netif *netif);
+00056
+00057 #define IP_HLEN 20
+00058
+00059 #define IP_PROTO_ICMP 1
+00060 #define IP_PROTO_UDP 17
+00061 #define IP_PROTO_UDPLITE 170
+00062 #define IP_PROTO_TCP 6
+00063
+00064 /* This is passed as the destination address to ip_output_if (not
+00065 to ip_output), meaning that an IP header already is constructed
+00066 in the pbuf. This is used when TCP retransmits. */
+00067 #ifdef IP_HDRINCL
+00068 #undef IP_HDRINCL
+00069 #endif /* IP_HDRINCL */
+00070 #define IP_HDRINCL NULL
+00071
+00072 struct ip_hdr {
+00073 /* version / header length / type of service */
+00074 PACK_STRUCT_FIELD(uInt16 _v_hl_tos);
+00075 /* total length */
+00076 PACK_STRUCT_FIELD(uInt16 _len);
+00077 /* identification */
+00078 PACK_STRUCT_FIELD(uInt16 _id);
+00079 /* fragment offset field */
+00080 PACK_STRUCT_FIELD(uInt16 _offset);
+00081 #define IP_RF 0x8000 /* reserved fragment flag */
+00082 #define IP_DF 0x4000 /* dont fragment flag */
+00083 #define IP_MF 0x2000 /* more fragments flag */
+00084 #define IP_OFFMASK 0x1fff /* mask for fragmenting bits */
+00085 /* time to live / protocol*/
+00086 PACK_STRUCT_FIELD(uInt16 _ttl_proto);
+00087 /* checksum */
+00088 PACK_STRUCT_FIELD(uInt16 _chksum);
+00089 /* source and destination IP addresses */
+00090 PACK_STRUCT_FIELD(struct ip_addr src);
+00091 PACK_STRUCT_FIELD(struct ip_addr dest);
+00092 } PACK_STRUCT_STRUCT;
+00093
+00094 #define IPH_V(hdr) (NTOHS((hdr)->_v_hl_tos) >> 12)
+00095 #define IPH_HL(hdr) ((NTOHS((hdr)->_v_hl_tos) >> 8) & 0x0f)
+00096 #define IPH_TOS(hdr) HTONS((NTOHS((hdr)->_v_hl_tos) & 0xff))
+00097 #define IPH_LEN(hdr) ((hdr)->_len)
+00098 #define IPH_ID(hdr) ((hdr)->_id)
+00099 #define IPH_OFFSET(hdr) ((hdr)->_offset)
+00100 #define IPH_TTL(hdr) (NTOHS((hdr)->_ttl_proto) >> 8)
+00101 #define IPH_PROTO(hdr) (NTOHS((hdr)->_ttl_proto) & 0xff)
+00102 #define IPH_CHKSUM(hdr) ((hdr)->_chksum)
+00103
+00104 #define IPH_VHLTOS_SET(hdr, v, hl, tos) (hdr)->_v_hl_tos = HTONS(((v) << 12) | ((hl) << 8) | (tos))
+00105 #define IPH_LEN_SET(hdr, len) (hdr)->_len = (len)
+00106 #define IPH_ID_SET(hdr, id) (hdr)->_id = (id)
+00107 #define IPH_OFFSET_SET(hdr, off) (hdr)->_offset = (off)
+00108 #define IPH_TTL_SET(hdr, ttl) (hdr)->_ttl_proto = HTONS(IPH_PROTO(hdr) | ((ttl) << 8))
+00109 #define IPH_PROTO_SET(hdr, proto) (hdr)->_ttl_proto = HTONS((proto) | (IPH_TTL(hdr) << 8))
+00110 #define IPH_CHKSUM_SET(hdr, chksum) (hdr)->_chksum = (chksum)
+00111
+00112
+00113
+00114 #if IP_DEBUG
+00115 void ip_debug_print(struct pbuf *p);
+00116 #endif /* IP_DEBUG */
+00117
+00118 #endif /* __LWIP_IP_H__ */
+00119
+00120
+
Generated on Wed Apr 28 17:49:35 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/ipv4_2ip_8h.html b/doc/doxygen/html/ipv4_2ip_8h.html
new file mode 100644
index 0000000..b540787
--- /dev/null
+++ b/doc/doxygen/html/ipv4_2ip_8h.html
@@ -0,0 +1,1051 @@
+
+
+Ubixos: ipv4/ip.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:20 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/ipv4_2ip__addr_8h-source.html b/doc/doxygen/html/ipv4_2ip__addr_8h-source.html
new file mode 100644
index 0000000..03b3cdb
--- /dev/null
+++ b/doc/doxygen/html/ipv4_2ip__addr_8h-source.html
@@ -0,0 +1,104 @@
+
+
+Ubixos: ip_addr.h Source File
+
+
+
+
ip_addr.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035 #ifndef __LWIP_IP_ADDR_H__
+00036 #define __LWIP_IP_ADDR_H__
+00037
+00038 #include "net/arch.h"
+00039
+00040 #define IP_ADDR_ANY 0
+00041
+00042 #define IP_ADDR_BROADCAST (&ip_addr_broadcast)
+00043
+00044 PACK_STRUCT_BEGIN
+00045 struct ip_addr {
+00046 PACK_STRUCT_FIELD(uInt32 addr);
+00047 } PACK_STRUCT_STRUCT;
+00048 PACK_STRUCT_END
+00049
+00050 externstruct ip_addr ip_addr_broadcast;
+00051
+00052 #define IP4_ADDR(ipaddr, a,b,c,d) (ipaddr)->addr = htonl(((uInt32)(a & 0xff) << 24) | ((uInt32)(b & 0xff) << 16) | \
+00053 ((uInt32)(c & 0xff) << 8) | (uInt32)(d & 0xff))
+00054
+00055 #define ip_addr_set(dest, src) (dest)->addr = \
+00056 ((src) == IP_ADDR_ANY? IP_ADDR_ANY:\
+00057 ((struct ip_addr *)src)->addr)
+00058 #define ip_addr_maskcmp(addr1, addr2, mask) (((addr1)->addr & \
+00059 (mask)->addr) == \
+00060 ((addr2)->addr & \
+00061 (mask)->addr))
+00062 #define ip_addr_cmp(addr1, addr2) ((addr1)->addr == (addr2)->addr)
+00063
+00064 #define ip_addr_isany(addr1) ((addr1) == NULL || (addr1)->addr == 0)
+00065
+00066 #define ip_addr_isbroadcast(addr1, mask) (((((addr1)->addr) & ~((mask)->addr)) == \
+00067 (0xffffffff & ~((mask)->addr))) || \
+00068 ((addr1)->addr == 0xffffffff) || \
+00069 ((addr1)->addr == 0x00000000))
+00070
+00071
+00072 #define ip_addr_ismulticast(addr1) (((addr1)->addr & ntohl(0xf0000000)) == ntohl(0xe0000000))
+00073
+00074
+00075 #define ip_addr_debug_print(ipaddr) kprintf("%d.%d.%d.%d", \
+00076 (uInt8)(ntohl((ipaddr)->addr) >> 24) & 0xff, \
+00077 (uInt8)(ntohl((ipaddr)->addr) >> 16) & 0xff, \
+00078 (uInt8)(ntohl((ipaddr)->addr) >> 8) & 0xff, \
+00079 (uInt8)ntohl((ipaddr)->addr) & 0xff)
+00080
+00081
+00082 #define ip4_addr1(ipaddr) ((uInt8)(ntohl((ipaddr)->addr) >> 24) & 0xff)
+00083 #define ip4_addr2(ipaddr) ((uInt8)(ntohl((ipaddr)->addr) >> 16) & 0xff)
+00084 #define ip4_addr3(ipaddr) ((uInt8)(ntohl((ipaddr)->addr) >> 8) & 0xff)
+00085 #define ip4_addr4(ipaddr) ((uInt8)(ntohl((ipaddr)->addr)) & 0xff)
+00086 #endif /* __LWIP_IP_ADDR_H__ */
+00087
+00088
+00089
+00090
+00091
+00092
+
Generated on Wed Apr 28 17:49:35 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/ipv4_2ip__addr_8h.html b/doc/doxygen/html/ipv4_2ip__addr_8h.html
new file mode 100644
index 0000000..3d84a59
--- /dev/null
+++ b/doc/doxygen/html/ipv4_2ip__addr_8h.html
@@ -0,0 +1,514 @@
+
+
+Ubixos: ipv4/ip_addr.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:20 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/ipv6_2icmp_8h-source.html b/doc/doxygen/html/ipv6_2icmp_8h-source.html
new file mode 100644
index 0000000..6c7ff97
--- /dev/null
+++ b/doc/doxygen/html/ipv6_2icmp_8h-source.html
@@ -0,0 +1,105 @@
+
+
+Ubixos: icmp.h Source File
+
+
+
+
icmp.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035 #ifndef __LWIP_ICMP_H__
+00036 #define __LWIP_ICMP_H__
+00037
+00038 #include "lwip/arch.h"
+00039
+00040 #include "lwip/opt.h"
+00041 #include "lwip/pbuf.h"
+00042
+00043 #include "lwip/netif.h"
+00044
+00045 #define ICMP6_DUR 1
+00046 #define ICMP6_TE 3
+00047 #define ICMP6_ECHO 128 /* echo */
+00048 #define ICMP6_ER 129 /* echo reply */
+00049
+00050
+00051 enum icmp_dur_type {
+00052 ICMP_DUR_NET = 0, /* net unreachable */
+00053 ICMP_DUR_HOST = 1, /* host unreachable */
+00054 ICMP_DUR_PROTO = 2, /* protocol unreachable */
+00055 ICMP_DUR_PORT = 3, /* port unreachable */
+00056 ICMP_DUR_FRAG = 4, /* fragmentation needed and DF set */
+00057 ICMP_DUR_SR = 5 /* source route failed */
+00058 };
+00059
+00060 enum icmp_te_type {
+00061 ICMP_TE_TTL = 0, /* time to live exceeded in transit */
+00062 ICMP_TE_FRAG = 1 /* fragment reassembly time exceeded */
+00063 };
+00064
+00065 void icmp_input(struct pbuf *p, struct netif *inp);
+00066
+00067 void icmp_dest_unreach(struct pbuf *p, enum icmp_dur_type t);
+00068 void icmp_time_exceeded(struct pbuf *p, enum icmp_te_type t);
+00069
+00070 struct icmp_echo_hdr {
+00071 u8_t type;
+00072 u8_t icode;
+00073 u16_t chksum;
+00074 u16_t id;
+00075 u16_t seqno;
+00076 };
+00077
+00078 struct icmp_dur_hdr {
+00079 u8_t type;
+00080 u8_t icode;
+00081 u16_t chksum;
+00082 u32_t unused;
+00083 };
+00084
+00085 struct icmp_te_hdr {
+00086 u8_t type;
+00087 u8_t icode;
+00088 u16_t chksum;
+00089 u32_t unused;
+00090 };
+00091
+00092 #endif /* __LWIP_ICMP_H__ */
+00093
+
Generated on Wed Apr 28 17:49:35 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/ipv6_2icmp_8h.html b/doc/doxygen/html/ipv6_2icmp_8h.html
new file mode 100644
index 0000000..ea353b8
--- /dev/null
+++ b/doc/doxygen/html/ipv6_2icmp_8h.html
@@ -0,0 +1,333 @@
+
+
+Ubixos: ipv6/icmp.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:20 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/ipv6_2inet_8h-source.html b/doc/doxygen/html/ipv6_2inet_8h-source.html
new file mode 100644
index 0000000..4685890
--- /dev/null
+++ b/doc/doxygen/html/ipv6_2inet_8h-source.html
@@ -0,0 +1,75 @@
+
+
+Ubixos: inet.h Source File
+
+
+
+
inet.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035 #ifndef __LWIP_INET_H__
+00036 #define __LWIP_INET_H__
+00037
+00038 #include "net/arch.h"
+00039
+00040 #include "net/opt.h"
+00041 #include "net/pbuf.h"
+00042 #include "net/ipv6/ip_addr.h"
+00043
+00044 u16_t inet_chksum(void *data, u16_t len);
+00045 u16_t inet_chksum_pbuf(struct pbuf *p);
+00046 u16_t inet_chksum_pseudo(struct pbuf *p,
+00047 struct ip_addr *src, struct ip_addr *dest,
+00048 u8_t proto, u32_t proto_len);
+00049
+00050
+00051 #ifndef _MACHINE_ENDIAN_H_
+00052 #ifndef _NETINET_IN_H
+00053 #ifndef _LINUX_BYTEORDER_GENERIC_H
+00054 u16_t htons(u16_t n);
+00055 u16_t ntohs(u16_t n);
+00056 u32_t htonl(u32_t n);
+00057 u32_t ntohl(u32_t n);
+00058 #endif /* _LINUX_BYTEORDER_GENERIC_H */
+00059 #endif /* _NETINET_IN_H */
+00060 #endif /* _MACHINE_ENDIAN_H_ */
+00061
+00062 #endif /* __LWIP_INET_H__ */
+00063
+
Generated on Wed Apr 28 17:49:35 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/ipv6_2inet_8h.html b/doc/doxygen/html/ipv6_2inet_8h.html
new file mode 100644
index 0000000..ee219dd
--- /dev/null
+++ b/doc/doxygen/html/ipv6_2inet_8h.html
@@ -0,0 +1,276 @@
+
+
+Ubixos: ipv6/inet.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:20 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/ipv6_2ip_8h-source.html b/doc/doxygen/html/ipv6_2ip_8h-source.html
new file mode 100644
index 0000000..1a24140
--- /dev/null
+++ b/doc/doxygen/html/ipv6_2ip_8h-source.html
@@ -0,0 +1,111 @@
+
+
+Ubixos: ip.h Source File
+
+
+
+
ip.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035 #ifndef __LWIP_IP_H__
+00036 #define __LWIP_IP_H__
+00037
+00038 #include "lwip/debug.h"
+00039 #include "lwip/def.h"
+00040 #include "lwip/pbuf.h"
+00041 #include "lwip/ip_addr.h"
+00042
+00043 #include "lwip/err.h"
+00044
+00045 #define IP_HLEN 40
+00046
+00047 #define IP_PROTO_ICMP 58
+00048 #define IP_PROTO_UDP 17
+00049 #define IP_PROTO_UDPLITE 170
+00050 #define IP_PROTO_TCP 6
+00051
+00052 /* This is passed as the destination address to ip_output_if (not
+00053 to ip_output), meaning that an IP header already is constructed
+00054 in the pbuf. This is used when TCP retransmits. */
+00055 #ifdef IP_HDRINCL
+00056 #undef IP_HDRINCL
+00057 #endif /* IP_HDRINCL */
+00058 #define IP_HDRINCL NULL
+00059
+00060
+00061 /* The IPv6 header. */
+00062 struct ip_hdr {
+00063 #if BYTE_ORDER == LITTLE_ENDIAN
+00064 u8_t tclass1:4, v:4;
+00065 u8_t flow1:4, tclass2:4;
+00066 #else
+00067 u8_t v:4, tclass1:4;
+00068 u8_t tclass2:8, flow1:4;
+00069 #endif
+00070 u16_t flow2;
+00071 u16_t len; /* payload length */
+00072 u8_t nexthdr; /* next header */
+00073 u8_t hoplim; /* hop limit (TTL) */
+00074 struct ip_addr src, dest; /* source and destination IP addresses */
+00075 };
+00076
+00077 void ip_init(void);
+00078
+00079 #include "lwip/netif.h"
+00080
+00081 struct netif *ip_route(struct ip_addr *dest);
+00082
+00083 void ip_input(struct pbuf *p, struct netif *inp);
+00084
+00085 /* source and destination addresses in network byte order, please */
+00086 err_t ip_output(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest,
+00087 unsignedchar ttl, unsignedchar proto);
+00088
+00089 err_t ip_output_if(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest,
+00090 unsignedchar ttl, unsignedchar proto,
+00091 struct netif *netif);
+00092
+00093 #if IP_DEBUG
+00094 void ip_debug_print(struct pbuf *p);
+00095 #endif /* IP_DEBUG */
+00096
+00097 #endif /* __LWIP_IP_H__ */
+00098
+00099
+
Generated on Wed Apr 28 17:49:35 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/ipv6_2ip_8h.html b/doc/doxygen/html/ipv6_2ip_8h.html
new file mode 100644
index 0000000..f7e03a0
--- /dev/null
+++ b/doc/doxygen/html/ipv6_2ip_8h.html
@@ -0,0 +1,398 @@
+
+
+Ubixos: ipv6/ip.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:20 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/ipv6_2ip__addr_8h-source.html b/doc/doxygen/html/ipv6_2ip__addr_8h-source.html
new file mode 100644
index 0000000..99ed6e8
--- /dev/null
+++ b/doc/doxygen/html/ipv6_2ip__addr_8h-source.html
@@ -0,0 +1,74 @@
+
+
+Ubixos: ip_addr.h Source File
+
+
+
+
ip_addr.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035 #ifndef __LWIP_IP_ADDR_H__
+00036 #define __LWIP_IP_ADDR_H__
+00037
+00038 #include "net/arch.h"
+00039
+00040 #define IP_ADDR_ANY 0
+00041
+00042 struct ip_addr {
+00043 u32_t addr[4];
+00044 };
+00045
+00046 #define IP6_ADDR(ipaddr, a,b,c,d,e,f,g,h) do { (ipaddr)->addr[0] = htonl((u32_t)((a & 0xffff) << 16) | (b & 0xffff)); \
+00047 (ipaddr)->addr[1] = htonl(((c & 0xffff) << 16) | (d & 0xffff)); \
+00048 (ipaddr)->addr[2] = htonl(((e & 0xffff) << 16) | (f & 0xffff)); \
+00049 (ipaddr)->addr[3] = htonl(((g & 0xffff) << 16) | (h & 0xffff)); } while(0)
+00050
+00051 int ip_addr_maskcmp(struct ip_addr *addr1, struct ip_addr *addr2,
+00052 struct ip_addr *mask);
+00053 int ip_addr_cmp(struct ip_addr *addr1, struct ip_addr *addr2);
+00054 void ip_addr_set(struct ip_addr *dest, struct ip_addr *src);
+00055 int ip_addr_isany(struct ip_addr *addr);
+00056
+00057
+00058 #if IP_DEBUG
+00059 void ip_addr_debug_print(struct ip_addr *addr);
+00060 #endif /* IP_DEBUG */
+00061
+00062 #endif /* __LWIP_IP_ADDR_H__ */
+
Generated on Wed Apr 28 17:49:36 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/ipv6_2ip__addr_8h.html b/doc/doxygen/html/ipv6_2ip__addr_8h.html
new file mode 100644
index 0000000..5a50602
--- /dev/null
+++ b/doc/doxygen/html/ipv6_2ip__addr_8h.html
@@ -0,0 +1,263 @@
+
+
+Ubixos: ipv6/ip_addr.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:20 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/kmalloc_8h-source.html b/doc/doxygen/html/kmalloc_8h-source.html
new file mode 100644
index 0000000..488c6af
--- /dev/null
+++ b/doc/doxygen/html/kmalloc_8h-source.html
@@ -0,0 +1,77 @@
+
+
+Ubixos: kmalloc.h Source File
+
+
+
+
kmalloc.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _KMALLOC_H
+00025 #define _KMALLOC_H
+00026
+00027 #include <ubixos/types.h>
+00028
+00029 #ifdef __cplusplus
+00030 extern"C" {
+00031 #endif
+00032
+00033 #define sysMalloc -2
+00034 #define sysID -2
+00035
+00036 struct memDescriptor {
+00037 struct memDescriptor *prev; //4
+00038 struct memDescriptor *next; //4
+00039 void *baseAddr; //4
+00040 uInt32 limit; //4
+00041 uInt8 status; //1
+00042 pidType pid; //4
+00043 char reserved[11]; //11
+00044 };
+00045
+00046 void kfree(void *baseAddr);
+00047 void *kmalloc(uInt32 len,pidType pid);
+00048 void initMalloc(pidType pid);
+00049 void *getEmptyDesc();
+00050 void insertFreeDesc(struct memDescriptor *freeDesc);
+00051 void mergeMemBlocks();
+00052 void kfreeProcess(pidType pid);
+00053
+00054 externstruct memDescriptor *kernDesc;
+00055 externstruct memDescriptor *freeKernDesc;
+00056 externstruct memDescriptor *emptyKernDesc;
+00057
+00058 externint mallocLock;
+00059
+00060 #ifdef __cplusplus
+00061 }
+00062 #endif
+00063
+00064 #endif
+00065
+
Generated on Wed Apr 28 17:49:36 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/kmalloc_8h.html b/doc/doxygen/html/kmalloc_8h.html
new file mode 100644
index 0000000..1164d89
--- /dev/null
+++ b/doc/doxygen/html/kmalloc_8h.html
@@ -0,0 +1,395 @@
+
+
+Ubixos: kmalloc.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:20 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/kpanic_8h-source.html b/doc/doxygen/html/kpanic_8h-source.html
new file mode 100644
index 0000000..f80e2d2
--- /dev/null
+++ b/doc/doxygen/html/kpanic_8h-source.html
@@ -0,0 +1,46 @@
+
+
+Ubixos: kpanic.h Source File
+
+
+
+
kpanic.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _KPANIC_H
+00025 #define _KPANIC_H
+00026
+00027 void kpanic(constchar *fmt, ...);
+00028
+00029 #endif
+00030
+00031 /***
+00032 END
+00033 ***/
+00034
+
Generated on Wed Apr 28 17:49:36 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/kpanic_8h.html b/doc/doxygen/html/kpanic_8h.html
new file mode 100644
index 0000000..1cc0d7b
--- /dev/null
+++ b/doc/doxygen/html/kpanic_8h.html
@@ -0,0 +1,59 @@
+
+
+Ubixos: kpanic.h File Reference
+
+
+
+
+Prints message and halts the system until another interrupt is fired
+
+
+Generated on Sat May 8 09:28:20 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/kprint_8h-source.html b/doc/doxygen/html/kprint_8h-source.html
new file mode 100644
index 0000000..176b0c6
--- /dev/null
+++ b/doc/doxygen/html/kprint_8h-source.html
@@ -0,0 +1,43 @@
+
+
+Ubixos: kprint.h Source File
+
+
+
+
kprint.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _KPRINT_H
+00025 #define _KPRINT_H
+00026
+00027 int kprintf(constchar *fmt, ...);
+00028
+00029 externint printOff;
+00030
+00031 #endif
+
Generated on Wed Apr 28 17:49:36 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/kprint_8h.html b/doc/doxygen/html/kprint_8h.html
new file mode 100644
index 0000000..592044d
--- /dev/null
+++ b/doc/doxygen/html/kprint_8h.html
@@ -0,0 +1,85 @@
+
+
+Ubixos: kprint.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:20 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/kprintf_8h-source.html b/doc/doxygen/html/kprintf_8h-source.html
new file mode 100644
index 0000000..ef5e096
--- /dev/null
+++ b/doc/doxygen/html/kprintf_8h-source.html
@@ -0,0 +1,46 @@
+
+
+Ubixos: kprintf.h Source File
+
+
+
+
kprintf.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _KPRINTF_H
+00025 #define _KPRINTF_H
+00026
+00027 int kprintf(constchar *fmt, ...);
+00028 int ogPrintf(char *);
+00029
+00030 externint printOff;
+00031 externint ogprintOff;
+00032
+00033 #endif
+00034
+
Generated on Wed Apr 28 17:49:36 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/kprintf_8h.html b/doc/doxygen/html/kprintf_8h.html
new file mode 100644
index 0000000..27fdfc6
--- /dev/null
+++ b/doc/doxygen/html/kprintf_8h.html
@@ -0,0 +1,140 @@
+
+
+Ubixos: kprintf.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:20 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/ld_8h-source.html b/doc/doxygen/html/ld_8h-source.html
new file mode 100644
index 0000000..b82088e
--- /dev/null
+++ b/doc/doxygen/html/ld_8h-source.html
@@ -0,0 +1,48 @@
+
+
+Ubixos: ld.h Source File
+
+
+
+
ld.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _LD_H
+00025 #define _LD_H
+00026
+00027 #include <ubixos/types.h>
+00028
+00029 void ld(int,int);
+00030
+00031 #endif
+00032
+00033 /***
+00034 END
+00035 ***/
+00036
+
Generated on Wed Apr 28 17:49:36 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/ld_8h.html b/doc/doxygen/html/ld_8h.html
new file mode 100644
index 0000000..37be488
--- /dev/null
+++ b/doc/doxygen/html/ld_8h.html
@@ -0,0 +1,60 @@
+
+
+Ubixos: ld.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:20 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/lib_2string_8h-source.html b/doc/doxygen/html/lib_2string_8h-source.html
new file mode 100644
index 0000000..a880131
--- /dev/null
+++ b/doc/doxygen/html/lib_2string_8h-source.html
@@ -0,0 +1,61 @@
+
+
+Ubixos: string.h Source File
+
+
+
+
string.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _STRING_H
+00025 #define _STRING_H
+00026
+00027 #include <ubixos/types.h>
+00028
+00029 #ifdef __cplusplus
+00030 extern"C" {
+00031 #endif
+00032
+00033 int kstrcmp(char *str1, char *str2);
+00034 int kstrncmp(constchar * a, constchar * b, size_t c);
+00035 void *kmemcpy(constvoid *dst, constvoid * src, size_t length);
+00036 void *kmemset(void * dst, int c, size_t length);
+00037 int kstrlen(constchar * string);
+00038 int kmemcmp(constvoid * dst, constvoid * src, size_t length);
+00039 void kstrncpy(char * dest, constchar * src, size_t size);
+00040 char *strtok(char *str, constchar *sep);
+00041 char *strtok_r(char *str, constchar *sep, char **last);
+00042
+00043 int sprintf(char *buf,constchar *fmt, ...);
+00044
+00045 #ifdef __cplusplus
+00046 }
+00047 #endif
+00048
+00049 #endif
+
Generated on Wed Apr 28 17:49:40 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/lib_2string_8h.html b/doc/doxygen/html/lib_2string_8h.html
new file mode 100644
index 0000000..749521f
--- /dev/null
+++ b/doc/doxygen/html/lib_2string_8h.html
@@ -0,0 +1,453 @@
+
+
+Ubixos: lib/string.h File Reference
+
+
+
+
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035 #ifndef __ARCH_LIB_H__
+00036 #define __ARCH_LIB_H__
+00037
+00038 #ifndef _STRING_H_
+00039 #ifndef _STRING_H
+00040 intstrlen(constchar *str);
+00041 intstrncmp(constchar *str1, constchar *str2, int len);
+00042 voidbcopy(constvoid *src, void *dest, int len);
+00043 voidbzero(void *data, int n);
+00044 #endif /* _STRING_H */
+00045 #endif /* _STRING_H_ */
+00046
+00047 #endif /* __ARCH_LIB_H__ */
+
Generated on Sat May 8 09:28:17 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/lib_8h.html b/doc/doxygen/html/lib_8h.html
new file mode 100644
index 0000000..2a9d2fb
--- /dev/null
+++ b/doc/doxygen/html/lib_8h.html
@@ -0,0 +1,182 @@
+
+
+Ubixos: lib.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:21 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/list_8h-source.html b/doc/doxygen/html/list_8h-source.html
new file mode 100644
index 0000000..602e9db
--- /dev/null
+++ b/doc/doxygen/html/list_8h-source.html
@@ -0,0 +1,62 @@
+
+
+Ubixos: list.h Source File
+
+
+
+
list.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035 #ifndef __LWIP_LIST_H__
+00036 #define __LWIP_LIST_H__
+00037
+00038 struct list;
+00039
+00040 struct list *list_new(int size);
+00041 int list_push(struct list *list, void *elem);
+00042 void *list_pop(struct list *list);
+00043 int list_remove(struct list *list, void *elem);
+00044 void *list_first(struct list *list);
+00045 int list_elems(struct list *list);
+00046 void list_delete(struct list *list);
+00047
+00048 void list_map(struct list *list, void (* func)(void *arg));
+00049
+00050 #endif /* __LWIP_LIST_H__ */
+
Generated on Wed Apr 28 17:49:37 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/list_8h.html b/doc/doxygen/html/list_8h.html
new file mode 100644
index 0000000..d543a92
--- /dev/null
+++ b/doc/doxygen/html/list_8h.html
@@ -0,0 +1,294 @@
+
+
+Ubixos: list.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:21 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/loopif_8h-source.html b/doc/doxygen/html/loopif_8h-source.html
new file mode 100644
index 0000000..7e2deb1
--- /dev/null
+++ b/doc/doxygen/html/loopif_8h-source.html
@@ -0,0 +1,54 @@
+
+
+Ubixos: loopif.h Source File
+
+
+
+
loopif.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035 #ifndef __NETIF_LOOPIF_H__
+00036 #define __NETIF_LOOPIF_H__
+00037
+00038 #include "net/netif.h"
+00039
+00040 void loopif_init(struct netif *netif);
+00041
+00042 #endif /* __NETIF_LOOPIF_H__ */
+
Generated on Wed Apr 28 17:49:37 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/loopif_8h.html b/doc/doxygen/html/loopif_8h.html
new file mode 100644
index 0000000..161239a
--- /dev/null
+++ b/doc/doxygen/html/loopif_8h.html
@@ -0,0 +1,51 @@
+
+
+Ubixos: loopif.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:21 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/lwipopts_8h-source.html b/doc/doxygen/html/lwipopts_8h-source.html
new file mode 100644
index 0000000..e17c177
--- /dev/null
+++ b/doc/doxygen/html/lwipopts_8h-source.html
@@ -0,0 +1,186 @@
+
+
+Ubixos: lwipopts.h Source File
+
+
+
+
lwipopts.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035 #ifndef __LWIPOPTS_H__
+00036 #define __LWIPOPTS_H__
+00037
+00038 /* ---------- Memory options ---------- */
+00039 /* MEM_ALIGNMENT: should be set to the alignment of the CPU for which
+00040 lwIP is compiled. 4 byte alignment -> define MEM_ALIGNMENT to 4, 2
+00041 byte alignment -> define MEM_ALIGNMENT to 2. */
+00042 #define MEM_ALIGNMENT 2
+00043
+00044 /* MEM_SIZE: the size of the heap memory. If the application will send
+00045 a lot of data that needs to be copied, this should be set high. */
+00046 #define MEM_SIZE 1000
+00047
+00048 /* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application
+00049 sends a lot of data out of ROM (or other static memory), this
+00050 should be set high. */
+00051 #define MEMP_NUM_PBUF 8
+00052 /* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
+00053 per active UDP "connection". */
+00054 #define MEMP_NUM_UDP_PCB 4
+00055 /* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP
+00056 connections. */
+00057 #define MEMP_NUM_TCP_PCB 5
+00058 /* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP
+00059 connections. */
+00060 #define MEMP_NUM_TCP_PCB_LISTEN 8
+00061 /* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP
+00062 segments. */
+00063 #define MEMP_NUM_TCP_SEG 8
+00064 /* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active
+00065 timeouts. */
+00066 #define MEMP_NUM_SYS_TIMEOUT 3
+00067
+00068
+00069 /* The following four are used only with the sequential API and can be
+00070 set to 0 if the application only will use the raw API. */
+00071 /* MEMP_NUM_NETBUF: the number of struct netbufs. */
+00072 #define MEMP_NUM_NETBUF 2
+00073 /* MEMP_NUM_NETCONN: the number of struct netconns. */
+00074 #define MEMP_NUM_NETCONN 4
+00075 /* MEMP_NUM_APIMSG: the number of struct api_msg, used for
+00076 communication between the TCP/IP stack and the sequential
+00077 programs. */
+00078 #define MEMP_NUM_API_MSG 8
+00079 /* MEMP_NUM_TCPIPMSG: the number of struct tcpip_msg, which is used
+00080 for sequential API communication and incoming packets. Used in
+00081 src/api/tcpip.c. */
+00082 #define MEMP_NUM_TCPIP_MSG 8
+00083
+00084 /* These two control is reclaimer functions should be compiled
+00085 in. Should always be turned on (1). */
+00086 #define MEM_RECLAIM 1
+00087 #define MEMP_RECLAIM 1
+00088
+00089 /* ---------- Pbuf options ---------- */
+00090 /* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */
+00091 #define PBUF_POOL_SIZE 6
+00092
+00093 /* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */
+00094 #define PBUF_POOL_BUFSIZE 128
+00095
+00096 /* PBUF_LINK_HLEN: the number of bytes that should be allocated for a
+00097 link level header. */
+00098 #define PBUF_LINK_HLEN 16
+00099
+00100 /* ---------- TCP options ---------- */
+00101 #define LWIP_TCP 1
+00102 #define TCP_TTL 255
+00103
+00104 /* Controls if TCP should queue segments that arrive out of
+00105 order. Define to 0 if your device is low on memory. */
+00106 #define TCP_QUEUE_OOSEQ 1
+00107
+00108 /* TCP Maximum segment size. */
+00109 #define TCP_MSS 128
+00110
+00111 /* TCP sender buffer space (bytes). */
+00112 #define TCP_SND_BUF 256
+00113
+00114 /* TCP sender buffer space (pbufs). This must be at least = 2 *
+00115 TCP_SND_BUF/TCP_MSS for things to work. */
+00116 #define TCP_SND_QUEUELEN 4 * TCP_SND_BUF/TCP_MSS
+00117
+00118 /* TCP receive window. */
+00119 #define TCP_WND 1024
+00120
+00121 /* Maximum number of retransmissions of data segments. */
+00122 #define TCP_MAXRTX 12
+00123
+00124 /* Maximum number of retransmissions of SYN segments. */
+00125 #define TCP_SYNMAXRTX 4
+00126
+00127 /* ---------- ARP options ---------- */
+00128 #define ARP_TABLE_SIZE 10
+00129
+00130 /* ---------- IP options ---------- */
+00131 /* Define IP_FORWARD to 1 if you wish to have the ability to forward
+00132 IP packets across network interfaces. If you are going to run lwIP
+00133 on a device with only one network interface, define this to 0. */
+00134 #define IP_FORWARD 1
+00135
+00136 /* If defined to 1, IP options are allowed (but not parsed). If
+00137 defined to 0, all packets with IP options are dropped. */
+00138 #define IP_OPTIONS 1
+00139
+00140 /* ---------- ICMP options ---------- */
+00141 #define ICMP_TTL 255
+00142
+00143
+00144 /* ---------- DHCP options ---------- */
+00145 /* Define LWIP_DHCP to 1 if you want DHCP configuration of
+00146 interfaces. DHCP is not implemented in lwIP 0.5.1, however, so
+00147 turning this on does currently not work. */
+00148 #define LWIP_DHCP 0
+00149
+00150 /* 1 if you want to do an ARP check on the offered address
+00151 (recommended). */
+00152 #define DHCP_DOES_ARP_CHECK 1
+00153
+00154 /* ---------- UDP options ---------- */
+00155 #define LWIP_UDP 1
+00156 #define UDP_TTL 255
+00157
+00158
+00159 /* ---------- Statistics options ---------- */
+00160 #define STATS
+00161
+00162 #ifdef STATS
+00163 #define LINK_STATS
+00164 #define IP_STATS
+00165 #define ICMP_STATS
+00166 #define UDP_STATS
+00167 #define TCP_STATS
+00168 #define MEM_STATS
+00169 #define MEMP_STATS
+00170 #define PBUF_STATS
+00171 #define SYS_STATS
+00172 #endif /* STATS */
+00173
+00174 #endif /* __LWIPOPTS_H__ */
+
Generated on Wed Apr 28 17:49:37 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/lwipopts_8h.html b/doc/doxygen/html/lwipopts_8h.html
new file mode 100644
index 0000000..a9b48c0
--- /dev/null
+++ b/doc/doxygen/html/lwipopts_8h.html
@@ -0,0 +1,1075 @@
+
+
+Ubixos: lwipopts.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:22 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/mem_8h-source.html b/doc/doxygen/html/mem_8h-source.html
new file mode 100644
index 0000000..cef72d1
--- /dev/null
+++ b/doc/doxygen/html/mem_8h-source.html
@@ -0,0 +1,92 @@
+
+
+Ubixos: mem.h Source File
+
+
+
+
mem.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035 #ifndef __LWIP_MEM_H__
+00036 #define __LWIP_MEM_H__
+00037
+00038 #include <ubixos/types.h>
+00039
+00040 #include "net/debug.h"
+00041 #include "net/opt.h"
+00042 #include "net/arch.h"
+00043
+00044 #if MEM_SIZE > 64000l
+00045 typedef uInt32 mem_size_t;
+00046 #else
+00047 typedef uInt16 mem_size_t;
+00048 #endif /* MEM_SIZE > 64000 */
+00049
+00050
+00051 void mem_init(void);
+00052
+00053 void *mem_malloc(mem_size_t size);
+00054 void *mem_malloc2(mem_size_t size);
+00055 void mem_free(void *mem);
+00056 void *mem_realloc(void *mem, mem_size_t size);
+00057 void *mem_reallocm(void *mem, mem_size_t size);
+00058
+00059 #ifdef MEM_PERF
+00060 void mem_perf_start(void);
+00061 void mem_perf_init(char *fname);
+00062 #endif /* MEM_PERF */
+00063
+00064 #ifdef MEM_RECLAIM
+00065 typedef mem_size_t (*mem_reclaim_func)(void *arg, mem_size_t size);
+00066 void mem_register_reclaim(mem_reclaim_func f, void *arg);
+00067 void mem_reclaim(unsignedint size);
+00068 #else
+00069 #define mem_register_reclaim(f, arg)
+00070 #endif /* MEM_RECLAIM */
+00071
+00072
+00073 #define MEM_ALIGN_SIZE(size) (size + \
+00074 ((((size) % MEM_ALIGNMENT) == 0)? 0 : \
+00075 (MEM_ALIGNMENT - ((size) % MEM_ALIGNMENT))))
+00076
+00077 #define MEM_ALIGN(addr) (void *)MEM_ALIGN_SIZE((uInt32)addr)
+00078
+00079 #endif /* __LWIP_MEM_H__ */
+00080
+
Generated on Wed Apr 28 17:49:37 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/mem_8h.html b/doc/doxygen/html/mem_8h.html
new file mode 100644
index 0000000..44feb75
--- /dev/null
+++ b/doc/doxygen/html/mem_8h.html
@@ -0,0 +1,348 @@
+
+
+Ubixos: mem.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:22 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/memp_8h-source.html b/doc/doxygen/html/memp_8h-source.html
new file mode 100644
index 0000000..96c969e
--- /dev/null
+++ b/doc/doxygen/html/memp_8h-source.html
@@ -0,0 +1,91 @@
+
+
+Ubixos: memp.h Source File
+
+
+
+
memp.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035
+00036 #ifndef __LWIP_MEMP_H__
+00037 #define __LWIP_MEMP_H__
+00038
+00039 #include <ubixos/types.h>
+00040
+00041 #include "net/debug.h"
+00042 #include "net/arch/cc.h"
+00043 #include "net/lwipopts.h"
+00044
+00045 typedefenum {
+00046 MEMP_PBUF,
+00047 MEMP_UDP_PCB,
+00048 MEMP_TCP_PCB,
+00049 MEMP_TCP_PCB_LISTEN,
+00050 MEMP_TCP_SEG,
+00051
+00052 MEMP_NETBUF,
+00053 MEMP_NETCONN,
+00054 MEMP_API_MSG,
+00055 MEMP_TCPIP_MSG,
+00056
+00057 MEMP_SYS_TIMEOUT,
+00058
+00059 MEMP_MAX
+00060 } memp_t;
+00061
+00062 void memp_init(void);
+00063
+00064 void *memp_malloc(memp_t type);
+00065 void *memp_mallocp(memp_t type);
+00066 void *memp_malloc2(memp_t type);
+00067 void *memp_realloc(memp_t fromtype, memp_t totype, void *mem);
+00068 void memp_free(memp_t type, void *mem);
+00069 void memp_freep(memp_t type, void *mem);
+00070
+00071 #if MEMP_RECLAIM
+00072 typedef uInt8 (*memp_reclaim_func)(void *arg, memp_t type);
+00073 void memp_register_reclaim(memp_t type, memp_reclaim_func f, void *arg);
+00074 #else
+00075 #define memp_register_reclaim(t, f, arg)
+00076 #endif /* MEMP_RECLAIM */
+00077
+00078 #endif /* __LWIP_MEMP_H__ */
+00079
+
Generated on Wed Apr 28 17:49:37 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/memp_8h.html b/doc/doxygen/html/memp_8h.html
new file mode 100644
index 0000000..aa83e86
--- /dev/null
+++ b/doc/doxygen/html/memp_8h.html
@@ -0,0 +1,377 @@
+
+
+Ubixos: memp.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:22 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/mount_8h-source.html b/doc/doxygen/html/mount_8h-source.html
new file mode 100644
index 0000000..edbd31e
--- /dev/null
+++ b/doc/doxygen/html/mount_8h-source.html
@@ -0,0 +1,58 @@
+
+
+Ubixos: mount.h Source File
+
+
+
+
mount.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _MOUNT_H
+00025 #define _MOUNT_H
+00026
+00027 #include <ubixos/types.h>
+00028
+00029 struct mountPoints {
+00030 struct mountPoints *prev;
+00031 struct mountPoints *next;
+00032 struct fileSystem *fs;
+00033 struct deviceNode *device;
+00034 struct ubixDiskLabel *diskLabel;
+00035 void *fsInfo;
+00036 int partition;
+00037 char mountPoint[1024];
+00038 char perms;
+00039 };
+00040
+00041 int mount(int driveId,int partition,int fsType,char *mountPoint,char *perms);
+00042 int addMount(struct mountPoints *mp);
+00043 struct mountPoints *findMount(char *mountPoint);
+00044
+00045 #endif
+00046
+
Generated on Wed Apr 28 17:49:37 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/mount_8h.html b/doc/doxygen/html/mount_8h.html
new file mode 100644
index 0000000..5fc618a
--- /dev/null
+++ b/doc/doxygen/html/mount_8h.html
@@ -0,0 +1,149 @@
+
+
+Ubixos: mount.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:22 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/net_8h-source.html b/doc/doxygen/html/net_8h-source.html
new file mode 100644
index 0000000..99e551e
--- /dev/null
+++ b/doc/doxygen/html/net_8h-source.html
@@ -0,0 +1,48 @@
+
+
+Ubixos: net.h Source File
+
+
+
+
net.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _NET_H
+00025 #define _NET_H
+00026
+00027 #include <ubixos/types.h>
+00028
+00029 void netInit();
+00030
+00031 #endif
+00032
+00033 /***
+00034 END
+00035 ***/
+00036
+
Generated on Wed Apr 28 17:49:38 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/net_8h.html b/doc/doxygen/html/net_8h.html
new file mode 100644
index 0000000..84fbf21
--- /dev/null
+++ b/doc/doxygen/html/net_8h.html
@@ -0,0 +1,50 @@
+
+
+Ubixos: net.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:22 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/netif_8h-source.html b/doc/doxygen/html/netif_8h-source.html
new file mode 100644
index 0000000..70c42d4
--- /dev/null
+++ b/doc/doxygen/html/netif_8h-source.html
@@ -0,0 +1,111 @@
+
+
+Ubixos: netif.h Source File
+
+
+
+
netif.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035 #ifndef __LWIP_NETIF_H__
+00036 #define __LWIP_NETIF_H__
+00037
+00038 #include "net/opt.h"
+00039
+00040 #include "net/err.h"
+00041
+00042 #include "net/ipv4/ip_addr.h"
+00043 #include "net/ipv4/inet.h"
+00044
+00045 #include "net/pbuf.h"
+00046
+00047
+00048 struct netif {
+00049 struct netif *next;
+00050 uInt8 num;
+00051 struct ip_addr ip_addr;
+00052 struct ip_addr netmask; /* netmask in network byte order */
+00053 struct ip_addr gw;
+00054 char hwaddr[6];
+00055
+00056 /* This function is called by the network device driver
+00057 when it wants to pass a packet to the TCP/IP stack. */
+00058 err_t (* input)(struct pbuf *p, struct netif *inp);
+00059
+00060 /* The following two fields should be filled in by the
+00061 initialization function for the device driver. */
+00062
+00063 char name[2];
+00064 /* This function is called by the IP module when it wants
+00065 to send a packet on the interface. */
+00066 err_t (* output)(struct netif *netif, struct pbuf *p, struct ip_addr *ipaddr);
+00067 err_t (* linkoutput)(struct netif *netif, struct pbuf *p);
+00068
+00069 /* This field can be set bu the device driver and could point
+00070 to state information for the device. */
+00071 void *state;
+00072 };
+00073
+00074 /* The list of network interfaces. */
+00075 externstruct netif *netif_list;
+00076 externstruct netif *netif_default;
+00077
+00078
+00079 /* netif_init() must be called first. */
+00080 void netif_init();
+00081
+00082 struct netif *netif_add(struct ip_addr *ipaddr, struct ip_addr *netmask,
+00083 struct ip_addr *gw,
+00084 void (* init)(struct netif *netif),
+00085 err_t (* input)(struct pbuf *p, struct netif *netif));
+00086
+00087 /* Returns a network interface given its name. The name is of the form
+00088 "et0", where the first two letters are the "name" field in the
+00089 netif structure, and the digit is in the num field in the same
+00090 structure. */
+00091 struct netif *netif_find(char *name);
+00092
+00093 void netif_set_default(struct netif *netif);
+00094
+00095 void netif_set_ipaddr(struct netif *netif, struct ip_addr *ipaddr);
+00096 void netif_set_netmask(struct netif *netif, struct ip_addr *netmast);
+00097 void netif_set_gw(struct netif *netif, struct ip_addr *gw);
+00098
+00099 #endif /* __LWIP_NETIF_H__ */
+
Generated on Wed Apr 28 17:49:38 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/netif_8h.html b/doc/doxygen/html/netif_8h.html
new file mode 100644
index 0000000..5be388a
--- /dev/null
+++ b/doc/doxygen/html/netif_8h.html
@@ -0,0 +1,347 @@
+
+
+Ubixos: netif.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:22 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/opt_8h-source.html b/doc/doxygen/html/opt_8h-source.html
new file mode 100644
index 0000000..20227d0
--- /dev/null
+++ b/doc/doxygen/html/opt_8h-source.html
@@ -0,0 +1,109 @@
+
+
+Ubixos: opt.h Source File
+
+
+
+
opt.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035 #ifndef __LWIP_OPT_H__
+00036 #define __LWIP_OPT_H__
+00037
+00038 #include "net/lwipopts.h"
+00039
+00040 /* Define some handy default values for configuration parameters. */
+00041
+00042 #ifndef ICMP_TTL
+00043 #define ICMP_TTL 255
+00044 #endif
+00045
+00046 #ifndef UDP_TTL
+00047 #define UDP_TTL 255
+00048 #endif
+00049
+00050 #ifndef TCP_TTL
+00051 #define TCP_TTL 255
+00052 #endif
+00053
+00054 #ifndef TCP_MSS
+00055 #define TCP_MSS 128 /* A *very* conservative default. */
+00056 #endif
+00057
+00058 #ifndef TCP_WND
+00059 #define TCP_WND 2048
+00060 #endif
+00061
+00062 #ifndef TCP_MAXRTX
+00063 #define TCP_MAXRTX 12
+00064 #endif
+00065
+00066 #ifndef TCP_SYNMAXRTX
+00067 #define TCP_SYNMAXRTX 6
+00068 #endif
+00069
+00070 #ifndef MEM_ALIGNMENT
+00071 #define MEM_ALIGNMENT 1
+00072 #endif
+00073
+00074 #ifndef PBUF_POOL_SIZE
+00075 #define PBUF_POOL_SIZE 16
+00076 #endif
+00077
+00078 #ifndef PBUF_POOL_BUFSIZE
+00079 #define PBUF_POOL_BUFSIZE 128
+00080 #endif
+00081
+00082 #ifndef PBUF_LINK_HLEN
+00083 #define PBUF_LINK_HLEN 0
+00084 #endif
+00085
+00086 #ifndef LWIP_UDP
+00087 #define LWIP_UDP 1
+00088 #endif
+00089
+00090 #ifndef LWIP_TCP
+00091 #define LWIP_TCP 1
+00092 #endif
+00093
+00094 #endif /* __LWIP_OPT_H__ */
+00095
+00096
+00097
+
Generated on Wed Apr 28 17:49:38 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/opt_8h.html b/doc/doxygen/html/opt_8h.html
new file mode 100644
index 0000000..20e95ec
--- /dev/null
+++ b/doc/doxygen/html/opt_8h.html
@@ -0,0 +1,332 @@
+
+
+Ubixos: opt.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:22 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/paging_8h-source.html b/doc/doxygen/html/paging_8h-source.html
new file mode 100644
index 0000000..76bd175
--- /dev/null
+++ b/doc/doxygen/html/paging_8h-source.html
@@ -0,0 +1,73 @@
+
+
+Ubixos: paging.h Source File
+
+
+
+
paging.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _PAGING_H
+00025 #define _PAGING_H
+00026
+00027 #include <ubixos/types.h>
+00028
+00029 #define pageLength 0x00000400
+00030 #define pageSize 4096
+00031 #define pageEntries (pageSize/4)
+00032 #define pagePresent 0x00000001
+00033 #define pageWrite 0x00000002
+00034 #define pageUser 0x00000004
+00035 #define pageCow 0x00000200
+00036 #define pageStack 0x00000400
+00037 #define pageDefault (pagePresent|pageWrite|pageUser)
+00038 #define kernelPageDefault (pagePresent|pageWrite)
+00039 #define tablesBaseAddress 0xBFC00000
+00040 #define parentPageDirAddr 0x100000
+00041
+00042 int vmmPagingInit();
+00043 int vmmClearVirtualPage(uInt32 pageAddr);
+00044 int vmmRemapPage(uInt32,uInt32);
+00045 void vmmUnmapPage(uInt32,int);
+00046 void vmmUnmapPages(void *,uInt32);
+00047 void vmmSetPageAttribute(uInt32,int);
+00048 void *vmmMapFromTask(pidType,void *,uInt32);
+00049 void *vmmCopyVirtualSpace(pidType);
+00050 void *vmmGetFreePage(pidType);
+00051 void *vmmGetFreeKernelPage(pidType pid,uInt16 count);
+00052 void *vmmGetPhysicalAddr(uInt32);
+00053 void *vmmCreateVirtualSpace(pidType);
+00054 void *vmmGetFreeVirtualPage(pidType,int);
+00055 void vmmPageFault();
+00056 void _vmmPageFault();
+00057
+00058 extern uInt32 *kernelPageDirectory;
+00059
+00060 #endif
+00061
+
Generated on Wed Apr 28 17:49:39 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/paging_8h.html b/doc/doxygen/html/paging_8h.html
new file mode 100644
index 0000000..cf51e83
--- /dev/null
+++ b/doc/doxygen/html/paging_8h.html
@@ -0,0 +1,867 @@
+
+
+Ubixos: paging.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:22 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/pbuf_8h-source.html b/doc/doxygen/html/pbuf_8h-source.html
new file mode 100644
index 0000000..17e3a62
--- /dev/null
+++ b/doc/doxygen/html/pbuf_8h-source.html
@@ -0,0 +1,164 @@
+
+
+Ubixos: pbuf.h Source File
+
+
+
+
pbuf.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035 /*-----------------------------------------------------------------------------------*/
+00036 #ifndef __LWIP_PBUF_H__
+00037 #define __LWIP_PBUF_H__
+00038
+00039 #include "net/debug.h"
+00040 #include "net/arch.h"
+00041
+00042
+00043 #define PBUF_TRANSPORT_HLEN 20
+00044 #define PBUF_IP_HLEN 20
+00045
+00046 typedefenum {
+00047 PBUF_TRANSPORT,
+00048 PBUF_IP,
+00049 PBUF_LINK,
+00050 PBUF_RAW
+00051 } pbuf_layer;
+00052
+00053 typedefenum {
+00054 PBUF_RAM,
+00055 PBUF_ROM,
+00056 PBUF_POOL
+00057 } pbuf_flag;
+00058
+00059 /* Definitions for the pbuf flag field (these are not the flags that
+00060 are passed to pbuf_alloc()). */
+00061 #define PBUF_FLAG_RAM 0x00 /* Flags that pbuf data is stored in RAM. */
+00062 #define PBUF_FLAG_ROM 0x01 /* Flags that pbuf data is stored in ROM. */
+00063 #define PBUF_FLAG_POOL 0x02 /* Flags that the pbuf comes from the
+00064 pbuf pool. */
+00065
+00066 struct pbuf {
+00067 struct pbuf *next;
+00068
+00069 /* high 4 bits, flags, low 4 bits reference count */
+00070 uInt8 flags, ref;
+00071 void *payload;
+00072
+00073 /* Total length of buffer + additionally chained buffers. */
+00074 uInt16 tot_len;
+00075 /* Length of this buffer. */
+00076 uInt16 len;
+00077
+00078 };
+00079
+00080 /* pbuf_init():
+00081
+00082 Initializes the pbuf module. The num parameter determines how many
+00083 pbufs that should be allocated to the pbuf pool, and the size
+00084 parameter specifies the size of the data allocated to those. */
+00085 void pbuf_init(void);
+00086
+00087 /* pbuf_alloc():
+00088
+00089 Allocates a pbuf at protocol layer l. The actual memory allocated
+00090 for the pbuf is determined by the layer at which the pbuf is
+00091 allocated and the requested size (from the size parameter). The
+00092 flag parameter decides how and where the pbuf should be allocated
+00093 as follows:
+00094
+00095 * PBUF_RAM: buffer memory for pbuf is allocated as one large
+00096 chunk. This includesprotocol headers as well.
+00097
+00098 * RBUF_ROM: no buffer memory is allocated for the pbuf, even for
+00099 protocol headers. Additional headers must be
+00100 prepended by allocating another pbuf and chain in to
+00101 the front of the ROM pbuf.
+00102
+00103 * PBUF_ROOL: the pbuf is allocated as a pbuf chain, with pbufs from
+00104 the pbuf pool that is allocated during pbuf_init(). */
+00105 struct pbuf *pbuf_alloc(pbuf_layer l, uInt16 size, pbuf_flag flag);
+00106
+00107 /* pbuf_realloc():
+00108
+00109 Shrinks the pbuf to the size given by the size parameter.
+00110 */
+00111 void pbuf_realloc(struct pbuf *p, uInt16 size);
+00112
+00113 /* pbuf_header():
+00114
+00115 Tries to move the p->payload pointer header_size number of bytes
+00116 upward within the pbuf. The return value is non-zero if it
+00117 fails. If so, an additional pbuf should be allocated for the header
+00118 and it should be chained to the front. */
+00119 uInt8 pbuf_header(struct pbuf *p, Int16 header_size);
+00120
+00121 /* pbuf_ref():
+00122
+00123 Increments the reference count of the pbuf p.
+00124 */
+00125 void pbuf_ref(struct pbuf *p);
+00126
+00127 /* pbuf_free():
+00128
+00129 Decrements the reference count and deallocates the pbuf if the
+00130 reference count is zero. If the pbuf is a chain all pbufs in the
+00131 chain are deallocated. */
+00132 uInt8 pbuf_free(struct pbuf *p);
+00133
+00134 /* pbuf_clen():
+00135
+00136 Returns the length of the pbuf chain. */
+00137 uInt8 pbuf_clen(struct pbuf *p);
+00138
+00139 /* pbuf_chain():
+00140
+00141 Chains pbuf t on the end of pbuf h. Pbuf h will have it's tot_len
+00142 field adjusted accordingly. Pbuf t should no be used any more after
+00143 a call to this function, since pbuf t is now a part of pbuf h. */
+00144 void pbuf_chain(struct pbuf *h, struct pbuf *t);
+00145
+00146 /* pbuf_dechain():
+00147
+00148 Picks off the first pbuf from the pbuf chain p. Returns the tail of
+00149 the pbuf chain or NULL if the pbuf p was not chained. */
+00150 struct pbuf *pbuf_dechain(struct pbuf *p);
+00151
+00152 #endif /* __LWIP_PBUF_H__ */
+
Generated on Wed Apr 28 17:49:39 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/pbuf_8h.html b/doc/doxygen/html/pbuf_8h.html
new file mode 100644
index 0000000..391e14f
--- /dev/null
+++ b/doc/doxygen/html/pbuf_8h.html
@@ -0,0 +1,546 @@
+
+
+Ubixos: pbuf.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:22 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/pci_8h-source.html b/doc/doxygen/html/pci_8h-source.html
new file mode 100644
index 0000000..4101085
--- /dev/null
+++ b/doc/doxygen/html/pci_8h-source.html
@@ -0,0 +1,91 @@
+
+
+Ubixos: pci.h Source File
+
+
+
+
pci.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _PCI_H
+00025 #define _PCI_H
+00026
+00027 #include <ubixos/types.h>
+00028
+00029
+00030 struct pciConfig {
+00031 uInt16 vendorId;
+00032 uInt16 deviceId;
+00033
+00034 uInt16 command;
+00035 uInt16 status;
+00036
+00037 uInt8 revisionId;
+00038 uInt8 interface;
+00039 uInt8 subClass;
+00040 uInt8 baseClass;
+00041
+00042 uInt8 cacheLineSize;
+00043 uInt8 latencyTimer;
+00044 uInt8 headerType;
+00045 uInt8 bist;
+00046
+00047 /* device info */
+00048 uInt8 bus;
+00049 uInt8 dev;
+00050 uInt8 func;
+00051 uInt8 irq;
+00052
+00053 /* base registers */
+00054 uInt32 base[6];
+00055 uInt32 size[6];
+00056
+00057 uInt16 subsysVendor;
+00058 uInt16 subsys;
+00059
+00060 };
+00061
+00062 struct confadd {
+00063 uInt8 reg:8;
+00064 uInt8 func:3;
+00065 uInt8 dev:5;
+00066 uInt8 bus:8;
+00067 uInt8 rsvd:7;
+00068 uInt8 enable:1;
+00069 };
+00070
+00071 #define countof(a) (sizeof(a) / sizeof(a[0]))
+00072
+00073 int pciInit();
+00074 bool pciProbe(int bus,int dev,int func,struct pciConfig *cfg);
+00075 uInt32 pciRead(int bus, int dev, int func, int reg, int bytes);
+00076 void pciWrite(int bus,int dev,int func,int reg,uInt32 v,int bytes);
+00077
+00078 #endif
+00079
+
Generated on Wed Apr 28 17:49:39 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/pci_8h.html b/doc/doxygen/html/pci_8h.html
new file mode 100644
index 0000000..45def42
--- /dev/null
+++ b/doc/doxygen/html/pci_8h.html
@@ -0,0 +1,260 @@
+
+
+Ubixos: pci.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:22 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/perf_8h-source.html b/doc/doxygen/html/perf_8h-source.html
new file mode 100644
index 0000000..dc3685e
--- /dev/null
+++ b/doc/doxygen/html/perf_8h-source.html
@@ -0,0 +1,78 @@
+
+
+Ubixos: perf.h Source File
+
+
+
+
perf.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035 #ifndef __ARCH_PERF_H__
+00036 #define __ARCH_PERF_H__
+00037
+00038 #include <ubixos/times.h>
+00039
+00040 #ifdef PERF
+00041 #define PERF_START { \
+00042 unsigned long __c1l, __c1h, __c2l, __c2h; \
+00043 __asm__(".byte 0x0f, 0x31" : "=a" (__c1l), "=d" (__c1h))
+00044 #define PERF_STOP(x) __asm__(".byte 0x0f, 0x31" : "=a" (__c2l), "=d" (__c2h)); \
+00045 perf_print(__c1l, __c1h, __c2l, __c2h, x);}
+00046
+00047 /*#define PERF_START do { \
+00048 struct tms __perf_start, __perf_end; \
+00049 times(&__perf_start)
+00050 #define PERF_STOP(x) times(&__perf_end); \
+00051 perf_print_times(&__perf_start, &__perf_end, x);\
+00052 } while(0)*/
+00053 #else /* PERF */
+00054 #define PERF_START /* null definition */
+00055 #define PERF_STOP(x) /* null definition */
+00056 #endif /* PERF */
+00057
+00058 void perf_print(unsignedlong c1l, unsignedlong c1h,
+00059 unsignedlong c2l, unsignedlong c2h,
+00060 char *key);
+00061
+00062 void perf_print_times(struct tms *start, struct tms *end, char *key);
+00063
+00064 void perf_init(char *fname);
+00065
+00066 #endif /* __ARCH_PERF_H__ */
+
Generated on Wed Apr 28 17:49:39 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/perf_8h.html b/doc/doxygen/html/perf_8h.html
new file mode 100644
index 0000000..7e2c327
--- /dev/null
+++ b/doc/doxygen/html/perf_8h.html
@@ -0,0 +1,210 @@
+
+
+Ubixos: perf.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:22 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/sched_8h-source.html b/doc/doxygen/html/sched_8h-source.html
new file mode 100644
index 0000000..f626332
--- /dev/null
+++ b/doc/doxygen/html/sched_8h-source.html
@@ -0,0 +1,102 @@
+
+
+Ubixos: sched.h Source File
+
+
+
+
sched.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _SCHED_H
+00025 #define _SCHED_H
+00026
+00027 #ifdef __cplusplus
+00028 extern"C" {
+00029 #endif
+00030
+00031 #include <ubixos/types.h>
+00032 #include <ubixos/elf.h>
+00033 #include <vfs/file.h>
+00034 #include <sys/tss.h>
+00035
+00036
+00037 typedefenum { DEAD=-1,NEW=0,READY=1,RUNNING=2,IDLE=3 } tState;
+00038
+00039 struct osInfo {
+00040 struct mountPoints *container;
+00041 elfSectionheader *sectionHeader;
+00042 struct taskFileInfo fileInfo;
+00043 struct consoleStruct *terminal;
+00044 uInt16 sectionCount;
+00045 uInt16 stringSection;
+00046 uInt8 timer;
+00047 uInt8 v86Task;
+00048 bool v86If;
+00049 uInt32 curDir;
+00050 uInt32 vmStart;
+00051 uInt32 stdinSize;
+00052 uInt32 controlKeys;
+00053 char *stdin;
+00054 char *shstrtab;
+00055 char *cwd;
+00056 };
+00057
+00058 typedefstruct taskStruct {
+00059 pidType id;
+00060 struct taskStruct *prev;
+00061 struct taskStruct *next;
+00062 struct tssStruct tss;
+00063 struct i387Struct i387;
+00064 struct osInfo oInfo;
+00065 tState state;
+00066 uInt32 gid;
+00067 uInt32 uid;
+00068 uInt16 usedMath;
+00069 } kTask_t;
+00070
+00071
+00072 int schedInit();
+00073 void sched();
+00074 void schedYield();
+00075 int schedEndTask(pidType pid);
+00076 kTask_t *schedNewTask();
+00077 kTask_t *schedFindTask(uInt32 id);
+00078 int deleteTask(uInt32);
+00079
+00080 extern kTask_t *taskList;
+00081 extern uInt32 nextID;
+00082 extern kTask_t *_current;
+00083 extern kTask_t *_usedMath;
+00084
+00085 #ifdef __cplusplus
+00086 }
+00087 #endif
+00088
+00089 #endif
+00090
+
Generated on Wed Apr 28 17:49:39 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/sched_8h.html b/doc/doxygen/html/sched_8h.html
new file mode 100644
index 0000000..312c573
--- /dev/null
+++ b/doc/doxygen/html/sched_8h.html
@@ -0,0 +1,413 @@
+
+
+Ubixos: sched.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:22 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/sde_8h-source.html b/doc/doxygen/html/sde_8h-source.html
new file mode 100644
index 0000000..3b46610
--- /dev/null
+++ b/doc/doxygen/html/sde_8h-source.html
@@ -0,0 +1,67 @@
+
+
+Ubixos: sde.h Source File
+
+
+
+
sde.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _SDE_H
+00025 #define _SDE_H
+00026
+00027 #include <ubixos/types.h>
+00028
+00029 #define registerWindow 1
+00030 #define windowReady 2
+00031 #define drawWindow 3
+00032 #define killWindow 4
+00033
+00034 #ifdef __cplusplus
+00035 extern"C"
+00036 #endif
+00037 void sdeThread();
+00038
+00039 #ifdef __cplusplus
+00040 extern"C"
+00041 #endif
+00042 void sysSDE(uInt32 cmd,void *ptr);
+00043
+00044 struct sdeWindows {
+00045 struct sdeWindows *next;
+00046 struct sdeWindows *prev;
+00047 void *buf;
+00048 pidType pid;
+00049 uInt8 status;
+00050 };
+00051
+00052 externstruct sdeWindows *windows;
+00053
+00054 #endif
+00055
+
Generated on Wed Apr 28 17:49:39 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/sde_8h.html b/doc/doxygen/html/sde_8h.html
new file mode 100644
index 0000000..985dbb9
--- /dev/null
+++ b/doc/doxygen/html/sde_8h.html
@@ -0,0 +1,217 @@
+
+
+Ubixos: sde.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:22 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/shell_8h-source.html b/doc/doxygen/html/shell_8h-source.html
new file mode 100644
index 0000000..34e5310
--- /dev/null
+++ b/doc/doxygen/html/shell_8h-source.html
@@ -0,0 +1,52 @@
+
+
+Ubixos: shell.h Source File
+
+
+
+
shell.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035 #ifndef __SHELL_H__
+00036 #define __SHELL_H__
+00037
+00038 void shell_init(void);
+00039
+00040 #endif /* __SHELL_H__ */
+
Generated on Wed Apr 28 17:49:39 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/smp_8h-source.html b/doc/doxygen/html/smp_8h-source.html
new file mode 100644
index 0000000..abee3d5
--- /dev/null
+++ b/doc/doxygen/html/smp_8h-source.html
@@ -0,0 +1,71 @@
+
+
+Ubixos: smp.h Source File
+
+
+
+
00001 /*****************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are
+00006 permitted provided that the following conditions are met:
+00007
+00008 Redistributions of source code must retain the above copyright notice, this list of
+00009 conditions, the following disclaimer and the list of authors. Redistributions in binary
+00010 form must reproduce the above copyright notice, this list of conditions, the following
+00011 disclaimer and the list of authors in the documentation and/or other materials provided
+00012 with the distribution. Neither the name of the UbixOS Project nor the names of its
+00013 contributors may be used to endorse or promote products derived from this software
+00014 without specific prior written permission.
+00015
+00016 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+00017 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+00018 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+00019 THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+00020 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+00021 OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00022 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+00023 TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+00024 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00025
+00026 $Id$
+00027
+00028 *****************************************************************************************/
+00029
+00030 #ifndef _SMP_H
+00031 #define _SMP_H
+00032
+00033 #include <ubixos/types.h>
+00034
+00036struct cpuinfo_t {
+00037uInt8id;
+00038uInt8ok;
+00039uInt8apic_id,apic_ver;
+00040uInt32signature;
+00041uInt32feature;
+00042uInt32max;
+00043charbrand[49];
+00044charident[17];
+00045 };
+00046
+00048 voidsmpInit();
+00050 voidcpuidDetect();
+00051 uInt8cpuInfo();
+00053 uInt32getEflags();
+00055 voidsetEflags(uInt32);
+00057 voidcpuid(uInt32,uInt32 *);
+00058 voidapicMagic();
+00059
+00060 #endif
+00061
+00062 /***
+00063 END
+00064 ***/
+00065
+
Generated on Sat May 8 09:28:18 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/smp_8h.html b/doc/doxygen/html/smp_8h.html
new file mode 100644
index 0000000..03115fb
--- /dev/null
+++ b/doc/doxygen/html/smp_8h.html
@@ -0,0 +1,244 @@
+
+
+Ubixos: smp.h File Reference
+
+
+
+
+Inits multi-processor system and calls cpuiddetect and cpuid
+
+
+Generated on Sat May 8 09:28:22 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/sockets_8h-source.html b/doc/doxygen/html/sockets_8h-source.html
new file mode 100644
index 0000000..fd18db7
--- /dev/null
+++ b/doc/doxygen/html/sockets_8h-source.html
@@ -0,0 +1,116 @@
+
+
+Ubixos: sockets.h Source File
+
+
+
+
sockets.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035
+00036
+00037 #ifndef __LWIP_SOCKETS_H__
+00038 #define __LWIP_SOCKETS_H__
+00039
+00040 #include <ubixos/types.h>
+00041
+00042 struct in_addr {
+00043 uInt32 s_addr;
+00044 };
+00045
+00046
+00047 struct sockaddr_in {
+00048 uInt8 sin_len;
+00049 uInt8 sin_family;
+00050 uInt16 sin_port;
+00051 struct in_addr sin_addr;
+00052 char sin_zero[8];
+00053 };
+00054
+00055 struct sockaddr {
+00056 uInt8 sa_len;
+00057 uInt8 sa_family;
+00058 char sa_data[14];
+00059 };
+00060
+00061 #define SOCK_STREAM 1
+00062 #define SOCK_DGRAM 2
+00063
+00064 #define AF_INET 2
+00065 #define PF_INET AF_INET
+00066
+00067 #define IPPROTO_TCP 6
+00068 #define IPPROTO_UDP 17
+00069
+00070 #define INADDR_ANY 0
+00071 #define INADDR_BROADCAST 0xffffffff
+00072
+00073 int lwip_accept(int s, struct sockaddr *addr, int *addrlen);
+00074 int lwip_bind(int s, struct sockaddr *name, int namelen);
+00075 int lwip_close(int s);
+00076 int lwip_connect(int s, struct sockaddr *name, int namelen);
+00077 int lwip_listen(int s, int backlog);
+00078 int lwip_recv(int s, void *mem, int len, unsignedint flags);
+00079 int lwip_read(int s, void *mem, int len);
+00080 int lwip_recvfrom(int s, void *mem, int len, unsignedint flags,
+00081 struct sockaddr *from, int *fromlen);
+00082 int lwip_send(int s, void *dataptr, int size, unsignedint flags);
+00083 int lwip_sendto(int s, void *dataptr, int size, unsignedint flags,
+00084 struct sockaddr *to, int tolen);
+00085 int lwip_socket(int domain, int type, int protocol);
+00086 int lwip_write(int s, void *dataptr, int size);
+00087
+00088 #ifdef LWIP_COMPAT_SOCKETS
+00089 #define accept(a,b,c) lwip_accept(a,b,c)
+00090 #define bind(a,b,c) lwip_bind(a,b,c)
+00091 #define close(s) lwip_close(s)
+00092 #define connect(a,b,c) lwip_connect(a,b,c)
+00093 #define listen(a,b) lwip_listen(a,b)
+00094 #define recv(a,b,c,d) lwip_recv(a,b,c,d)
+00095 #define read(a,b,c) lwip_read(a,b,c)
+00096 #define recvfrom(a,b,c,d,e,f) lwip_recvfrom(a,b,c,d,e,f)
+00097 #define send(a,b,c,d) lwip_send(a,b,c,d)
+00098 #define sendto(a,b,c,d,e,f) lwip_sendto(a,b,c,d,e,f)
+00099 #define socket(a,b,c) lwip_socket(a,b,c)
+00100 #define write(a,b,c) lwip_write(a,b,c)
+00101 #endif /* LWIP_NO_COMPAT_SOCKETS */
+00102
+00103 #endif /* __LWIP_SOCKETS_H__ */
+00104
+
Generated on Wed Apr 28 17:49:40 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/sockets_8h.html b/doc/doxygen/html/sockets_8h.html
new file mode 100644
index 0000000..6f6612f
--- /dev/null
+++ b/doc/doxygen/html/sockets_8h.html
@@ -0,0 +1,800 @@
+
+
+Ubixos: sockets.h File Reference
+
+
+
+
00001 /*****************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are
+00006 permitted provided that the following conditions are met:
+00007
+00008 Redistributions of source code must retain the above copyright notice, this list of
+00009 conditions, the following disclaimer and the list of authors. Redistributions in binary
+00010 form must reproduce the above copyright notice, this list of conditions, the following
+00011 disclaimer and the list of authors in the documentation and/or other materials provided
+00012 with the distribution. Neither the name of the UbixOS Project nor the names of its
+00013 contributors may be used to endorse or promote products derived from this software
+00014 without specific prior written permission.
+00015
+00016 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+00017 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+00018 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+00019 THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+00020 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+00021 OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00022 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+00023 TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+00024 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00025
+00026 $Id$
+00027
+00028 *****************************************************************************************/
+00029
+00030 #ifndef _SPINLOCK_H
+00031 #define _SPINLOCK_H
+00032
+00033 #include <ubixos/types.h>
+00034
+00035#define SPIN_LOCK_INITIALIZER 0
+00036
+00037typedefvolatileintspinLock_t;
+00038
+00039 externinlinevoidspinLockInit(spinLock_t *);
+00040 externinlinevoidspinUnlock(spinLock_t *);
+00041 externinlineintspinTryLock(spinLock_t *);
+00042 externinlinevoidspinLock(spinLock_t *);
+00043 externinlineintspinLockLocked(spinLock_t *);
+00044
+00045 #endif
+00046
+00047 /***
+00048 END
+00049 ***/
+00050
+
Generated on Sat May 8 09:28:18 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/spinlock_8h.html b/doc/doxygen/html/spinlock_8h.html
new file mode 100644
index 0000000..d5e3878
--- /dev/null
+++ b/doc/doxygen/html/spinlock_8h.html
@@ -0,0 +1,227 @@
+
+
+Ubixos: spinlock.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:22 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/stats_8h-source.html b/doc/doxygen/html/stats_8h-source.html
new file mode 100644
index 0000000..56aceca
--- /dev/null
+++ b/doc/doxygen/html/stats_8h-source.html
@@ -0,0 +1,124 @@
+
+
+Ubixos: stats.h Source File
+
+
+
+
stats.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035 #ifndef __LWIP_STATS_H__
+00036 #define __LWIP_STATS_H__
+00037
+00038 #include "net/opt.h"
+00039 #include "net/arch/cc.h"
+00040
+00041 #include "net/memp.h"
+00042
+00043 #ifdef STATS
+00044
+00045 struct stats_proto {
+00046 uInt16 xmit; /* Transmitted packets. */
+00047 uInt16 rexmit; /* Retransmitted packets. */
+00048 uInt16 recv; /* Received packets. */
+00049 uInt16 fw; /* Forwarded packets. */
+00050 uInt16 drop; /* Dropped packets. */
+00051 uInt16 chkerr; /* Checksum error. */
+00052 uInt16 lenerr; /* Invalid length error. */
+00053 uInt16 memerr; /* Out of memory error. */
+00054 uInt16 rterr; /* Routing error. */
+00055 uInt16 proterr; /* Protocol error. */
+00056 uInt16 opterr; /* Error in options. */
+00057 uInt16 err; /* Misc error. */
+00058 uInt16 cachehit;
+00059 };
+00060
+00061 struct stats_mem {
+00062 uInt16 avail;
+00063 uInt16 used;
+00064 uInt16 max;
+00065 uInt16 err;
+00066 uInt16 reclaimed;
+00067 };
+00068
+00069 struct stats_pbuf {
+00070 uInt16 avail;
+00071 uInt16 used;
+00072 uInt16 max;
+00073 uInt16 err;
+00074 uInt16 reclaimed;
+00075
+00076 uInt16 alloc_locked;
+00077 uInt16 refresh_locked;
+00078 };
+00079
+00080 struct stats_syselem {
+00081 uInt16 used;
+00082 uInt16 max;
+00083 uInt16 err;
+00084 };
+00085
+00086 struct stats_sys {
+00087 struct stats_syselem sem;
+00088 struct stats_syselem mbox;
+00089 };
+00090
+00091 struct stats_ {
+00092 struct stats_proto link;
+00093 struct stats_proto ip;
+00094 struct stats_proto icmp;
+00095 struct stats_proto udp;
+00096 struct stats_proto tcp;
+00097 struct stats_pbuf pbuf;
+00098 struct stats_mem mem;
+00099 struct stats_mem memp[MEMP_MAX];
+00100 struct stats_sys sys;
+00101 };
+00102
+00103 externstruct stats_ stats;
+00104
+00105 #endif /* STATS */
+00106
+00107 void stats_init(void);
+00108 #endif /* __LWIP_STATS_H__ */
+00109
+00110
+00111
+00112
+
Generated on Wed Apr 28 17:49:40 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/stats_8h.html b/doc/doxygen/html/stats_8h.html
new file mode 100644
index 0000000..3ac2521
--- /dev/null
+++ b/doc/doxygen/html/stats_8h.html
@@ -0,0 +1,53 @@
+
+
+Ubixos: stats.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:22 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/stdarg_8h-source.html b/doc/doxygen/html/stdarg_8h-source.html
new file mode 100644
index 0000000..666d2bf
--- /dev/null
+++ b/doc/doxygen/html/stdarg_8h-source.html
@@ -0,0 +1,55 @@
+
+
+Ubixos: stdarg.h Source File
+
+
+
+
stdarg.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _STDARG_H
+00025 #define _STDARG_H
+00026
+00027 typedefchar *vaList[1];
+00028
+00029 #define vaStart(ap, parm) ((ap)[0] = (char *) &parm \
+00030 + ((sizeof(parm) + sizeof(int) - 1) & ~(sizeof(int) - 1)), (void) 0)
+00031
+00032 #define vaArg(ap, type) ((ap)[0] += \
+00033 ((sizeof(type) + sizeof(int) - 1) & ~(sizeof(int) - 1)), \
+00034 (*(type *) ((ap)[0] \
+00035 - ((sizeof(type) + sizeof(int) - 1) & ~(sizeof(int) - 1)) )))
+00036
+00037 #define vaEnd(ap) ((ap)[0] = 0, (void) 0)
+00038
+00039
+00040 int vsprintf(char *buf, constchar *fmt, vaList args);
+00041
+00042 #endif
+00043
+
Generated on Wed Apr 28 17:49:40 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/stdarg_8h.html b/doc/doxygen/html/stdarg_8h.html
new file mode 100644
index 0000000..04a07ea
--- /dev/null
+++ b/doc/doxygen/html/stdarg_8h.html
@@ -0,0 +1,192 @@
+
+
+Ubixos: stdarg.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:22 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/string_8h-source.html b/doc/doxygen/html/string_8h-source.html
new file mode 100644
index 0000000..1989989
--- /dev/null
+++ b/doc/doxygen/html/string_8h-source.html
@@ -0,0 +1,48 @@
+
+
+Ubixos: string.h Source File
+
+
+
+
string.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _STRING_H
+00025 #define _STRING_H
+00026
+00027 #include <ubixos/types.h>
+00028
+00029 void * kmemcpy(void * dst, constvoid * src, size_t length);
+00030 void *kmemset(void * dst, int c, size_t length);
+00031 int kstrlen(constchar * string);
+00032
+00033 int sprintf(char * str, constchar * format, ...);
+00034
+00035 #endif
+00036
+
Generated on Wed Apr 28 17:49:40 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/string_8h.html b/doc/doxygen/html/string_8h.html
new file mode 100644
index 0000000..2f58cf6
--- /dev/null
+++ b/doc/doxygen/html/string_8h.html
@@ -0,0 +1,189 @@
+
+
+Ubixos: string.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:26 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/sys_8h-source.html b/doc/doxygen/html/sys_8h-source.html
new file mode 100644
index 0000000..252ebe6
--- /dev/null
+++ b/doc/doxygen/html/sys_8h-source.html
@@ -0,0 +1,105 @@
+
+
+Ubixos: sys.h Source File
+
+
+
+
sys.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035 #ifndef __LWIP_SYS_H__
+00036 #define __LWIP_SYS_H__
+00037
+00038 #include "arch/cc.h"
+00039 #include "arch/sys_arch.h"
+00040
+00041 typedef void (* sys_timeout_handler)(void *arg);
+00042
+00043 struct sys_timeout {
+00044 struct sys_timeout *next;
+00045 uInt16 time;
+00046 sys_timeout_handler h;
+00047 void *arg;
+00048 };
+00049
+00050 struct sys_timeouts {
+00051 struct sys_timeout *next;
+00052 };
+00053
+00054 /* sys_init() must be called before anthing else. */
+00055 void sys_init(void);
+00056
+00057 /*
+00058 * sys_timeout():
+00059 *
+00060 * Schedule a timeout a specified amount of milliseconds in the
+00061 * future. When the timeout occurs, the specified timeout handler will
+00062 * be called. The handler will be passed the "arg" argument when
+00063 * called.
+00064 *
+00065 */
+00066 void sys_timeout(uInt16 msecs, sys_timeout_handler h, void *arg);
+00067 struct sys_timeouts *sys_arch_timeouts(void);
+00068
+00069 /* Semaphore functions. */
+00070 sys_sem_t sys_sem_new(uInt8 count);
+00071 void sys_sem_signal(sys_sem_t sem);
+00072 uInt16 sys_arch_sem_wait(sys_sem_t sem, uInt16 timeout);
+00073 void sys_sem_free(sys_sem_t sem);
+00074
+00075 void sys_sem_wait(sys_sem_t sem);
+00076
+00077 /* Mailbox functions. */
+00078 sys_mbox_t sys_mbox_new(void);
+00079 void sys_mbox_post(sys_mbox_t mbox, void *msg);
+00080 uInt16 sys_arch_mbox_fetch(sys_mbox_t mbox, void **msg, uInt16 timeout);
+00081 void sys_mbox_free(sys_mbox_t mbox);
+00082
+00083 void sys_mbox_fetch(sys_mbox_t mbox, void **msg);
+00084
+00085 /* Thread functions. */
+00086 void sys_thread_new(void (* thread)(void *arg), void *arg);
+00087
+00088 /* The following functions are used only in Unix code, and
+00089 can be omitted when porting the stack. */
+00090 /* Returns the current time in microseconds. */
+00091 unsignedlong sys_now(void);
+00092
+00093 #endif /* __LWIP_SYS_H__ */
+
Generated on Wed Apr 28 17:49:40 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/sys_8h.html b/doc/doxygen/html/sys_8h.html
new file mode 100644
index 0000000..2df0695
--- /dev/null
+++ b/doc/doxygen/html/sys_8h.html
@@ -0,0 +1,583 @@
+
+
+Ubixos: sys.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:23 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/sys__arch_8h-source.html b/doc/doxygen/html/sys__arch_8h-source.html
new file mode 100644
index 0000000..144ec81
--- /dev/null
+++ b/doc/doxygen/html/sys__arch_8h-source.html
@@ -0,0 +1,63 @@
+
+
+Ubixos: sys_arch.h Source File
+
+
+
+
sys_arch.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035 #ifndef __ARCH_SYS_ARCH_H__
+00036 #define __ARCH_SYS_ARCH_H__
+00037
+00038 #define SYS_MBOX_NULL NULL
+00039 #define SYS_SEM_NULL NULL
+00040
+00041 struct sys_sem;
+00042 typedefstruct sys_sem * sys_sem_t;
+00043
+00044 struct sys_mbox;
+00045 typedefstruct sys_mbox *sys_mbox_t;
+00046
+00047 struct sys_thread;
+00048 typedefstruct sys_thread * sys_thread_t;
+00049
+00050 #endif /* __ARCH_SYS_ARCH_H__ */
+00051
+
Generated on Wed Apr 28 17:49:40 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/sys__arch_8h.html b/doc/doxygen/html/sys__arch_8h.html
new file mode 100644
index 0000000..0510b3c
--- /dev/null
+++ b/doc/doxygen/html/sys__arch_8h.html
@@ -0,0 +1,141 @@
+
+
+Ubixos: sys_arch.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:23 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/syscall_8h-source.html b/doc/doxygen/html/syscall_8h-source.html
new file mode 100644
index 0000000..5d51c54
--- /dev/null
+++ b/doc/doxygen/html/syscall_8h-source.html
@@ -0,0 +1,43 @@
+
+
+Ubixos: syscall.h Source File
+
+
+
+
syscall.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _SYSCALL_H
+00025 #define _SYSCALL_H
+00026
+00027 void _sysCall();
+00028 void invalidCall();
+00029
+00030 #endif
+00031
+
Generated on Wed Apr 28 17:49:40 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/syscall_8h.html b/doc/doxygen/html/syscall_8h.html
new file mode 100644
index 0000000..8779c2a
--- /dev/null
+++ b/doc/doxygen/html/syscall_8h.html
@@ -0,0 +1,79 @@
+
+
+Ubixos: syscall.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:23 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/syscalls_8h-source.html b/doc/doxygen/html/syscalls_8h-source.html
new file mode 100644
index 0000000..f6043da
--- /dev/null
+++ b/doc/doxygen/html/syscalls_8h-source.html
@@ -0,0 +1,128 @@
+
+
+Ubixos: syscalls.h Source File
+
+
+
+
syscalls.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _SYSCALLS_H
+00025 #define _SYSCALLS_H
+00026
+00027 #include <ubixos/sched.h>
+00028 #include <vfs/file.h>
+00029
+00030 void sysGetpid();
+00031 void sysExit();
+00032 void sysExec();
+00033 void sysFork();
+00034 void sysCheckPid();
+00035 void sysGetFreePage();
+00036
+00037 void sysFwrite();
+00038 void sysFgetc();
+00039 void sysFopen();
+00040 void sysFread();
+00041 void sysFclose();
+00042 void sysSchedYield();
+00043 void sysFseek();
+00044 void sysMkDir();
+00045 void sysRmDir();
+00046 void sysGetUid();
+00047 void sysGetGid();
+00048 void sysSetUid();
+00049 void sysSetGid();
+00050 void sysSDE();
+00051 void sysGetDrives();
+00052 void sysGetCwd();
+00053 void sysChDir();
+00054 void sysGetUptime();
+00055 void sysGetTime();
+00056 void sysStartSDE();
+00057 void sysUnlink();
+00058
+00059 typedef void (*functionPTR)();
+00060
+00061 functionPTR systemCalls[] = {
+00062 invalidCall,
+00063 sysGetpid,
+00064 sysExit,
+00065 sysExec,
+00066 sysFork,
+00067 sysFgetc,
+00068 sysCheckPid,
+00069 sysGetFreePage,
+00070 sysFopen,
+00071 invalidCall,
+00072 sysFclose,
+00073 sysSchedYield,
+00074 invalidCall,
+00075 invalidCall,
+00076 invalidCall,
+00077 invalidCall,
+00078 invalidCall,
+00079 invalidCall,
+00080 invalidCall,
+00081 invalidCall,
+00082 sysFopen,
+00083 sysFclose,
+00084 sysFread,
+00085 sysFwrite,
+00086 sysMkDir,
+00087 sysRmDir,
+00088 sysGetCwd,
+00089 sysFseek,
+00090 sysChDir,
+00091 sysMkDir,
+00092 sysUnlink,
+00093 sysGetUid,
+00094 sysGetGid,
+00095 sysSetUid,
+00096 sysSetGid,
+00097 invalidCall,
+00098 invalidCall,
+00099 invalidCall,
+00100 invalidCall,
+00101 invalidCall,
+00102 sysSDE,
+00103 invalidCall,
+00104 invalidCall,
+00105 invalidCall,
+00106 invalidCall,
+00107 sysGetDrives,
+00108 sysGetUptime,
+00109 sysGetTime,
+00110 sysStartSDE,
+00111 };
+00112
+00113 int totalCalls = sizeof(systemCalls)/sizeof(functionPTR);
+00114
+00115 #endif
+00116
+
Generated on Wed Apr 28 17:49:40 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/syscalls_8h.html b/doc/doxygen/html/syscalls_8h.html
new file mode 100644
index 0000000..1d6a926
--- /dev/null
+++ b/doc/doxygen/html/syscalls_8h.html
@@ -0,0 +1,907 @@
+
+
+Ubixos: syscalls.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:23 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/tcpdump_8h-source.html b/doc/doxygen/html/tcpdump_8h-source.html
new file mode 100644
index 0000000..21ad790
--- /dev/null
+++ b/doc/doxygen/html/tcpdump_8h-source.html
@@ -0,0 +1,55 @@
+
+
+Ubixos: tcpdump.h Source File
+
+
+
+
tcpdump.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035 #ifndef __NETIF_TCPDUMP_H__
+00036 #define __NETIF_TCPDUMP_H__
+00037
+00038 #include "net/pbuf.h"
+00039
+00040 void tcpdump_init(void);
+00041 void tcpdump(struct pbuf *p);
+00042
+00043 #endif /* __NETIF_TCPDUMP_H__ */
+
Generated on Wed Apr 28 17:49:41 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/tcpdump_8h.html b/doc/doxygen/html/tcpdump_8h.html
new file mode 100644
index 0000000..ae7ffc0
--- /dev/null
+++ b/doc/doxygen/html/tcpdump_8h.html
@@ -0,0 +1,82 @@
+
+
+Ubixos: tcpdump.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:23 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/tcpip_8h-source.html b/doc/doxygen/html/tcpip_8h-source.html
new file mode 100644
index 0000000..6fc450e
--- /dev/null
+++ b/doc/doxygen/html/tcpip_8h-source.html
@@ -0,0 +1,75 @@
+
+
+Ubixos: tcpip.h Source File
+
+
+
+
tcpip.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035 #ifndef __LWIP_TCPIP_H__
+00036 #define __LWIP_TCPIP_H__
+00037
+00038 #include "net/api_msg.h"
+00039 #include "net/pbuf.h"
+00040
+00041 void tcpip_init(void (* tcpip_init_done)(void *), void *arg);
+00042 void tcpip_apimsg(struct api_msg *apimsg);
+00043 err_t tcpip_input(struct pbuf *p, struct netif *inp);
+00044
+00045 enum tcpip_msg_type {
+00046 TCPIP_MSG_API,
+00047 TCPIP_MSG_INPUT
+00048 };
+00049
+00050 struct tcpip_msg {
+00051 enum tcpip_msg_type type;
+00052 sys_sem_t *sem;
+00053 union {
+00054 struct api_msg *apimsg;
+00055 struct {
+00056 struct pbuf *p;
+00057 struct netif *netif;
+00058 } inp;
+00059 } msg;
+00060 };
+00061
+00062
+00063 #endif /* __LWIP_TCPIP_H__ */
+
Generated on Wed Apr 28 17:49:41 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/tcpip_8h.html b/doc/doxygen/html/tcpip_8h.html
new file mode 100644
index 0000000..dcb8890
--- /dev/null
+++ b/doc/doxygen/html/tcpip_8h.html
@@ -0,0 +1,171 @@
+
+
+Ubixos: tcpip.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:23 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/time_8h-source.html b/doc/doxygen/html/time_8h-source.html
new file mode 100644
index 0000000..5307902
--- /dev/null
+++ b/doc/doxygen/html/time_8h-source.html
@@ -0,0 +1,96 @@
+
+
+Ubixos: time.h Source File
+
+
+
+
time.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _TIME_H
+00025 #define _TIME_H
+00026
+00027 #include <ubixos/types.h>
+00028 #include <sys/io.h>
+00029
+00030 typedeflong suseconds_t;
+00031
+00032 #define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10)
+00033
+00034 #define MINUTE 60
+00035 #define HOUR (60*MINUTE)
+00036 #define DAY (24*HOUR)
+00037 #define YEAR (365*DAY)
+00038
+00039 #ifndef _TIME_T_DECLARED
+00040 typedef __time_t time_t;
+00041 #define _TIME_T_DECLARED
+00042 #endif
+00043
+00044 struct timespec {
+00045 time_t tv_sec; /* seconds */
+00046 long tv_nsec; /* and nanoseconds */
+00047 };
+00048
+00049
+00050
+00051 struct timeStruct {
+00052 int sec;
+00053 int min;
+00054 int hour;
+00055 int day;
+00056 int mon;
+00057 int year;
+00058 };
+00059
+00060
+00061 struct timezone {
+00062 int tz_minuteswest; /* minutes west of Greenwich */
+00063 int tz_dsttime; /* type of dst correction */
+00064 };
+00065
+00066 struct timeval {
+00067 long tv_sec; /* seconds (XXX should be time_t) */
+00068 suseconds_t tv_usec; /* and microseconds */
+00069 };
+00070
+00071 int gettimeofday(struct timeval *tp,struct timezone *tzp);
+00072
+00073
+00074
+00075 int timeInit();
+00076 int timeCmosRead(int);
+00077 uInt32 timeMake(struct timeStruct *time);
+00078
+00079 #endif
+00080
+00081 /***
+00082 END
+00083 ***/
+00084
+
Generated on Wed Apr 28 17:49:41 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/time_8h.html b/doc/doxygen/html/time_8h.html
new file mode 100644
index 0000000..a59158f
--- /dev/null
+++ b/doc/doxygen/html/time_8h.html
@@ -0,0 +1,339 @@
+
+
+Ubixos: time.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:23 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/times_8h-source.html b/doc/doxygen/html/times_8h-source.html
new file mode 100644
index 0000000..14ae5c8
--- /dev/null
+++ b/doc/doxygen/html/times_8h-source.html
@@ -0,0 +1,59 @@
+
+
+Ubixos: times.h Source File
+
+
+
+
times.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _TIMES_H
+00025 #define _TIMES_H
+00026
+00027 #include <ubixos/types.h>
+00028 #include <sys/_types.h>
+00029
+00030 #ifndef _CLOCK_T_DECLARED
+00031 typedef __clock_t clock_t;
+00032 #define _CLOCK_T_DECLARED
+00033 #endif
+00034
+00035 struct tms {
+00036 clock_t tms_utime; /* User CPU time */
+00037 clock_t tms_stime; /* System CPU time */
+00038 clock_t tms_cutime; /* User CPU time of terminated child procs */
+00039 clock_t tms_cstime; /* System CPU time of terminated child procs */
+00040 };
+00041
+00042 #endif
+00043
+00044 /***
+00045 END
+00046 ***/
+00047
+
Generated on Wed Apr 28 17:49:41 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/times_8h.html b/doc/doxygen/html/times_8h.html
new file mode 100644
index 0000000..7170506
--- /dev/null
+++ b/doc/doxygen/html/times_8h.html
@@ -0,0 +1,48 @@
+
+
+Ubixos: times.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:23 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/tss_8h-source.html b/doc/doxygen/html/tss_8h-source.html
new file mode 100644
index 0000000..431c9cc
--- /dev/null
+++ b/doc/doxygen/html/tss_8h-source.html
@@ -0,0 +1,91 @@
+
+
+Ubixos: tss.h Source File
+
+
+
+
tss.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _TSS_H
+00025 #define _TSS_H
+00026
+00027 struct tssStruct {
+00028 short back_link;
+00029 short back_link_reserved;
+00030 long esp0;
+00031 short ss0;
+00032 short ss0_reserved;
+00033 long esp1;
+00034 short ss1;
+00035 short ss1_reserved;
+00036 long esp2;
+00037 short ss2;
+00038 short ss2_reserved;
+00039 long cr3;
+00040 long eip;
+00041 long eflags;
+00042 long eax,ecx,edx,ebx;
+00043 long esp;
+00044 long ebp;
+00045 long esi;
+00046 long edi;
+00047 short es;
+00048 short es_reserved;
+00049 short cs;
+00050 short cs_reserved;
+00051 short ss;
+00052 short ss_reserved;
+00053 short ds;
+00054 short ds_reserved;
+00055 short fs;
+00056 short fs_reserved;
+00057 short gs;
+00058 short gs_reserved;
+00059 short ldt;
+00060 short ldt_reserved;
+00061 //long trace_bitmap; /* bits: trace 0, bitmap 16-31 */
+00062 short trace_bitmap;
+00063 short io_map;
+00064 char io_space[8192];
+00065 };
+00066
+00067 struct i387Struct {
+00068 long cwd;
+00069 long swd;
+00070 long twd;
+00071 long fip;
+00072 long fcs;
+00073 long foo;
+00074 long fos;
+00075 long st_space[20]; /* 8*10 bytes for each FP-reg = 80 bytes */
+00076 };
+00077
+00078 #endif
+00079
+
Generated on Wed Apr 28 17:49:41 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/tss_8h.html b/doc/doxygen/html/tss_8h.html
new file mode 100644
index 0000000..a7a93bc
--- /dev/null
+++ b/doc/doxygen/html/tss_8h.html
@@ -0,0 +1,22 @@
+
+
+Ubixos: tss.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:23 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/types_8h-source.html b/doc/doxygen/html/types_8h-source.html
new file mode 100644
index 0000000..37c7736
--- /dev/null
+++ b/doc/doxygen/html/types_8h-source.html
@@ -0,0 +1,73 @@
+
+
+Ubixos: types.h Source File
+
+
+
+
types.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _TYPES_H
+00025 #define _TYPES_H
+00026
+00027 #include <sys/_types.h>
+00028
+00029 #ifndef NULL
+00030 #define NULL 0x0
+00031 #endif
+00032
+00033 typedefunsignedchar byte; /* 8-bit byte */
+00034 typedefunsignedshort word; /* 16-bit word */
+00035 typedefunsignedlong dWord; /* 32-bit dword */
+00036
+00037 typedefunsignedchar uChar;
+00038 typedefunsignedlong uLong;
+00039 typedefunsignedshort uShort;
+00040 typedefunsignedint uInt;
+00041
+00042 typedefunsignedchar uInt8;
+00043 typedefunsignedshort uInt16;
+00044 typedefunsignedlong uInt32;
+00045 typedefchar Int8;
+00046 typedefshort Int16;
+00047 typedeflong Int32;
+00048
+00049 typedefunsignedchar uint8_t;
+00050 typedefunsignedshort uint16_t;
+00051 typedefunsignedint uint32_t;
+00052
+00053 typedefint pidType;
+00054
+00055 typedefint pid_t;
+00056 typedefint size_t; /* standart */
+00057 #ifndef NOBOOL
+00058 typedefenum { FALSE=0,TRUE=1 } bool;
+00059 #endif
+00060
+00061 #endif
+
Generated on Wed Apr 28 17:49:42 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/types_8h.html b/doc/doxygen/html/types_8h.html
new file mode 100644
index 0000000..ee5b7ab
--- /dev/null
+++ b/doc/doxygen/html/types_8h.html
@@ -0,0 +1,322 @@
+
+
+Ubixos: types.h File Reference
+
+
+
+
+Depending on fd->mode, it fills fd with data about the file (start, size, permissions etc.), if the string file is matched with a filename in the current directory. Returns 1 on success, and 0 on failure. The fileDescriptor struct definition can be found in VFS
+Writes part (or can be whole) of a file from the memory pointed to by data. Extends file if necessary. Returns size.
+
+
+Generated on Sat May 8 09:28:23 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/ubthread_8h-source.html b/doc/doxygen/html/ubthread_8h-source.html
new file mode 100644
index 0000000..e22128b
--- /dev/null
+++ b/doc/doxygen/html/ubthread_8h-source.html
@@ -0,0 +1,95 @@
+
+
+Ubixos: ubthread.h Source File
+
+
+
+
ubthread.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _UBTHREAD_H
+00025 #define _UBTHREAD_H
+00026
+00027 #include <ubixos/types.h>
+00028 #include <ubixos/sched.h>
+00029 #include <ubixos/time.h>
+00030
+00031 #define ETIMEDOUT -1
+00032
+00033 #define LOCKED 1
+00034 #define UNLOCKED 0
+00035
+00036 typedefstruct ubthread *ubthread_t;
+00037 typedefstruct ubthread_cond *ubthread_cond_t;
+00038 typedefstruct ubthread_mutex *ubthread_mutex_t;
+00039
+00040 struct ubthread {
+00041 kTask_t *task;
+00042 };
+00043
+00044 struct ubthread_cond {
+00045 int id;
+00046 uInt8 locked;
+00047 };
+00048
+00049 struct ubthread_mutex {
+00050 int id;
+00051 uInt8 locked;
+00052 pidType pid;
+00053 };
+00054
+00055 struct ubthread_list {
+00056 struct ubthread_list *next;
+00057 ubthread_t thread;
+00058 };
+00059
+00060 struct ubthread_cond_list {
+00061 struct ubthread_cond_list *next;
+00062 ubthread_cond_t *cond;
+00063 };
+00064
+00065 struct ubthread_mutex_list {
+00066 struct ubthread_mutex_list *next;
+00067 ubthread_mutex_t *mutex;
+00068 };
+00069
+00070
+00071 kTask_t *ubthread_self();
+00072 int ubthread_cond_init(ubthread_cond_t *cond,const uInt32 attr);
+00073 int ubthread_mutex_init(ubthread_mutex_t *mutex,const uInt32 attr);
+00074 int ubthread_cond_destroy(ubthread_cond_t *cond);
+00075 int ubthread_mutex_destroy(ubthread_mutex_t *mutex);
+00076 int ubthread_create(kTask_t **thread,const uInt32 *attr,void *start_routine, void *arg);
+00077 int ubthread_mutex_lock(ubthread_mutex_t *mutex);
+00078 int ubthread_mutex_unlock(ubthread_mutex_t *mutex);
+00079 int ubthread_cond_timedwait(ubthread_cond_t *cond, ubthread_mutex_t *mutex, conststruct timespec *abstime);
+00080 int ubthread_cond_wait(ubthread_cond_t *cond, ubthread_mutex_t *mutex);
+00081 int ubthread_cond_signal(ubthread_cond_t *cond);
+00082
+00083 #endif
+
Generated on Wed Apr 28 17:49:42 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/ubthread_8h.html b/doc/doxygen/html/ubthread_8h.html
new file mode 100644
index 0000000..127fdd0
--- /dev/null
+++ b/doc/doxygen/html/ubthread_8h.html
@@ -0,0 +1,586 @@
+
+
+Ubixos: ubthread.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:23 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/udp_8h-source.html b/doc/doxygen/html/udp_8h-source.html
new file mode 100644
index 0000000..2a14338
--- /dev/null
+++ b/doc/doxygen/html/udp_8h-source.html
@@ -0,0 +1,114 @@
+
+
+Ubixos: udp.h Source File
+
+
+
+
udp.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035 #ifndef __LWIP_UDP_H__
+00036 #define __LWIP_UDP_H__
+00037
+00038 #include "net/arch.h"
+00039
+00040 #include "net/pbuf.h"
+00041 //UBU
+00042 #include "net/ipv4/inet.h"
+00043 //UBU
+00044 #include "net/ipv4/ip.h"
+00045
+00046 #include "net/err.h"
+00047
+00048 #define UDP_HLEN 8
+00049
+00050 struct udp_hdr {
+00051 PACK_STRUCT_FIELD(uInt16 src);
+00052 PACK_STRUCT_FIELD(uInt16 dest); /* src/dest UDP ports */
+00053 PACK_STRUCT_FIELD(uInt16 len);
+00054 PACK_STRUCT_FIELD(uInt16 chksum);
+00055 } PACK_STRUCT_STRUCT;
+00056
+00057 #define UDP_FLAGS_NOCHKSUM 0x01
+00058 #define UDP_FLAGS_UDPLITE 0x02
+00059
+00060 struct udp_pcb {
+00061 struct udp_pcb *next;
+00062
+00063 struct ip_addr local_ip, remote_ip;
+00064 uInt16 local_port, remote_port;
+00065
+00066 uInt8 flags;
+00067 uInt16 chksum_len;
+00068
+00069 void (* recv)(void *arg, struct udp_pcb *pcb, struct pbuf *p,
+00070 struct ip_addr *addr, uInt16 port);
+00071 void *recv_arg;
+00072 };
+00073
+00074 /* The following functions is the application layer interface to the
+00075 UDP code. */
+00076 struct udp_pcb * udp_new (void);
+00077 void udp_remove (struct udp_pcb *pcb);
+00078 err_t udp_bind (struct udp_pcb *pcb, struct ip_addr *ipaddr,
+00079 uInt16 port);
+00080 err_t udp_connect (struct udp_pcb *pcb, struct ip_addr *ipaddr,
+00081 uInt16 port);
+00082 void udp_recv (struct udp_pcb *pcb,
+00083 void (* recv)(void *arg, struct udp_pcb *upcb,
+00084 struct pbuf *p,
+00085 struct ip_addr *addr,
+00086 uInt16 port),
+00087 void *recv_arg);
+00088 err_t udp_send (struct udp_pcb *pcb, struct pbuf *p);
+00089
+00090 #define udp_flags(pcb) ((pcb)->flags)
+00091 #define udp_setflags(pcb, f) ((pcb)->flags = (f))
+00092
+00093
+00094 /* The following functions is the lower layer interface to UDP. */
+00095 uInt8 udp_lookup (struct ip_hdr *iphdr, struct netif *inp);
+00096 void udp_input (struct pbuf *p, struct netif *inp);
+00097 void udp_init (void);
+00098
+00099
+00100 #endif /* __LWIP_UDP_H__ */
+00101
+00102
+
Generated on Wed Apr 28 17:49:42 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/udp_8h.html b/doc/doxygen/html/udp_8h.html
new file mode 100644
index 0000000..7840362
--- /dev/null
+++ b/doc/doxygen/html/udp_8h.html
@@ -0,0 +1,541 @@
+
+
+Ubixos: udp.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:23 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/udpecho_8h-source.html b/doc/doxygen/html/udpecho_8h-source.html
new file mode 100644
index 0000000..e882238
--- /dev/null
+++ b/doc/doxygen/html/udpecho_8h-source.html
@@ -0,0 +1,52 @@
+
+
+Ubixos: udpecho.h Source File
+
+
+
+
udpecho.h
00001 /*
+00002 * Copyright (c) 2001, Swedish Institute of Computer Science.
+00003 * All rights reserved.
+00004 *
+00005 * Redistribution and use in source and binary forms, with or without
+00006 * modification, are permitted provided that the following conditions
+00007 * are met:
+00008 * 1. Redistributions of source code must retain the above copyright
+00009 * notice, this list of conditions and the following disclaimer.
+00010 * 2. Redistributions in binary form must reproduce the above copyright
+00011 * notice, this list of conditions and the following disclaimer in the
+00012 * documentation and/or other materials provided with the distribution.
+00013 * 3. Neither the name of the Institute nor the names of its contributors
+00014 * may be used to endorse or promote products derived from this software
+00015 * without specific prior written permission.
+00016 *
+00017 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+00018 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+00021 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+00022 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+00023 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+00024 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+00025 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00026 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+00027 * SUCH DAMAGE.
+00028 *
+00029 * This file is part of the lwIP TCP/IP stack.
+00030 *
+00031 * Author: Adam Dunkels <adam@sics.se>
+00032 *
+00033 * $Id$
+00034 */
+00035 #ifndef __UDPECHO_H__
+00036 #define __UDPECHO_H__
+00037
+00038 void udpecho_init(void);
+00039
+00040 #endif /* __UDPECHO_H__ */
+
Generated on Wed Apr 28 17:49:42 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/uniondescriptor_table_union.html b/doc/doxygen/html/uniondescriptor_table_union.html
new file mode 100644
index 0000000..f10ae49
--- /dev/null
+++ b/doc/doxygen/html/uniondescriptor_table_union.html
@@ -0,0 +1,93 @@
+
+
+Ubixos: descriptorTableUnion union Reference
+
+
+
+
+Generated on Sat May 8 09:28:24 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/vfs_8h-source.html b/doc/doxygen/html/vfs_8h-source.html
new file mode 100644
index 0000000..9650575
--- /dev/null
+++ b/doc/doxygen/html/vfs_8h-source.html
@@ -0,0 +1,96 @@
+
+
+Ubixos: vfs.h Source File
+
+
+
+
vfs.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _VFS_H
+00025 #define _VFS_H
+00026
+00027 #include <ubixos/types.h>
+00028
+00029 #define maxFd 32
+00030 #define fdAvail 1
+00031 #define fdOpen 2
+00032 #define fdRead 3
+00033 #define fdEof 4
+00034
+00035
+00036 #define fileRead 0x0001
+00037 #define fileWrite 0x0002
+00038 #define fileBinary 0x0004
+00039 #define fileAppend 0x0008
+00040
+00041 typedefstruct fileDescriptorStruct {
+00042 struct fileDescriptorStruct *prev;
+00043 struct fileDescriptorStruct *next;
+00044 struct mountPoints *mp;
+00045 uInt16 status;
+00046 uInt16 mode;
+00047 uInt32 offset;
+00048 uInt32 size;
+00049 uInt16 length;
+00050 uInt32 start;
+00051 uInt8 fileName[22];
+00052 char *buffer;
+00053 uInt32 dirBlock;
+00054 uInt32 perms;
+00055 } fileDescriptor;
+00056
+00057 struct fileSystem {
+00058 struct fileSystem *prev;
+00059 struct fileSystem *next;
+00060 int (*vfsInitFS)(void *);
+00061 int (*vfsRead)(void *,char *,long,long);
+00062 int (*vfsWrite)(void *,char *,long,long);
+00063 int (*vfsOpenFile)(void *,void *);
+00064 int (*vfsUnlink)(char *,void *);
+00065 int (*vfsMakeDir)(char *,void *);
+00066 int (*vfsRemDir)(char *);
+00067 int (*vfsSync)(void);
+00068 int vfsType;
+00069 };
+00070
+00071
+00072 /* VFS Functions */
+00073 int vfsInit();
+00074 int vfsRegisterFS(int,void *,void *,void *,void *,void *,void *,void *,void *);
+00075 struct fileSystem *vfsFindFS(int);
+00076
+00077
+00078
+00079 //File IO
+00080 fileDescriptor *fopen(constchar *file,constchar *flags);
+00081
+00082
+00083 #endif
+00084
+
Generated on Wed Apr 28 17:49:42 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/vfs_8h.html b/doc/doxygen/html/vfs_8h.html
new file mode 100644
index 0000000..7300dbc
--- /dev/null
+++ b/doc/doxygen/html/vfs_8h.html
@@ -0,0 +1,452 @@
+
+
+Ubixos: vfs.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:23 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/video_8h-source.html b/doc/doxygen/html/video_8h-source.html
new file mode 100644
index 0000000..5f32d57
--- /dev/null
+++ b/doc/doxygen/html/video_8h-source.html
@@ -0,0 +1,50 @@
+
+
+Ubixos: video.h Source File
+
+
+
+
video.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _VIDEO_H
+00025 #define _VIDEO_H
+00026
+00027 #include <ubixos/types.h>
+00028
+00029 #define defaultColor 0x0F
+00030
+00031 externint printColor;
+00032
+00033 void clearScreen();
+00034 void kprint(char *string);
+00035 void backSpace();
+00036
+00037 #endif
+00038
+
Generated on Wed Apr 28 17:49:42 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/video_8h.html b/doc/doxygen/html/video_8h.html
new file mode 100644
index 0000000..a9777a4
--- /dev/null
+++ b/doc/doxygen/html/video_8h.html
@@ -0,0 +1,163 @@
+
+
+Ubixos: video.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:23 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/vitals_8h-source.html b/doc/doxygen/html/vitals_8h-source.html
new file mode 100644
index 0000000..0868c4f
--- /dev/null
+++ b/doc/doxygen/html/vitals_8h-source.html
@@ -0,0 +1,63 @@
+
+
+Ubixos: vitals.h Source File
+
+
+
+
vitals.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _VITALS_H
+00025 #define _VITALS_H
+00026
+00027 #include <ubixos/types.h>
+00028 #include <ubixos/ubthread.h>
+00029 #include <vfs/mount.h>
+00030 #include <vfs/vfs.h>
+00031
+00032 typedefstruct vitalsStruct {
+00033 uInt32 openFiles;
+00034 uInt32 sysTicks;
+00035 uInt32 sysUptime;
+00036 uInt32 freePages;
+00037 struct fileSystem *fileSystems;
+00038 struct mountPoints *mountPoints;
+00039 uInt32 timeStart;
+00040 void *screen;
+00041 void *font;
+00042 char *packet;
+00043 uInt32 packetLength;
+00044 } vitalsNode;
+00045
+00046 extern vitalsNode *systemVitals;
+00047
+00048 int initVitals();
+00049
+00050 #endif
+00051
+
Generated on Wed Apr 28 17:49:42 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/vitals_8h.html b/doc/doxygen/html/vitals_8h.html
new file mode 100644
index 0000000..24f4a06
--- /dev/null
+++ b/doc/doxygen/html/vitals_8h.html
@@ -0,0 +1,108 @@
+
+
+Ubixos: vitals.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:23 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/vmm_8h-source.html b/doc/doxygen/html/vmm_8h-source.html
new file mode 100644
index 0000000..de393ca
--- /dev/null
+++ b/doc/doxygen/html/vmm_8h-source.html
@@ -0,0 +1,67 @@
+
+
+Ubixos: vmm.h Source File
+
+
+
+
vmm.h
00001 /**************************************************************************************
+00002 Copyright (c) 2002 The UbixOS Project
+00003 All rights reserved.
+00004
+00005 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+00006
+00007 Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+00008 Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+00009 in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+00010 contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+00011
+00012 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+00013 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+00014 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+00015 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+00016 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+00017 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+00018 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+00019
+00020 $Id$
+00021
+00022 **************************************************************************************/
+00023
+00024 #ifndef _VMM_H
+00025 #define _VMM_H
+00026
+00027 #include <vmm/paging.h>
+00028 #include <ubixos/types.h>
+00029
+00030 #define memAvail 1
+00031 #define memNotavail 2
+00032 #define vmmID -3
+00033 #define vmmMemoryMapAddr 0xE6667000
+00034
+00035 typedefstruct {
+00036 uLong pageAddr;
+00037 uShort status;
+00038 pid_t pid;
+00039 int cowCounter;
+00040 } mMap;
+00041
+00042 extern mMap *vmmMemoryMap;
+00043 externint numPages;
+00044 extern uInt32 freePages;
+00045
+00046 int vmmInit();
+00047 int vmmMemMapInit();
+00048 int countMemory();
+00049 uInt32 vmmFindFreePage(pidType pid);
+00050 int freePage(uInt32 pageAddr);
+00051 int adjustCowCounter(uInt32 baseAddr,int adjustment);
+00052 void vmmFreeProcessPages(pidType pid);
+00053
+00054 #endif
+00055
+
Generated on Wed Apr 28 17:49:42 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/doxygen/html/vmm_8h.html b/doc/doxygen/html/vmm_8h.html
new file mode 100644
index 0000000..59002bb
--- /dev/null
+++ b/doc/doxygen/html/vmm_8h.html
@@ -0,0 +1,419 @@
+
+
+Ubixos: vmm.h File Reference
+
+
+
+
+Generated on Sat May 8 09:28:23 2004 for Ubixos by
+
+
+1.3.3
+
+
diff --git a/doc/sample_driver.c b/doc/sample_driver.c
new file mode 100644
index 0000000..6c5052c
--- /dev/null
+++ b/doc/sample_driver.c
@@ -0,0 +1,101 @@
+/*****************************************************************************************
+ Copyright (c) 2002 The UbixOS Project
+ All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are
+permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of
+conditions, the following disclaimer and the list of authors. Redistributions in binary
+form must reproduce the above copyright notice, this list of conditions, the following
+disclaimer and the list of authors in the documentation and/or other materials provided
+with the distribution. Neither the name of the UbixOS Project nor the names of its
+contributors may be used to endorse or promote products derived from this software
+without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ $Log$
+ Revision 1.2 2004/04/27 20:49:22 reddawg
+ Update Sample Driver
+
+ Revision 1.1 2004/04/27 12:04:24 reddawg
+ Sample driver for isa interface
+
+
+
+ $Id$
+
+*****************************************************************************************/
+
+/********************************************************
+ This sample driver is good for an ISA device you can
+ either probe or hand set irq and ioAddr information if
+ ********************************************************/
+
+#include
+
+struct devInfo {
+ int irq;
+ int ioAddr;
+ }
+
+static struct devInfo sampleInfo;
+
+void sampleRegister() {
+ int sampleMajor = 0; /* Major ID */
+ int sampleMinor = 0; /* Minor ID */
+
+ deviceAdd(sampleMajor,sampleMinor,"c",sampleRead,sampleWrite,sampleReset,sampleInit,sampleIoctl,sampleStop,sampleStart,sampleStandby,sampleInfo)
+ }
+
+
+int sampleRead(struct deviceNode *dev,void *ptr,uInt32 offset,uInt32 length) {
+ /* Read From Device */
+ return(0);
+ }
+
+int sampleWrite(struct deviceNode *dev,void *ptr,uInt32 offset,uInt32 length) {
+ /* WritE to Device */
+ return(0);
+ }
+
+int sampleReset(struct deviceNode *dev) {
+ /* Device Reset */
+ return(0);
+ }
+
+int sampleInit(struct deviceNode *dev) {
+ /* Device Initialization */
+ /* Also Set Device Size If IT Is A Character Device */
+ dev->size = 1024;
+ return(0);
+ }
+
+int sampleIoctl(struct deviceNode *dev) {
+ /* Device IO Control */
+ return(0);
+ }
+
+int sampleStop(struct deviceNode *dev) {
+ /* Stop this device */
+ return(0);
+ }
+
+int sampleStart(struct deviceNode *dev) {
+ /* Start This Device */
+ return(0);
+ }
+
+int sampleStandby(struct deviceNode *dev) {
+ /* Do all things needed to allow this device to go into standby mode */
+ return(0);
+ }
diff --git a/doc/vmm.txt b/doc/vmm.txt
new file mode 100644
index 0000000..debb245
--- /dev/null
+++ b/doc/vmm.txt
@@ -0,0 +1,34 @@
+This document goes over the UbixOS VMM
+
+
+1. Memory Layout -
+
+ Each application has its own private 4gb memory area the first 1mb is mapped 1:1 against the systems memory and is shared between all of the proccess
+ on the system it include bios information video buffers and the kernel code.
+
+ From 0x100000 - 3gb this memory region is available for the task itself for its code data and anything else it may need it for
+
+ The top 1gb is reserved and shared across every application this is the os memory region not readable by the application unless it is in a syscall
+
+ at 0x100000 the applications page directory is stored and page 0x768 is all the pagetable listed in the page dir specified at 0x100000
+
+2. Functions -
+
+ vmmInit:
+ This function initializes our memory map and paging system if either fail this returns a failure.
+
+ vmmMemMapInit:
+ This initializes our memory map, it is a linked list of available pages it keeps track of COW (copy on write) as well as ownership and status
+
+ vmmPagingInit:
+ This initializes our paging system sets up default memory area for kernel and remaps the memory map into the top 1GB this builds the memory foundation
+ for each application to follow
+
+ vmmCreateVirtualSpace:
+ This creates a new virtual space for a process it takes on arg pidType pid and returns the base address of the new page directory
+ This has the shared lower 1 mb and top 1GB everything inbetween is available for the process
+
+ vmmCopyVirtualSpace:
+ This copies the current virtual space for the process specified by the arg pidType pid passed in. This copy sets all the pages for 2mb -3gb COW and no
+ memory is physically copied when the program attempts to write to this region a page fault happens then the memory is physically copied
+
diff --git a/src/Makefile.inc b/src/Makefile.inc
new file mode 100644
index 0000000..8a14d34
--- /dev/null
+++ b/src/Makefile.inc
@@ -0,0 +1,10 @@
+# $Id$
+# Global 'Source' Options
+
+# allow you to change your default compiler without affecting your other work
+CC = gcc295
+CXX = g++295
+LD = ld
+AR = ar
+REMOVE = rm -rf
+
diff --git a/src/README b/src/README
new file mode 100644
index 0000000..ed58e06
--- /dev/null
+++ b/src/README
@@ -0,0 +1,7 @@
+Directory Structure:
+
+ bin - Applications for UbixOS
+ include - Include files to build anything userland
+ lib - Userland libraries
+ sys - Kernel code
+ tools - Tool kit required to build and install UbixOS
\ No newline at end of file
diff --git a/src/bin/Makefile b/src/bin/Makefile
new file mode 100644
index 0000000..e279384
--- /dev/null
+++ b/src/bin/Makefile
@@ -0,0 +1,77 @@
+# $Id$
+# The System Makefile (C) 2002 The UbixOS Project
+
+all: init-bin login-bin shell-bin ls-bin clock-bin cp-bin fdisk-bin format-bin disklabel-bin ubistry-bin edit-bin ld-bin
+# test-bin pwd-bin cat-bin de-bin goofball-bin
+
+init-bin: init
+ (cd init;make)
+
+login-bin: login
+ (cd login;make)
+
+shell-bin: shell
+ (cd shell;make)
+
+test-bin: test
+ (cd test;make)
+
+ls-bin: ls
+ (cd ls;make)
+
+pwd-bin: pwd
+ (cd pwd;make)
+
+cat-bin: cat
+ (cd cat;make)
+
+ld-bin: ld
+ (cd ld;make)
+
+de-bin: de
+ (cd de;make)
+
+muffin-bin: muffin
+ (cd muffin;make)
+
+goofball-bin: goofball
+ (cd goofball;make)
+
+clock-bin: clock
+ (cd clock;make)
+
+fdisk-bin: fdisk
+ (cd fdisk;make)
+
+cp-bin: cp
+ (cd cp;make)
+
+format-bin: format
+ (cd format;make)
+
+disklabel-bin: disklabel
+ (cd disklabel;make)
+
+launcher-bin: launcher
+ (cd launcher;make)
+
+ubistry-bin: ubistry
+ (cd ubistry;make)
+
+edit-bin: edit
+ (cd edit;make)
+
+clean:
+ (cd cp;make clean)
+ (cd fdisk;make clean)
+ (cd init;make clean)
+ (cd shell;make clean)
+ (cd ls;make clean)
+ (cd login;make clean)
+ (cd clock;make clean)
+ (cd muffin;make clean)
+ (cd format;make clean)
+ (cd disklabel;make clean)
+ (cd ubistry;make clean)
+ (cd ld;make clean)
+ (cd edit;make clean)
diff --git a/src/bin/Makefile.inc b/src/bin/Makefile.inc
new file mode 100644
index 0000000..23cac6f
--- /dev/null
+++ b/src/bin/Makefile.inc
@@ -0,0 +1,7 @@
+# 'bin' options
+
+CFLAGS = -nostdlib -nostdinc -fomit-frame-pointer
+
+INCLUDES = -I../../include
+
+LIBRARIES = ../../lib/libc/math/*.o ../../lib/libc/quad/*.o ../../lib/libc/stdio/*.o ../../lib/libc/stdlib/*.o ../../lib/libc/sys/*.o ../../lib/libc/string/*.o ../../lib/libc/locale/*.o ../../lib/libc/gen/*.o ../../lib/libc/generic/*.o
diff --git a/src/bin/clock/Makefile b/src/bin/clock/Makefile
new file mode 100644
index 0000000..411bc55
--- /dev/null
+++ b/src/bin/clock/Makefile
@@ -0,0 +1,51 @@
+# $Id$
+# Application Makefile (C) 2002-2004 The UbixOS Project
+
+# Include Global 'Source' Options
+include ../../Makefile.inc
+include ../Makefile.inc
+
+#Linker
+LD = ld
+
+#Binary File Name
+BINARY = clock
+
+#Delete Program
+REMOVE = rm -f
+
+#Objects
+OBJS = main.o
+
+#Startup File
+STARTUP = ../../lib/ubix/startup.o
+
+LIBRARIES = ../../lib/libc/libc.so
+
+# Link The Binary
+$(BINARY) : $(OBJS)
+ $(CC) $(CFLAGS) -o $@ $(STARTUP) $(LIBRARIES) $(OBJS)
+ strip $(BINARY)
+
+# Compile the source files
+.cpp.o:
+ $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.cc.o:
+ $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.cc.s:
+ $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -S -o $@ $<
+
+.c.o:
+ $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.c.s:
+ $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -S -o $@ $<
+
+.S.o:
+ $(CC) -Wall $(CLFAGS) $(INCLUDES) -c -o $@ $<
+
+# Clean Up The junk
+clean:
+ $(REMOVE) $(OBJS) $(BINARY)
diff --git a/src/bin/clock/main.c b/src/bin/clock/main.c
new file mode 100644
index 0000000..5cacd66
--- /dev/null
+++ b/src/bin/clock/main.c
@@ -0,0 +1,116 @@
+/*****************************************************************************************
+ Copyright (c) 2002-2004 The UbixOS Project
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modification, are
+ permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this list of
+ conditions, the following disclaimer and the list of authors. Redistributions in binary
+ form must reproduce the above copyright notice, this list of conditions, the following
+ disclaimer and the list of authors in the documentation and/or other materials provided
+ with the distribution. Neither the name of the UbixOS Project nor the names of its
+ contributors may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+ OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ $Id$
+
+*****************************************************************************************/
+
+#include
+#include
+#include
+#include
+
+void print2(char *string,int,int);
+
+#define MINUTE 60
+#define HOUR (60*MINUTE)
+#define DAY (24*HOUR)
+#define YEAR (365*DAY)
+
+
+static int monthSecs[12] = {
+ 0,
+ DAY*(31),
+ DAY*(31+29),
+ DAY*(31+29+31),
+ DAY*(31+29+31+30),
+ DAY*(31+29+31+30+31),
+ DAY*(31+29+31+30+31+30),
+ DAY*(31+29+31+30+31+30+31),
+ DAY*(31+29+31+30+31+30+31+31),
+ DAY*(31+29+31+30+31+30+31+31+30),
+ DAY*(31+29+31+30+31+30+31+31+30+31),
+ DAY*(31+29+31+30+31+30+31+31+30+31+30)
+};
+
+int main(int argc,char **argv) {
+ int sysTime = 0x0;
+ int i = 0x0;
+
+ int year = 0x0;
+ int month = 0x0;
+ int day = 0x0;
+ int hour = 0x0;
+ int min = 0x0;
+ int sec = 0x0;
+
+ sysTime = gettime();
+
+ year = (sysTime/YEAR) + 1970;
+ sysTime -= (YEAR * (year-1970));
+ sysTime -= DAY*(((year-1970)+1)/4);
+ for (i = 11;i >= 0;i--) {
+ if ((sysTime - monthSecs[i]) > 0) {
+ month = i;
+ break;
+ }
+ }
+ sysTime -= monthSecs[i];
+ if (((month > 1) && (((year-1970)+2)%4)) == 0x0) {
+ sysTime += DAY;
+ }
+
+ day = (sysTime/DAY);
+ sysTime -= (day*DAY);
+ hour = (sysTime/HOUR);
+ sysTime -= (hour*HOUR);
+ min = (sysTime/MINUTE);
+ sysTime -= (min*MINUTE);
+ sec = sysTime;
+
+ printf("[%02d/%02d/%i, %02d:%02d.%02d]\n",month,day,year,hour,min,sec);
+ return(0);
+ }
+
+/***
+ $Log$
+ Revision 1.6 2004/06/13 03:05:15 reddawg
+ we now have a dynamic linker
+
+ Revision 1.5 2004/06/12 01:32:03 reddawg
+ clock: first so test program
+
+ Revision 1.4 2004/06/04 16:15:14 reddawg
+ shell: fixed a segfault bug comparing a null pointer
+ clock: prints correct time now
+ login: fixed a pointer conversion
+
+ Revision 1.3 2004/05/21 15:45:36 reddawg
+ Fixed our clock to print the time instead of forcing it into the video buffer
+
+
+ END
+ ***/
+
diff --git a/src/bin/cp/Makefile b/src/bin/cp/Makefile
new file mode 100644
index 0000000..8f6dc57
--- /dev/null
+++ b/src/bin/cp/Makefile
@@ -0,0 +1,48 @@
+# $Id$
+# Application Makefile (C) 2002-2004 The UbixOS Project
+
+# Include Global 'Source' Options
+include ../../Makefile.inc
+include ../Makefile.inc
+
+#Linker
+LD = ld
+
+#Binary File Name
+BINARY = cp
+
+#Delete Program
+REMOVE = rm -f
+
+#Objects
+OBJS = main.o
+
+#Startup File
+STARTUP = ../../lib/ubix/startup.o
+
+LIBRARIES = ../../lib/libc/libc.so
+
+# Link The Binary
+$(BINARY) : $(OBJS)
+ $(CC) $(CFLAGS) -o $@ $(STARTUP) $(LIBRARIES) $(OBJS)
+ strip $(BINARY)
+
+# Compile the source files
+.cc.o:
+ $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.cc.s:
+ $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -S -o $@ $<
+
+.c.o:
+ $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.c.s:
+ $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -S -o $@ $<
+
+.S.o:
+ $(CC) -Wall $(CLFAGS) $(INCLUDES) -c -o $@ $<
+
+# Clean Up The junk
+clean:
+ $(REMOVE) $(OBJS) $(BINARY)
diff --git a/src/bin/cp/main.c b/src/bin/cp/main.c
new file mode 100644
index 0000000..240292d
--- /dev/null
+++ b/src/bin/cp/main.c
@@ -0,0 +1,59 @@
+/*****************************************************************************************
+ Copyright (c) 2002-2004 The UbixOS Project
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modification, are
+ permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this list of
+ conditions, the following disclaimer and the list of authors. Redistributions in binary
+ form must reproduce the above copyright notice, this list of conditions, the following
+ disclaimer and the list of authors in the documentation and/or other materials provided
+ with the distribution. Neither the name of the UbixOS Project nor the names of its
+ contributors may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+ OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ $Id$
+
+*****************************************************************************************/
+
+#include
+#include
+
+int main(int argc,char **argv) {
+ int i = 0x0;
+ char *buffer = (char *)malloc(0x2000);
+ FILE *in = 0x0;
+ FILE *out = 0x0;
+ in = fopen(argv[1],"rb");
+ out = fopen(argv[2],"wb");
+ /*
+ while (!feof(in)) {
+ */
+ for (i=0;i<21;i++) {
+ fread(buffer,0x1000,1,in);
+ fwrite(buffer,0x1000,1,out);
+ }
+ fclose(in);
+ fclose(out);
+ return(0x0);
+ }
+
+/***
+ $Log$
+ Revision 1.3 2004/05/24 13:40:35 reddawg
+ Clean Up
+
+
+ END
+ ***/
diff --git a/src/bin/disklabel/Makefile b/src/bin/disklabel/Makefile
new file mode 100644
index 0000000..41d3422
--- /dev/null
+++ b/src/bin/disklabel/Makefile
@@ -0,0 +1,49 @@
+# $Id$
+# Application Makefile (C) 2002-2004 The UbixOS Project
+
+# Include Global 'Source' Options
+include ../../Makefile.inc
+include ../Makefile.inc
+
+#Linker
+LD = ld
+
+#Binary File Name
+BINARY = disklabel
+
+#Delete Program
+REMOVE = rm -f
+
+#Objects
+OBJS = main.o
+
+#Startup File
+STARTUP = ../../lib/ubix/startup.o
+
+
+LIBRARIES = ../../lib/libc/libc.so
+
+# Link The Binary
+$(BINARY) : $(OBJS)
+ $(CC) $(CFLAGS) -o $@ $(STARTUP) $(LIBRARIES) $(OBJS)
+ strip $(BINARY)
+
+# Compile the source files
+.cc.o:
+ $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.cc.s:
+ $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -S -o $@ $<
+
+.c.o:
+ $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.c.s:
+ $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -S -o $@ $<
+
+.S.o:
+ $(CC) -Wall $(CLFAGS) $(INCLUDES) -c -o $@ $<
+
+# Clean Up The junk
+clean:
+ $(REMOVE) $(OBJS) $(BINARY)
diff --git a/src/bin/disklabel/main.c b/src/bin/disklabel/main.c
new file mode 100644
index 0000000..b9c58cc
--- /dev/null
+++ b/src/bin/disklabel/main.c
@@ -0,0 +1,111 @@
+/*****************************************************************************************
+ Copyright (c) 2002-2004 The UbixOS Project
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modification, are
+ permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this list of
+ conditions, the following disclaimer and the list of authors. Redistributions in binary
+ form must reproduce the above copyright notice, this list of conditions, the following
+ disclaimer and the list of authors in the documentation and/or other materials provided
+ with the distribution. Neither the name of the UbixOS Project nor the names of its
+ contributors may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+ OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ $Id$
+
+*****************************************************************************************/
+
+#include
+#include
+#include
+#include
+#include
+
+#include "ubixfs.h"
+
+
+int main(int argc,char **argv) {
+ FILE *fd;
+ struct ubixDiskLabel *d = (struct ubixDiskLabel *)malloc(512);
+ int i = 0x0;
+ char buf[256];
+
+ printf("Ubix Disk Label Editor Version 1.0\n");
+ printf("(c) 2004 Ubix Corp \n\n");
+
+ if (argc >= 2) {
+ printf("Drive Info (%s):\n",argv[1]);
+ fd = fopen(argv[1],"rb");
+ }
+ else {
+ printf("Drive Info (hd0):\n");
+ fd = fopen("hd0@devfs","rb");
+ }
+ fseek(fd,512,0);
+ fread(d,512,1,fd);
+
+ if (argc >= 3) {
+ i = atoi(argv[2]);
+ printf("d->partitions[%i].p_size = %i, ",i,d->partitions[i].p_size);
+ printf("New Value: ");
+ gets((char *)&buf);
+ d->partitions[i].p_size = atoi(buf);
+ printf("d->partitions[%i].p_offset = %i, ",i,d->partitions[i].p_offset);
+ printf("New Value: ");
+ gets((char *)&buf);
+ d->partitions[i].p_offset = atoi(buf);
+ printf("d->partitions[%i].p_fstype = %i, ",i,d->partitions[i].p_fstype);
+ printf("New Value: ");
+ gets((char *)&buf);
+ d->partitions[i].p_fstype = atoi(buf);
+ printf("d->partitions[%i].p_bsize = %i, ",i,d->partitions[i].p_bsize);
+ printf("New Value: ");
+ gets((char *)&buf);
+ d->partitions[i].p_bsize = atoi(buf);
+ printf("\n");
+ printf("d->partitions[%i].p_size = %i\n",i,d->partitions[i].p_size);
+ printf("d->partitions[%i].p_offset = %i\n",i,d->partitions[i].p_offset);
+ printf("d->partitions[%i].p_fstype = %i\n",i,d->partitions[i].p_fstype);
+ printf("d->partitions[%i].p_bsize = %i\n",i,d->partitions[i].p_bsize);
+ fseek(fd,512,0);
+ fwrite(d,512,1,fd);
+ }
+ else {
+ for (i=0;i<4;i++) {
+ if (d->partitions[i].p_fstype != 0x0) {
+ printf("d->partitions[%i].p_size = %i\n",i,d->partitions[i].p_size);
+ printf("d->partitions[%i].p_offset = %i\n",i,d->partitions[i].p_offset);
+ printf("d->partitions[%i].p_fstype = 0x%X\n",i,d->partitions[i].p_fstype);
+ printf("d->partitions[%i].p_bsize = 0x%X\n",i,d->partitions[i].p_bsize);
+ }
+ }
+ }
+
+ fclose(fd);
+
+ return(0);
+ }
+
+/***
+ $Log$
+ Revision 1.3 2004/06/01 01:30:43 reddawg
+ No more warnings and organized make files
+
+ Revision 1.2 2004/05/24 13:42:29 reddawg
+ Clean Up
+
+
+ END
+ ***/
diff --git a/src/bin/disklabel/ubixfs.h b/src/bin/disklabel/ubixfs.h
new file mode 100644
index 0000000..d0525bf
--- /dev/null
+++ b/src/bin/disklabel/ubixfs.h
@@ -0,0 +1,80 @@
+/*****************************************************************************************
+ Copyright (c) 2002-2004 The UbixOS Project
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modification, are
+ permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this list of
+ conditions, the following disclaimer and the list of authors. Redistributions in binary
+ form must reproduce the above copyright notice, this list of conditions, the following
+ disclaimer and the list of authors in the documentation and/or other materials provided
+ with the distribution. Neither the name of the UbixOS Project nor the names of its
+ contributors may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+ OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ $Id$
+
+*****************************************************************************************/
+
+#include
+
+#define DOSPTYP_UBX 0x2A /* UbixFS partition type */
+#define UBIXDISKMAGIC ((uInt32)0x45) /* The disk magic number */
+#define MAXUBIXPARTITIONS 16
+#define UBIXFSMAGIC ((uInt32)0x69) /* The File System Magic Number */
+
+struct ubixDiskLabel {
+ uInt32 magicNum;
+ uInt32 magicNum2;
+ uInt16 driveType;
+ uInt16 numPartitions;
+ struct ubixPartitions { /* the partition table */
+ uInt32 p_size; /* number of sectors in partition */
+ uInt32 p_offset; /* starting sector */
+ uInt32 p_fsize; /* filesystem basic fragment size */
+ uInt32 p_bsize; /* BAT size */
+ uInt8 p_fstype; /* filesystem type, see below */
+ uInt8 p_frag; /* filesystem fragments per block */
+ } partitions[MAXUBIXPARTITIONS];
+ };
+
+//Block Allocation Table Entry
+struct blockAllocationTableEntry {
+ long attributes; //Block Attributes
+ long realSector; //Real Sector
+ long nextBlock; //Sector Of Next Block
+ long reserved; //Reserved
+ };
+
+
+struct directoryEntry {
+ uLong startCluster; //Starting Cluster Of File
+ uLong size; //Size Of File
+ uLong creationDate; //Date Created
+ uLong lastModified; //Date Last Modified
+ uLong uid; //UID Of Owner
+ uLong gid; //GID Of Owner
+ uShort attributes; //Files Attributes
+ uShort permissions; //Files Permissions
+ char fileName[256]; //File Name
+ };
+
+/***
+ $Log$
+ Revision 1.2 2004/05/24 13:42:29 reddawg
+ Clean Up
+
+
+ END
+ ***/
diff --git a/src/bin/edit/Makefile b/src/bin/edit/Makefile
new file mode 100644
index 0000000..319a799
--- /dev/null
+++ b/src/bin/edit/Makefile
@@ -0,0 +1,48 @@
+# $Id$
+# Application Makefile (C) 2002-2004 The UbixOS Project
+
+# Include Global 'Source' Options
+include ../../Makefile.inc
+include ../Makefile.inc
+
+#Linker
+LD = ld
+
+#Binary File Name
+BINARY = init
+
+#Delete Program
+REMOVE = rm -f
+
+#Objects
+OBJS = main.o
+
+#Startup File
+STARTUP = ../../lib/ubix/startup.o
+
+LIBRARIES = ../../lib/libc/libc.so
+
+# Link The Binary
+$(BINARY) : $(OBJS)
+ $(CC) $(CFLAGS) -o $@ $(STARTUP) $(LIBRARIES) $(OBJS)
+ strip $(BINARY)
+
+# Compile the source files
+.cc.o:
+ $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.cc.s:
+ $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -S -o $@ $<
+
+.c.o:
+ $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.c.s:
+ $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -S -o $@ $<
+
+.S.o:
+ $(CC) -Wall $(CLFAGS) $(INCLUDES) -c -o $@ $<
+
+# Clean Up The junk
+clean:
+ $(REMOVE) $(OBJS) $(BINARY)
diff --git a/src/bin/edit/main.c b/src/bin/edit/main.c
new file mode 100644
index 0000000..be72071
--- /dev/null
+++ b/src/bin/edit/main.c
@@ -0,0 +1,43 @@
+/*****************************************************************************************
+ Copyright (c) 2002-2004 The UbixOS Project
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modification, are
+ permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this list of
+ conditions, the following disclaimer and the list of authors. Redistributions in binary
+ form must reproduce the above copyright notice, this list of conditions, the following
+ disclaimer and the list of authors in the documentation and/or other materials provided
+ with the distribution. Neither the name of the UbixOS Project nor the names of its
+ contributors may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+ OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ $Id$
+
+*****************************************************************************************/
+
+#include
+
+int main(int argc,char **argv) {
+ printf("UbixOS Text Editor\n");
+ return(0);
+ }
+
+/***
+ $Log$
+ Revision 1.1 2004/06/04 17:58:03 reddawg
+ Start of a text editor if i can pull this off there is no holding us back
+
+ END
+ ***/
diff --git a/src/bin/fdisk/Makefile b/src/bin/fdisk/Makefile
new file mode 100644
index 0000000..4a890bc
--- /dev/null
+++ b/src/bin/fdisk/Makefile
@@ -0,0 +1,48 @@
+# $Id$
+# Application Makefile (C) 2002-2004 The UbixOS Project
+
+# Include Global 'Source' Options
+include ../../Makefile.inc
+include ../Makefile.inc
+
+#Linker
+LD = ld
+
+#Binary File Name
+BINARY = fdisk
+
+#Delete Program
+REMOVE = rm -f
+
+#Objects
+OBJS = main.o
+
+#Startup File
+STARTUP = ../../lib/ubix/startup.o
+
+LIBRARIES = ../../lib/libc/libc.so
+
+# Link The Binary
+$(BINARY) : $(OBJS)
+ $(CC) $(CFLAGS) -o $@ $(STARTUP) $(LIBRARIES) $(OBJS)
+ strip $(BINARY)
+
+# Compile the source files
+.cc.o:
+ $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.cc.s:
+ $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -S -o $@ $<
+
+.c.o:
+ $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.c.s:
+ $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -S -o $@ $<
+
+.S.o:
+ $(CC) -Wall $(CLFAGS) $(INCLUDES) -c -o $@ $<
+
+# Clean Up The junk
+clean:
+ $(REMOVE) $(OBJS) $(BINARY)
diff --git a/src/bin/fdisk/main.c b/src/bin/fdisk/main.c
new file mode 100644
index 0000000..de8f123
--- /dev/null
+++ b/src/bin/fdisk/main.c
@@ -0,0 +1,130 @@
+/*****************************************************************************************
+ Copyright (c) 2002-2004 The UbixOS Project
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modification, are
+ permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this list of
+ conditions, the following disclaimer and the list of authors. Redistributions in binary
+ form must reproduce the above copyright notice, this list of conditions, the following
+ disclaimer and the list of authors in the documentation and/or other materials provided
+ with the distribution. Neither the name of the UbixOS Project nor the names of its
+ contributors may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+ OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ $Id$
+
+*****************************************************************************************/
+
+#include
+#include
+#include
+#include
+#include
+
+#include "ubixfs.h"
+
+struct dos_partition {
+ unsigned char dp_flag; /* bootstrap flags */
+ unsigned char dp_shd; /* starting head */
+ unsigned char dp_ssect; /* starting sector */
+ unsigned char dp_scyl; /* starting cylinder */
+ unsigned char dp_type; /* partition type */
+ unsigned char dp_ehd; /* end head */
+ unsigned char dp_esect; /* end sector */
+ unsigned char dp_ecyl; /* end cylinder */
+ uInt32 dp_start; /* absolute starting sector number */
+ uInt32 dp_size; /* partition size in sectors */
+};
+
+
+int main(int argc,char **argv) {
+ FILE *fd;
+ FILE *mbr;
+ struct dos_partition *d = 0x0;
+ char *data = (char *)malloc(512);
+ int i = 0x0;
+ char buf[256];
+
+ d = (struct dos_partition *)(data + 0x1BE);
+
+ printf("Ubix Disk Editor Version 1.0\n");
+ printf("(c) 2004 Ubix Corp \n\n");
+
+ if (argc >= 2) {
+ printf("Drive Info (%s):\n",argv[1]);
+ fd = fopen(argv[1],"rb");
+ }
+ else {
+ printf("Drive Info (ad0):\n");
+ fd = fopen("ad0@devfs","rb");
+ }
+ fseek(fd,0,0);
+ fread(data,512,1,fd);
+
+ if (argc >= 3) {
+ i = atoi(argv[2]);
+ if (i == 0) {
+ mbr = fopen("mbr@sys","rb");
+ fseek(mbr,0,0);
+ fread(data,512,1,mbr);
+ printf("Installing Ubix MBR\n");
+ }
+ else {
+ i--;
+ printf("d[%i].dp_type = %i, ",i,d[i].dp_type);
+ printf("New Value: ");
+ gets((char *)&buf);
+ d[i].dp_type = atoi(buf);
+ printf("d[%i].dp_start: %i, ",i,d[i].dp_start);
+ printf("New Value: ");
+ gets((char *)&buf);
+ d[i].dp_start = atoi(buf);
+ printf("d[%i].dp_size: %i, ",i,d[i].dp_size);
+ printf("New Value: ");
+ gets((char *)&buf);
+ d[i].dp_size = atoi(buf);
+ printf("d[%i].dp_type: 0x%X\n",i,d[i].dp_type);
+ printf("d[%i].dp_start: %i\n",i,d[i].dp_start);
+ printf("d[%i].dp_size: %i\n",i,d[i].dp_size);
+ }
+ fseek(fd,0,0);
+ fwrite(data,512,1,fd);
+ }
+ else {
+ for (i=0;i<4;i++) {
+ if (d[i].dp_type != 0x0) {
+ printf("d[%i].dp_type: 0x%X\n",i,d[i].dp_type);
+ printf("d[%i].dp_start: %i\n",i,d[i].dp_start);
+ printf("d[%i].dp_size: %i\n",i,d[i].dp_size);
+ }
+ }
+ }
+
+ fclose(fd);
+
+ return(0);
+ }
+
+/***
+ $Log$
+ Revision 1.8 2004/06/01 01:30:43 reddawg
+ No more warnings and organized make files
+
+ Revision 1.7 2004/05/24 13:54:52 reddawg
+ Clean Up
+
+
+ END
+ ***/
diff --git a/src/bin/fdisk/ubixfs.h b/src/bin/fdisk/ubixfs.h
new file mode 100644
index 0000000..e6554ae
--- /dev/null
+++ b/src/bin/fdisk/ubixfs.h
@@ -0,0 +1,80 @@
+/*****************************************************************************************
+ Copyright (c) 2002-2004 The UbixOS Project
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modification, are
+ permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this list of
+ conditions, the following disclaimer and the list of authors. Redistributions in binary
+ form must reproduce the above copyright notice, this list of conditions, the following
+ disclaimer and the list of authors in the documentation and/or other materials provided
+ with the distribution. Neither the name of the UbixOS Project nor the names of its
+ contributors may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+ OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ $Id$
+
+*****************************************************************************************/
+
+#include
+
+#define DOSPTYP_UBX 0x2A /* UbixFS partition type */
+#define UBIXDISKMAGIC ((uInt32)0x45) /* The disk magic number */
+#define MAXUBIXPARTITIONS 16
+#define UBIXFSMAGIC ((uInt32)0x69) /* The File System Magic Number */
+
+struct ubixDiskLabel {
+ uInt32 magicNum;
+ uInt32 magicNum2;
+ uInt16 driveType;
+ uInt16 numPartitions;
+ struct ubixPartitions { /* the partition table */
+ uInt32 p_size; /* number of sectors in partition */
+ uInt32 p_offset; /* starting sector */
+ uInt32 p_fsize; /* filesystem basic fragment size */
+ uInt32 p_bsize; /* BAT size */
+ uInt8 p_fstype; /* filesystem type, see below */
+ uInt8 p_frag; /* filesystem fragments per block */
+ } partitions[MAXUBIXPARTITIONS];
+ };
+
+//Block Allocation Table Entry
+struct blockAllocationTableEntry {
+ long attributes; //Block Attributes
+ long realSector; //Real Sector
+ long nextBlock; //Sector Of Next Block
+ long reserved; //Reserved
+ };
+
+
+struct directoryEntry {
+ uLong startCluster; //Starting Cluster Of File
+ uLong size; //Size Of File
+ uLong creationDate; //Date Created
+ uLong lastModified; //Date Last Modified
+ uLong uid; //UID Of Owner
+ uLong gid; //GID Of Owner
+ uShort attributes; //Files Attributes
+ uShort permissions; //Files Permissions
+ char fileName[256]; //File Name
+ };
+
+/***
+ $Log$
+ Revision 1.2 2004/05/24 13:54:52 reddawg
+ Clean Up
+
+
+ END
+ ***/
diff --git a/src/bin/format/Makefile b/src/bin/format/Makefile
new file mode 100644
index 0000000..d7e4329
--- /dev/null
+++ b/src/bin/format/Makefile
@@ -0,0 +1,48 @@
+# $Id$
+# Application Makefile (C) 2002-2004 The UbixOS Project
+
+# Include Global 'Source' Options
+include ../../Makefile.inc
+include ../Makefile.inc
+
+#Linker
+LD = ld
+
+#Binary File Name
+BINARY = format
+
+#Delete Program
+REMOVE = rm -f
+
+#Objects
+OBJS = main.o
+
+#Startup File
+STARTUP = ../../lib/ubix/startup.o
+
+LIBRARIIES = ../../lib/libc/libc.so
+
+# Link The Binary
+$(BINARY) : $(OBJS)
+ $(CC) $(CFLAGS) -o $@ $(STARTUP) $(LIBRARIES) $(OBJS)
+ strip $(BINARY)
+
+# Compile the source files
+.cc.o:
+ $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.cc.s:
+ $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -S -o $@ $<
+
+.c.o:
+ $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.c.s:
+ $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -S -o $@ $<
+
+.S.o:
+ $(CC) -Wall $(CLFAGS) $(INCLUDES) -c -o $@ $<
+
+# Clean Up The junk
+clean:
+ $(REMOVE) $(OBJS) $(BINARY)
diff --git a/src/bin/format/main.c b/src/bin/format/main.c
new file mode 100644
index 0000000..657d78e
--- /dev/null
+++ b/src/bin/format/main.c
@@ -0,0 +1,52 @@
+/*****************************************************************************************
+ Copyright (c) 2002-2004 The UbixOS Project
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modification, are
+ permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this list of
+ conditions, the following disclaimer and the list of authors. Redistributions in binary
+ form must reproduce the above copyright notice, this list of conditions, the following
+ disclaimer and the list of authors in the documentation and/or other materials provided
+ with the distribution. Neither the name of the UbixOS Project nor the names of its
+ contributors may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+ OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ $Id$
+
+*****************************************************************************************/
+
+#include
+#include
+#include
+#include
+#include
+
+
+int main(int argc,char **argv) {
+ printf("UbixOS Format V1.0\n");
+ return(0);
+ }
+
+/***
+ $Log$
+ Revision 1.4 2004/06/01 01:30:43 reddawg
+ No more warnings and organized make files
+
+ Revision 1.3 2004/05/24 14:09:20 reddawg
+ Clean Up
+
+
+ END
+ ***/
diff --git a/src/bin/init/Makefile b/src/bin/init/Makefile
new file mode 100644
index 0000000..c7b32a8
--- /dev/null
+++ b/src/bin/init/Makefile
@@ -0,0 +1,48 @@
+# $Id$
+# Application Makefile (C) 2002-2004 The UbixOS Project
+
+# Include Global 'Source' Options
+include ../../Makefile.inc
+include ../Makefile.inc
+
+#Linker
+LD = ld
+
+#Binary File Name
+BINARY = init
+
+#Delete Program
+REMOVE = rm -f
+
+#Objects
+OBJS = main.o
+
+#Startup File
+STARTUP = ../../lib/ubix/startup.o
+
+#LIBRARIES = ../../lib/libc/libc.so
+
+# Link The Binary
+$(BINARY) : $(OBJS)
+ $(CC) $(CFLAGS) -o $@ $(STARTUP) $(LIBRARIES) $(OBJS)
+ strip $(BINARY)
+
+# Compile the source files
+.cc.o:
+ $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.cc.s:
+ $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -S -o $@ $<
+
+.c.o:
+ $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.c.s:
+ $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -S -o $@ $<
+
+.S.o:
+ $(CC) -Wall $(CLFAGS) $(INCLUDES) -c -o $@ $<
+
+# Clean Up The junk
+clean:
+ $(REMOVE) $(OBJS) $(BINARY)
diff --git a/src/bin/init/main.c b/src/bin/init/main.c
new file mode 100644
index 0000000..e905e3c
--- /dev/null
+++ b/src/bin/init/main.c
@@ -0,0 +1,134 @@
+/*****************************************************************************************
+ Copyright (c) 2002-2004 The UbixOS Project
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modification, are
+ permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this list of
+ conditions, the following disclaimer and the list of authors. Redistributions in binary
+ form must reproduce the above copyright notice, this list of conditions, the following
+ disclaimer and the list of authors in the documentation and/or other materials provided
+ with the distribution. Neither the name of the UbixOS Project nor the names of its
+ contributors may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+ OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ $Id$
+
+*****************************************************************************************/
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+int main(int argc,char **argv) {
+ int i=0;
+ mpiMessage_t myMsg;
+
+ /* Create a mailbox for this task */
+ if (mpiCreateMbox("init") != 0x0) {
+ printf("Error: Error Creating Mail Box\n");
+ exit(-1);
+ }
+
+ /* Make sure we have superuser permissions if not exit */
+ if ((getuid() != 0) && (getgid() != 0)) {
+ printf("Error: This program must be run by root.\n");
+ exit(-1);
+ }
+
+ /* Start the SDE(SCreen Drawing Engine) */
+ //startSDE();
+
+ printf("Initializing System.\n");
+
+ i = fork();
+ if (0 == i) {
+ printf("Starting Ubix Registry (ubistry)\n");
+ exec("ubistry@sys",0x0,0x0);
+ printf("Error: Error Starting ubistry\n");
+ exit(-1);
+ }
+ while (pidStatus(i) > 0x0) {
+ sched_yield();
+ }
+
+ startup:
+ i = fork();
+ if (0 == i) {
+ printf("Starting Login Daemon.\n");
+ exec("login@sys",0x0,0x0);
+ printf("Error Starting System\n");
+ exit(-1);
+ }
+ else {
+ while (pidStatus(i) > 0x0) {
+ fetchAgain:
+ if (mpiFetchMessage("init",&myMsg) == 0x0) {
+ switch (myMsg.type) {
+ case 10:
+ printf("Exec: (%s)\n",myMsg.data);
+ break;
+ default:
+ printf("MailBox: init Received Message %i:%s\n",myMsg.type,myMsg.data);
+ break;
+ }
+ goto fetchAgain;
+ }
+ sched_yield();
+ }
+ goto startup;
+ }
+ return(0);
+ }
+
+/***
+ $Log$
+ Revision 1.11 2004/06/04 13:29:56 reddawg
+ libc: modified mkdir(); interface
+ kpanic: kPanic(); now says kPanic: %s
+ system: now reboots when receives message for reboot
+ also when command start sde is received by system the STD is started
+
+ Revision 1.10 2004/05/26 13:11:41 reddawg
+ Makefile: adjust all the Makefile to strip binaries to conserve floppy space
+
+ Revision 1.9 2004/05/26 12:19:19 reddawg
+ init: init now starts the ubix registry system
+
+ Revision 1.8 2004/05/25 22:44:59 reddawg
+ Test code
+
+ Revision 1.7 2004/05/25 22:32:58 reddawg
+ We turned back on GUI
+
+ Revision 1.6 2004/05/25 18:38:00 reddawg
+ The system INIT task now responds to messages it is the root process for the OS
+
+ Revision 1.5 2004/05/25 15:43:44 reddawg
+ Tests for MPI
+
+ Revision 1.4 2004/05/23 23:40:37 reddawg
+ Cleanup
+
+ Revision 1.3 2004/05/21 21:15:56 reddawg
+ Cleaned up initialized program
+
+ Revision 1.2 2004/05/21 15:43:58 reddawg
+ Fixed the the bootup ordering in userland initialization
+
+ END
+ ***/
diff --git a/src/bin/launcher/Makefile b/src/bin/launcher/Makefile
new file mode 100644
index 0000000..78193bd
--- /dev/null
+++ b/src/bin/launcher/Makefile
@@ -0,0 +1,53 @@
+# $Id$
+# Application Makefile (C) 2002-2004 The UbixOS Project
+
+# Include Global 'Source' Options
+include ../../Makefile.inc
+include ../Makefile.inc
+
+INCLUDES += -I./include -I../../lib/views/sunlight/include -I../../lib/libcpp/include -I../../lib/objgfx40/objgfx40
+CFLAGS = -nostdlib -fno-exceptions -frtti
+LIBRARIES += ../../lib/libstdc++/*.o
+
+#Linker
+LD = ld
+
+#Binary File Name
+BINARY = launcher
+
+#Delete Program
+REMOVE = rm -f
+
+#Objects
+OBJS = launcher.o ubixButton.o ubixDesktop.o
+
+#Startup File
+STARTUP = ../../lib/ubix/startup.o
+
+# Link The Binary
+$(BINARY) : $(OBJS)
+ $(CC) $(CFLAGS) -o $@ $(STARTUP) $(LIBRARIES) $(OBJS)
+ strip $(BINARY)
+
+# Compile the source files
+.cpp.o:
+ $(CXX) -Wall -O -DNOBOOL $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.cc.o:
+ $(CXX) -Wall -O -DNOBOOL $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.cc.s:
+ $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -S -o $@ $<
+
+.c.o:
+ $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.c.s:
+ $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -S -o $@ $<
+
+.S.o:
+ $(CC) -Wall $(CLFAGS) $(INCLUDES) -c -o $@ $<
+
+# Clean Up The junk
+clean:
+ $(REMOVE) $(OBJS) $(BINARY)
diff --git a/src/bin/launcher/include/ubixButton.h b/src/bin/launcher/include/ubixButton.h
new file mode 100644
index 0000000..34ee379
--- /dev/null
+++ b/src/bin/launcher/include/ubixButton.h
@@ -0,0 +1,13 @@
+#ifndef UBIXBUTTON_H
+#define UBIXBUTTON_H
+
+#include
+
+class ubixButton : public vButton {
+ public:
+ ubixButton(vContext *);
+// virtual bool vCreate(void);
+ virtual void vDraw(void);
+ virtual ~ubixButton(void);
+}; // ubixButton
+#endif
diff --git a/src/bin/launcher/include/ubixDesktop.h b/src/bin/launcher/include/ubixDesktop.h
new file mode 100644
index 0000000..61a1a38
--- /dev/null
+++ b/src/bin/launcher/include/ubixDesktop.h
@@ -0,0 +1,14 @@
+#ifndef UBIXDESKTOP_H
+#define UBIXDESKTOP_H
+
+#include
+
+class ubixDesktop : public vContext {
+ protected:
+ public:
+ ubixDesktop(vContext *);
+ virtual bool vCreate(void);
+ virtual void vDraw(void);
+ virtual ~ubixDesktop(void);
+}; // ubixDesktop
+#endif
diff --git a/src/bin/launcher/launcher.cpp b/src/bin/launcher/launcher.cpp
new file mode 100644
index 0000000..db6cd82
--- /dev/null
+++ b/src/bin/launcher/launcher.cpp
@@ -0,0 +1,16 @@
+#include
+#include
+#include
+#include
+
+int
+main(void) {
+ ubixDesktop * desktop = new ubixDesktop(NULL);
+ ubixButton * daButton = new ubixButton(desktop);
+ desktop->vCreate();
+ daButton->vCreate();
+ delete daButton;
+ delete desktop;
+
+ return 0;
+}
diff --git a/src/bin/launcher/ubixButton.cpp b/src/bin/launcher/ubixButton.cpp
new file mode 100644
index 0000000..f74f65c
--- /dev/null
+++ b/src/bin/launcher/ubixButton.cpp
@@ -0,0 +1,20 @@
+#include
+#include
+#include
+#include
+
+ubixButton::ubixButton(vContext * parent) : vButton(parent) {
+ vSetSize(48, 48);
+ vSetPos(0, 600-vGetHeight());
+ vSetStyle("default.button.border.size", new sSize(0));
+ return;
+} // ubixButton::ubixButton()
+
+void
+ubixButton::vDraw(void) {
+ return;
+} // ubixButton::vDraw()
+
+ubixButton::~ubixButton(void) {
+ return;
+} // ubixButton::~ubixButton()
diff --git a/src/bin/launcher/ubixDesktop.cpp b/src/bin/launcher/ubixDesktop.cpp
new file mode 100644
index 0000000..c9afad0
--- /dev/null
+++ b/src/bin/launcher/ubixDesktop.cpp
@@ -0,0 +1,30 @@
+#include
+#include
+#include
+#include
+
+ubixDesktop::ubixDesktop(vContext * parent) : vContext(parent) {
+ vSetStyle("default.button.border.size", new sSize(2));
+ vSetStyle("default.font.filename", new sString("ROM8X14.DPF"));
+ vSetStyle("default.font.color.foreground",
+ new sRGBA8Color(255, 255, 255, 255));
+ vSetStyle("default.font.color.background",
+ new sRGBA8Color(0, 0, 0, 255));
+ vSetStyle("default.desktop.pixelformat",
+ new sPixelFormat(16, 11,5,0,0, 5,6,5,0));
+ return;
+} // ubixDesktop::ubixDesktop
+
+bool
+ubixDesktop::vCreate(void) {
+ return true;
+} // ubixDesktop::vCreate
+
+void
+ubixDesktop::vDraw(void) {
+ return;
+} // ubixDesktop::vDraw
+
+ubixDesktop::~ubixDesktop(void) {
+ return;
+}
diff --git a/src/bin/ld/Makefile b/src/bin/ld/Makefile
new file mode 100644
index 0000000..fbb3395
--- /dev/null
+++ b/src/bin/ld/Makefile
@@ -0,0 +1,49 @@
+# $Id$
+# Application Makefile (C) 2002-2004 The UbixOS Project
+
+# Include Global 'Source' Options
+include ../../Makefile.inc
+include ../Makefile.inc
+
+#Linker
+LD = ld
+
+#Binary File Name
+OUTPUT = ld.so
+
+#Delete Program
+REMOVE = rm -f
+
+#Objects
+OBJS = main.o findlibrary.o findfunc.o addlibrary.o entry.o
+
+#Startup File
+STARTUP = ../../lib/ubix/startup.o
+
+# Link The Binary
+$(OUTPUT) : $(OBJS)
+ $(CC) -nostdlib -shared -Wl,-soname,$(OUTPUT) -e _ld -o $(OUTPUT) $(OBJS) $(LIBRARIES) $(SUBS)
+ strip $(OUTPUT)
+
+# Compile the source files
+.cpp.o:
+ $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.cc.o:
+ $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.cc.s:
+ $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -S -o $@ $<
+
+.c.o:
+ $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.c.s:
+ $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -S -o $@ $<
+
+.S.o:
+ $(CC) -Wall $(CLFAGS) $(INCLUDES) -c -o $@ $<
+
+# Clean Up The junk
+clean:
+ $(REMOVE) $(OBJS) $(OUTPUT)
diff --git a/src/bin/ld/addlibrary.c b/src/bin/ld/addlibrary.c
new file mode 100644
index 0000000..698fd55
--- /dev/null
+++ b/src/bin/ld/addlibrary.c
@@ -0,0 +1,121 @@
+#include
+#include
+#include "ld.h"
+
+ldLibrary *ldAddLibrary(const char *lib) {
+ int i = 0x0;
+ int x = 0x0;
+ int rel = 0x0;
+ uInt32 *reMap = 0x0;
+ char *newLoc = 0x0;
+ FILE *linkerFd = 0x0;
+ ldLibrary *tmpLib = 0x0;
+
+ tmpLib = (ldLibrary *)malloc(sizeof(ldLibrary));
+
+ if (tmpLib->output == 0x0) {
+ linkerFd = fopen(lib,"rb");
+ if (linkerFd == 0x0) {
+ printf("Cant Open Library: %s\n",lib);
+ exit(-1);
+ }
+ tmpLib->output = (char *)malloc((linkerFd->size+0x4000));
+ sprintf(tmpLib->name,lib);
+ }
+
+ if (tmpLib->linkerHeader == 0x0) {
+ fseek(linkerFd,0x0,0x0);
+ tmpLib->linkerHeader = (elfHeader *)malloc(sizeof(elfHeader));
+ fread(tmpLib->linkerHeader,sizeof(elfHeader),1,linkerFd);
+ }
+
+ if (tmpLib->linkerProgramHeader == 0x0) {
+ tmpLib->linkerProgramHeader = (elfProgramHeader *)malloc(sizeof(elfProgramHeader)*tmpLib->linkerHeader->ePhnum);
+ fseek(linkerFd,tmpLib->linkerHeader->ePhoff,0);
+ fread(tmpLib->linkerProgramHeader,sizeof(elfProgramHeader),tmpLib->linkerHeader->ePhnum,linkerFd);
+
+ for (i=0;ilinkerHeader->ePhnum;i++) {
+ switch (tmpLib->linkerProgramHeader[i].phType) {
+ case 1:
+ case 2:
+ newLoc = (char *)tmpLib->linkerProgramHeader[i].phVaddr + (uInt32)tmpLib->output;
+ fseek(linkerFd,tmpLib->linkerProgramHeader[i].phOffset,0);
+ fread(newLoc,tmpLib->linkerProgramHeader[i].phFilesz,1,linkerFd);
+ break;
+ default:
+ printf("Unhandled Header\n");
+ break;
+ }
+ }
+ }
+
+ if (tmpLib->linkerSectionHeader == 0x0) {
+ tmpLib->linkerSectionHeader = (elfSectionHeader *)malloc(sizeof(elfSectionHeader)*tmpLib->linkerHeader->eShnum);
+ fseek(linkerFd,tmpLib->linkerHeader->eShoff,0);
+ fread(tmpLib->linkerSectionHeader,sizeof(elfSectionHeader),tmpLib->linkerHeader->eShnum,linkerFd);
+
+ if (tmpLib->linkerShStr == 0x0) {
+ tmpLib->linkerShStr = (char *)malloc(tmpLib->linkerSectionHeader[tmpLib->linkerHeader->eShstrndx].shSize);
+ fseek(linkerFd,tmpLib->linkerSectionHeader[tmpLib->linkerHeader->eShstrndx].shOffset,0);
+ fread(tmpLib->linkerShStr,tmpLib->linkerSectionHeader[tmpLib->linkerHeader->eShstrndx].shSize,1,linkerFd);
+ }
+
+ for (i=0x0;ilinkerHeader->eShnum;i++) {
+ switch (tmpLib->linkerSectionHeader[i].shType) {
+ case 3:
+ if (!strcmp((tmpLib->linkerShStr + tmpLib->linkerSectionHeader[i].shName),".dynstr")) {
+ if (tmpLib->linkerDynStr == 0x0) {
+ tmpLib->linkerDynStr = (char *)malloc(tmpLib->linkerSectionHeader[i].shSize);
+ fseek(linkerFd,tmpLib->linkerSectionHeader[i].shOffset,0);
+ fread(tmpLib->linkerDynStr,tmpLib->linkerSectionHeader[i].shSize,1,linkerFd);
+ }
+ }
+ break;
+ case 9:
+ tmpLib->linkerElfRel = (elfPltInfo *)malloc(tmpLib->linkerSectionHeader[i].shSize);
+ fseek(linkerFd,tmpLib->linkerSectionHeader[i].shOffset,0x0);
+ fread(tmpLib->linkerElfRel,tmpLib->linkerSectionHeader[i].shSize,1,linkerFd);
+
+ for (x=0x0;xlinkerSectionHeader[i].shSize/sizeof(elfPltInfo);x++) {
+ rel = ELF32_R_SYM(tmpLib->linkerElfRel[x].pltInfo);
+ reMap = (uInt32 *)((uInt32)tmpLib->output + tmpLib->linkerElfRel[x].pltOffset);
+ switch (ELF32_R_TYPE(tmpLib->linkerElfRel[x].pltInfo)) {
+ case R_386_32:
+ *reMap += ((uInt32)tmpLib->output + tmpLib->linkerRelSymTab[rel].dynValue);
+ break;
+ case R_386_PC32:
+ *reMap += ((uInt32)tmpLib->output + tmpLib->linkerRelSymTab[rel].dynValue) - (uInt32)reMap;
+ break;
+ case R_386_RELATIVE:
+ *reMap += (uInt32)tmpLib->output;
+ break;
+ default:
+ printf("Unhandled sym\n");
+ break;
+ }
+ }
+ free(tmpLib->linkerElfRel);
+ break;
+ case 11:
+ if (tmpLib->linkerRelSymTab == 0x0) {
+ tmpLib->linkerRelSymTab = (elfDynSym *)malloc(tmpLib->linkerSectionHeader[i].shSize);
+ fseek(linkerFd,tmpLib->linkerSectionHeader[i].shOffset,0);
+ fread(tmpLib->linkerRelSymTab,tmpLib->linkerSectionHeader[i].shSize,1,linkerFd);
+ tmpLib->sym = i;
+ }
+ break;
+ }
+ }
+ }
+
+ libs->prev = tmpLib;
+ tmpLib->prev = 0x0;
+ tmpLib->next = libs;
+ libs = tmpLib;
+
+ if (linkerFd) {
+ fclose(linkerFd);
+ }
+
+ return(tmpLib);
+ }
diff --git a/src/bin/ld/elf.h b/src/bin/ld/elf.h
new file mode 100644
index 0000000..0d2c17b
--- /dev/null
+++ b/src/bin/ld/elf.h
@@ -0,0 +1,146 @@
+/**************************************************************************************
+ Copyright (c) 2002 The UbixOS Project
+ All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ $Id$
+
+**************************************************************************************/
+
+#ifndef _ELF_H
+#define _ELF_H
+
+#include
+
+#define elfExecutable 0x002
+#define elfLibrary 0x003
+
+#define R_386_NONE 0 /* none none */
+#define R_386_32 1 /* word32 S + A */
+#define R_386_PC32 2 /* word32 S + A - P */
+#define R_386_GOT32 3 /* word32 G + A - P */
+#define R_386_PLT32 4 /* word32 L + A - P */
+#define R_386_COPY 5 /* none none */
+#define R_386_GLOB_DAT 6 /* word32 S */
+#define R_386_JMP_SLOT 7 /* word32 S */
+#define R_386_RELATIVE 8 /* word32 B + A */
+#define R_386_GOTOFF 9 /* word32 S + A - GOT */
+#define R_386_GOTPC 10 /* word32 GOT + A - P */
+
+
+/* Elf Types */
+#define ET_NONE 0 // No file type
+#define ET_REL 1 // Relocatable file
+#define ET_EXEC 2 // Executable file
+#define ET_DYN 3 // Shared object file
+#define ET_CORE 4 // Core file
+#define ET_LOPROC 0xff00 // Processor-specific
+#define ET_HIPROC 0xffff
+/* End Elf Types */
+
+/* Elf Machine Types */
+#define EM_NONE 0 // No machine
+#define EM_M32 1 // AT&T WE 32100
+#define EM_SPARC 2 // SPARC
+#define EM_386 3 // Intel 80386
+#define EM_68K 4 // Motorola 68000
+#define EM_88K 5 // Motorola 88000
+#define EM_860 7 // Intel 80860
+#define EM_MIPS 8 // MIPS RS3000
+/* End Elf Machines Types */
+
+/* Elf Version */
+#define EV_NONE 0 // Invalid version
+#define EV_CURRENT 1 // Current version
+/* End Elf Version */
+
+/* Elf Program Header Types */
+#define PT_NULL 0
+#define PT_LOAD 1
+#define PT_DYNAMIC 2
+/* End Elf Program Header Types */
+
+typedef struct {
+ uInt8 eIdent[16]; /* File identification. */
+ uInt16 eType; /* File type. */
+ uInt16 eMachine; /* Machine architecture. */
+ uInt32 eVersion; /* ELF format version. */
+ uInt32 eEntry; /* Entry point. */
+ uInt32 ePhoff; /* Program Header file offset. */
+ uInt32 eShoff; /* Section header file offset. */
+ uInt32 eFlags; /* Architecture-specific flags. */
+ uInt16 eEhsize; /* Size of ELF header in bytes. */
+ uInt16 ePhentsize; /* Size of program header entry. */
+ uInt16 ePhnum; /* Number of program header entries. */
+ uInt16 eShentsize; /* Size of section header entry. */
+ uInt16 eShnum; /* Number of section header entries. */
+ uInt16 eShstrndx; /* Section name strings section. */
+ } elfHeader;
+
+typedef struct {
+ uInt32 phType; /* Entry type. */
+ uInt32 phOffset; /* File offset of contents. */
+ uInt32 phVaddr; /* Virtual address in memory image. */
+ uInt32 phPaddr; /* Physical address (not used). */
+ uInt32 phFilesz; /* Size of contents in file. */
+ uInt32 phMemsz; /* Size of contents in memory. */
+ uInt32 phFlags; /* Access permission flags. */
+ uInt32 phAlign; /* Alignment in memory and file. */
+ } elfProgramHeader;
+
+typedef struct {
+ uInt32 shName; /* Section name (index into the section header string table). */
+ uInt32 shType; /* Section type. */
+ uInt32 shFlags; /* Section flags. */
+ uInt32 shAddr; /* Address in memory image. */
+ uInt32 shOffset; /* Offset in file. */
+ uInt32 shSize; /* Size in bytes. */
+ uInt32 shLink; /* Index of a related section. */
+ uInt32 shInfo; /* Depends on section type. */
+ uInt32 shAddralign; /* Alignment in bytes. */
+ uInt32 shEntsize; /* Size of each entry in section. */
+ } elfSectionHeader;
+
+typedef struct {
+ uInt32 pltOffset;
+ uInt32 pltInfo;
+ } elfPltInfo;
+
+typedef struct {
+ uInt32 dynName;
+ uInt32 dynValue;
+ uInt32 dynSize;
+ uInt8 dynInfo;
+ uInt8 dynOther;
+ uInt16 dynShndx;
+ } elfDynSym;
+
+typedef struct {
+ uInt32 dynVal;
+ uInt32 dynPtr;
+ } elfDynamic;
+
+char *elfGetShType(int);
+char *elfGetPhType(int);
+char *elfGetRelType(int);
+
+#define ELF32_R_SYM(i) ((i)>>8)
+#define ELF32_R_TYPE(i) ((unsigned char)(i))
+#define ELF32_R_INFO(s, t) ((s)<<8+(unsigned char)(t))
+
+#endif
+
diff --git a/src/bin/ld/entry.S b/src/bin/ld/entry.S
new file mode 100644
index 0000000..435ba55
--- /dev/null
+++ b/src/bin/ld/entry.S
@@ -0,0 +1,48 @@
+/*****************************************************************************************
+ Copyright (c) 2002-2004 The UbixOS Project
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modification, are
+ permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this list of
+ conditions, the following disclaimer and the list of authors. Redistributions in binary
+ form must reproduce the above copyright notice, this list of conditions, the following
+ disclaimer and the list of authors in the documentation and/or other materials provided
+ with the distribution. Neither the name of the UbixOS Project nor the names of its
+ contributors may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+ OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ $Id$
+
+*****************************************************************************************/
+
+.globl _ld
+.text
+.code32
+
+_ld:
+ call ld
+ add $8,%esp
+ push %eax
+ ret
+
+/***
+ $Log$
+ Revision 1.1 2004/06/17 11:58:10 reddawg
+ ld.so: Made a few changes to the way it functions hopefully it will
+ improve some of its performance.
+
+ END
+ ***/
+
diff --git a/src/bin/ld/findfunc.c b/src/bin/ld/findfunc.c
new file mode 100644
index 0000000..74794ee
--- /dev/null
+++ b/src/bin/ld/findfunc.c
@@ -0,0 +1,24 @@
+#include
+#include
+#include "ld.h"
+
+uInt32 ldFindFunc(const char *func,const char *lib) {
+ int i = 0x0;
+ uInt32 *funcPtr = 0x0;
+ ldLibrary *libPtr = 0x0;
+
+ libPtr = ldFindLibrary(lib);
+ if (libPtr == 0x0) {
+ libPtr = ldAddLibrary(lib);
+ }
+
+ for (i=0x0;ilinkerSectionHeader[libPtr->sym].shSize/sizeof(elfDynSym);i++) {
+ if (!strcmp(func,(libPtr->linkerDynStr + libPtr->linkerRelSymTab[i].dynName))) {
+ funcPtr = (uInt32 *)((uInt32)(libPtr->linkerRelSymTab[i].dynValue) + (uInt32)libPtr->output);
+ break;
+ }
+ }
+
+ return((uInt32)funcPtr);
+ }
+
diff --git a/src/bin/ld/findlibrary.c b/src/bin/ld/findlibrary.c
new file mode 100644
index 0000000..f071e7d
--- /dev/null
+++ b/src/bin/ld/findlibrary.c
@@ -0,0 +1,13 @@
+#include
+#include "ld.h"
+
+ldLibrary *ldFindLibrary(const char *lib) {
+ ldLibrary *tmpLibs = 0x0;
+
+ for (tmpLibs = libs;tmpLibs != 0x0;tmpLibs = tmpLibs->next) {
+ if (!strcmp(tmpLibs->name,lib)) {
+ return(tmpLibs);
+ }
+ }
+ return(0x0);
+ }
diff --git a/src/bin/ld/ld.h b/src/bin/ld/ld.h
new file mode 100644
index 0000000..4822e68
--- /dev/null
+++ b/src/bin/ld/ld.h
@@ -0,0 +1,42 @@
+#include
+#include
+#include "elf.h"
+
+typedef struct ldLibrary_s {
+ struct ldLibrary_s *next;
+ struct ldLibrary_s *prev;
+ char name[256];
+ elfHeader *linkerHeader;
+ elfSectionHeader *linkerSectionHeader;
+ elfProgramHeader *linkerProgramHeader;
+ elfDynSym *linkerRelSymTab;
+ elfPltInfo *linkerElfRel;
+ char *linkerShStr;
+ char *linkerDynStr;
+ char *output;
+ int sym;
+ } ldLibrary;
+
+extern ldLibrary *libs;
+
+uInt32 ldFindFunc(const char *,const char *);
+ldLibrary *ldFindLibrary(const char *);
+ldLibrary *ldAddLibrary(const char *);
+
+/***
+ $Log$
+ Revision 1.4 2004/06/17 14:10:34 reddawg
+ Fixed some potential problems
+
+ Revision 1.3 2004/06/17 02:58:49 reddawg
+ Cleaned Out Dead Code
+
+ Revision 1.2 2004/06/17 01:52:54 reddawg
+ Maybe?
+
+ Revision 1.1 2004/06/16 23:11:34 reddawg
+ ld.so: now adds librarys it is a little more efficient does the lazy binding
+
+ END
+ ***/
+
diff --git a/src/bin/ld/main.c b/src/bin/ld/main.c
new file mode 100644
index 0000000..d7eabcc
--- /dev/null
+++ b/src/bin/ld/main.c
@@ -0,0 +1,163 @@
+/*****************************************************************************************
+ Copyright (c) 2002-2004 The UbixOS Project
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modification, are
+ permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this list of
+ conditions, the following disclaimer and the list of authors. Redistributions in binary
+ form must reproduce the above copyright notice, this list of conditions, the following
+ disclaimer and the list of authors in the documentation and/or other materials provided
+ with the distribution. Neither the name of the UbixOS Project nor the names of its
+ contributors may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+ OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ $Id$
+
+*****************************************************************************************/
+
+#include
+#include
+#include
+#include "ld.h"
+
+ldLibrary *libs = 0x0;
+
+static elfHeader *binaryHeader = 0x0;
+static elfSectionHeader *binarySectionHeader = 0x0;
+static char *binaryShStr = 0x0;
+static char *binaryDynStr = 0x0;
+static elfDynSym *binaryRelSymTab = 0x0;
+static elfPltInfo *binaryElfRel = 0x0;
+
+uInt32 ld(uInt32 got2,uInt32 entry) {
+ int i = 0x0;
+ int x = 0x0;
+ int rel = 0x0;
+ uInt32 *reMap = 0x0;
+ FILE *binaryFd = 0x0;
+
+ if (binaryHeader == 0x0) {
+ binaryFd = malloc(sizeof(FILE));
+ binaryFd->fd = (uInt32)got2;
+ fseek(binaryFd,0x0,0x0);
+ binaryHeader = (elfHeader *)malloc(sizeof(elfHeader));
+ fread(binaryHeader,sizeof(elfHeader),1,binaryFd);
+ }
+
+ if (binarySectionHeader == 0x0) {
+ binarySectionHeader = (elfSectionHeader *)malloc(sizeof(elfSectionHeader)*binaryHeader->eShnum);
+ fseek(binaryFd,binaryHeader->eShoff,0);
+ fread(binarySectionHeader,sizeof(elfSectionHeader),binaryHeader->eShnum,binaryFd);
+
+ if (binaryShStr == 0x0) {
+ binaryShStr = (char *)malloc(binarySectionHeader[binaryHeader->eShstrndx].shSize);
+ fseek(binaryFd,binarySectionHeader[binaryHeader->eShstrndx].shOffset,0);
+ fread(binaryShStr,binarySectionHeader[binaryHeader->eShstrndx].shSize,1,binaryFd);
+ }
+
+ for (i=0x0;ieShnum;i++) {
+ switch (binarySectionHeader[i].shType) {
+ case 3:
+ if (!strcmp((binaryShStr + binarySectionHeader[i].shName),".dynstr")) {
+ if (binaryDynStr == 0x0) {
+ binaryDynStr = (char *)malloc(binarySectionHeader[i].shSize);
+ fseek(binaryFd,binarySectionHeader[i].shOffset,0);
+ fread(binaryDynStr,binarySectionHeader[i].shSize,1,binaryFd);
+ }
+ }
+ break;
+ case 9:
+ rel = i;
+ break;
+ case 11:
+ if (binaryRelSymTab == 0x0) {
+ binaryRelSymTab = (elfDynSym *)malloc(binarySectionHeader[i].shSize);
+ fseek(binaryFd,binarySectionHeader[i].shOffset,0);
+ fread(binaryRelSymTab,binarySectionHeader[i].shSize,1,binaryFd);
+ }
+ break;
+ }
+ }
+ }
+
+ if (binaryElfRel == 0x0) {
+ fseek(binaryFd,binarySectionHeader[rel].shOffset,0x0);
+ binaryElfRel = (elfPltInfo *)malloc(binarySectionHeader[rel].shSize);
+ fread(binaryElfRel,binarySectionHeader[rel].shSize,1,binaryFd);
+ }
+
+ i = (entry/sizeof(elfPltInfo));
+ x = ELF32_R_SYM(binaryElfRel[i].pltInfo);
+ reMap = (uInt32 *)binaryElfRel[i].pltOffset;
+ *reMap = ldFindFunc(binaryDynStr + binaryRelSymTab[x].dynName,(char *)(binaryDynStr + 1));
+
+ if (binaryFd) {
+ fclose(binaryFd);
+ }
+
+ return(*reMap);
+ }
+
+/***
+ $Log$
+ Revision 1.13 2004/06/18 15:18:04 reddawg
+ bug fixes: did some double checking on pointers and 0x0 out memory
+
+ Revision 1.12 2004/06/17 14:14:44 reddawg
+ Fixed some potential problems
+
+ Revision 1.11 2004/06/17 13:05:14 reddawg
+ dynamic linking: fixed int6 issue problem was multiple rel's
+
+ Revision 1.10 2004/06/17 12:32:11 reddawg
+ the machine should just hlt
+
+ Revision 1.9 2004/06/17 11:58:10 reddawg
+ ld.so: Made a few changes to the way it functions hopefully it will
+ improve some of its performance.
+
+ Revision 1.8 2004/06/17 02:58:49 reddawg
+ Cleaned Out Dead Code
+
+ Revision 1.7 2004/06/17 01:09:24 reddawg
+ TCA: cvs update make and give me output
+
+ Revision 1.6 2004/06/16 23:11:34 reddawg
+ ld.so: now adds librarys it is a little more efficient does the lazy binding
+
+ Revision 1.5 2004/06/16 18:04:15 reddawg
+ Fixed typo printf <--> kprintf
+
+ Revision 1.4 2004/06/16 16:31:58 reddawg
+ ld.so: the dynamic linker works and has been tested
+
+ Revision 1.3 2004/06/16 13:52:51 reddawg
+ Start of userland LD
+
+ Revision 1.2 2004/06/01 01:30:43 reddawg
+ No more warnings and organized make files
+
+ Revision 1.1 2004/04/26 21:16:03 reddawg
+ Initial addition of the ubix LD
+
+ Revision 1.2 2004/04/26 13:20:42 reddawg
+ Turn off muffin
+
+ Revision 1.1 2004/04/26 13:13:25 reddawg
+ Initial Introduction of the UbixOS Format Utility into the source tree
+
+ END
+ ***/
+
diff --git a/src/bin/login/Makefile b/src/bin/login/Makefile
new file mode 100644
index 0000000..205f68f
--- /dev/null
+++ b/src/bin/login/Makefile
@@ -0,0 +1,51 @@
+# $Id$
+# Application Makefile (C) 2002-2004 The UbixOS Project
+
+# Include Global 'Source' Options
+include ../../Makefile.inc
+include ../Makefile.inc
+
+#Linker
+LD = ld
+
+#Binary File Name
+BINARY = login
+
+#Delete Program
+REMOVE = rm -f
+
+#Objects
+OBJS = main.o
+
+#Startup File
+STARTUP = ../../lib/ubix/startup.o
+
+#LIBRARIES = ../../lib/libc/libc.so
+
+# Link The Binary
+$(BINARY) : $(OBJS)
+ $(CC) $(CFLAGS) -o $@ $(STARTUP) $(LIBRARIES) $(OBJS)
+ strip $(BINARY)
+
+# Compile the source files
+.cpp.o:
+ $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.cc.o:
+ $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.cc.s:
+ $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -S -o $@ $<
+
+.c.o:
+ $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.c.s:
+ $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -S -o $@ $<
+
+.S.o:
+ $(CC) -Wall $(CLFAGS) $(INCLUDES) -c -o $@ $<
+
+# Clean Up The junk
+clean:
+ $(REMOVE) $(OBJS) $(BINARY)
diff --git a/src/bin/login/main.c b/src/bin/login/main.c
new file mode 100644
index 0000000..2859677
--- /dev/null
+++ b/src/bin/login/main.c
@@ -0,0 +1,125 @@
+/**************************************************************************************
+ Copyright (c) 2002 The UbixOS Project
+ All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ $Id$
+
+**************************************************************************************/
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+struct passwd {
+ char username[32];
+ char password[32];
+ int uid;
+ int gid;
+ char shell[128];
+ char realname[256];
+ char path[256];
+ };
+
+static char *pgets(char *string) {
+ int count=0,ch=0;
+ while (1) {
+ ch = fgetc(stdin);
+ if(ch == 10) {
+ printf("\n");
+ break;
+ }
+ else if(ch == 8 && count > 0) count-=2;
+ else if(ch == 0) count--;
+ else string[count] = ch;
+ if (ch != 8) printf("*");
+ count++;
+ }
+ string[count] = '\0';
+ return(string);
+ }
+
+int main() {
+ FILE *fd;
+ int shellPid = 0,i = 0x0;
+ char userName[32];
+ char passWord[32];
+ char *data2 = 0x0;
+ struct passwd *data = 0x0;
+ if ((getuid() != 0) && (getgid() != 0)) {
+ printf("This Application Must Be Run As Root.\n");
+ exit(-1);
+ }
+ data = (struct passwd *)malloc(4096);
+ if (!(fd = fopen("userdb@sys","r"))) {
+ printf("Error Opening File");
+ memcpy(data[0].username,"root",4);
+ memcpy(data[0].password,"user",4);
+ memcpy(data[0].shell,"shell@sys", 10);
+ }
+ else {
+ fread(data,4096,1,fd);
+ fclose(fd);
+ }
+ data2 = (char *)malloc(384);
+ login:
+ printf("\nUbixOS/IA-32 (devel.ubixos.com) (console)");
+ printf("\n\nLogin: ");
+ gets((char *)&userName);
+ printf("Password: ");
+ pgets((char *)&passWord);
+ for (i=0x0;i<(4096/sizeof(struct passwd));i++) {
+ if (0x0 == strcmp(userName,data[i].username)) {
+ if (0x0 == strcmp(passWord,data[i].password)) {
+ shellPid = fork();
+ if (!shellPid) {
+ if (setuid(data[i].uid) != 0x0) {
+ printf("Set UID Failed\n");
+ }
+ if (setgid(data[i].gid) != 0x0) {
+ printf("Set GID Failed\n");
+ }
+ if ((fd = fopen("motd@sys","r")) == 0x0) {
+ printf("No MOTD");
+ }
+ else {
+ fread(data2,384,1,fd);
+ printf("%s\n",data2);
+ }
+ fclose(fd);
+ chdir(data[i].path);
+ exec(data[i].shell,0x0,0x0);
+ printf("Error: Problem Starting Shell\n");
+ exit(-1);
+ }
+ else {
+ while (pidStatus(shellPid) > 0) {
+ sched_yield();
+ }
+ goto login;
+ }
+ }
+ }
+ }
+ printf("Login Incorrect!\n");
+ goto login;
+ return(0x0);
+ }
+
diff --git a/src/bin/ls/Makefile b/src/bin/ls/Makefile
new file mode 100644
index 0000000..154fbe4
--- /dev/null
+++ b/src/bin/ls/Makefile
@@ -0,0 +1,51 @@
+# $Id$
+# Application Makefile (C) 2002-2004 The UbixOS Project
+
+# Include Global 'Source' Options
+include ../../Makefile.inc
+include ../Makefile.inc
+
+#Linker
+LD = ld
+
+#Binary File Name
+BINARY = ls
+
+#Delete Program
+REMOVE = rm -f
+
+#Objects
+OBJS = main.o
+
+#Startup File
+STARTUP = ../../lib/ubix/startup.o
+
+LIBRARIES = ../../lib/libc/libc.so
+
+# Link The Binary
+$(BINARY) : $(OBJS)
+ $(CC) $(CFLAGS) -o $@ $(STARTUP) $(LIBRARIES) $(OBJS)
+ strip $(BINARY)
+
+# Compile the source files
+.cpp.o:
+ $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.cc.o:
+ $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.cc.s:
+ $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -S -o $@ $<
+
+.c.o:
+ $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.c.s:
+ $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -S -o $@ $<
+
+.S.o:
+ $(CC) -Wall $(CLFAGS) $(INCLUDES) -c -o $@ $<
+
+# Clean Up The junk
+clean:
+ $(REMOVE) $(OBJS) $(BINARY)
diff --git a/src/bin/ls/main.c b/src/bin/ls/main.c
new file mode 100644
index 0000000..d743265
--- /dev/null
+++ b/src/bin/ls/main.c
@@ -0,0 +1,121 @@
+/**************************************************************************************
+ Copyright (c) 2002 The UbixOS Project
+ All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ $Id$
+
+**************************************************************************************/
+
+#include
+#include
+
+#define permRead 0x8
+#define permWrite 0x4
+#define permExecute 0x2
+#define permHidden 0x1
+
+
+//UbixFS Directory Entry
+struct directoryEntry {
+ uInt32 startCluster; //Starting Cluster Of File
+ uInt32 size; //Size Of File
+ uInt32 creationDate; //Date Created
+ uInt32 lastModified; //Date Last Modified
+ uInt32 uid; //UID Of Owner
+ uInt32 gid; //GID Of Owner
+ uInt16 attributes; //Files Attributes
+ uInt16 permissions; //Files Permissions
+ char fileName[256]; //File Name
+ };
+
+#define typeFile 1
+#define typeContainer 2
+#define typeDirectory 4
+#define typeDeleted 8
+
+int main(int argc,char **argv) {
+ int i = 0x0,x = 0x0,tmpPerms = 0x0;
+ char *pwd = 0x0;
+ char *permsData = 0x0;
+ FILE *fd;
+ struct directoryEntry *dirEntry = 0x0;
+
+ pwd = (char *)malloc(256);
+ permsData = (char *)malloc(13);
+
+ if (argv[1] == 0x0) {
+ if ((fd = fopen(":","rb")) == 0x0) {
+ printf("Error: Reading Directory\n");
+ exit(1);
+ }
+ }
+ else {
+ fd = fopen(argv[1],"rb");
+ if (fd->fd == 0x0) {
+ printf("Error: Reading Directory\n");
+ exit(1);
+ }
+ }
+ dirEntry = (struct directoryEntry *)malloc(fd->size);
+ fread(dirEntry,fd->size,1,fd);
+ pwd[0] = '/';
+ for (i=0;i<(fd->size/sizeof(struct directoryEntry));i++) {
+ if ((dirEntry[i].fileName[0] > 0) && (dirEntry[i].fileName[0] != ':')) {
+ for (x=0;x<12;x++) {
+ permsData[x] = '-';
+ }
+ if ((dirEntry[i].attributes & typeDeleted) == typeDeleted) {
+ permsData[0] = 'd';
+ goto next;
+ }
+ else if ((dirEntry[i].attributes & typeFile) == typeFile) {
+ permsData[0] = 'F';
+ }
+ else if ((dirEntry[i].attributes & typeDirectory) == typeDirectory) {
+ permsData[0] = 'D';
+ }
+ else if ((dirEntry[i].attributes & typeContainer) == typeContainer) {
+ permsData[0] = '@';
+ }
+ else {
+ permsData[0] = 'U';
+ }
+ tmpPerms = ((dirEntry[i].permissions & 0xF00) >> 8);
+ if ((tmpPerms & permRead) == permRead) permsData[1] = 'R';
+ if ((tmpPerms & permWrite) == permWrite) permsData[2] = 'W';
+ if ((tmpPerms & permExecute) == permExecute) permsData[3] = 'E';
+ if ((tmpPerms & permHidden) == permHidden) permsData[4] = 'H';
+ tmpPerms = ((dirEntry[i].permissions & 0x0F0) >> 4);
+ if ((tmpPerms & permRead) == permRead) permsData[5] = 'R';
+ if ((tmpPerms & permWrite) == permWrite) permsData[6] = 'W';
+ if ((tmpPerms & permExecute) == permExecute) permsData[7] = 'E';
+ if ((tmpPerms & permHidden) == permHidden) permsData[8] = 'H';
+ tmpPerms = ((dirEntry[i].permissions & 0x00F) >> 0);
+ if ((tmpPerms & permRead) == permRead) permsData[9] = 'R';
+ if ((tmpPerms & permWrite) == permWrite) permsData[10] = 'W';
+ if ((tmpPerms & permExecute) == permExecute) permsData[11] = 'E';
+ if ((tmpPerms & permHidden) == permHidden) permsData[12] = 'H';
+ printf("%s %i %i %i %s\n",permsData,(int)dirEntry[i].uid,(int)dirEntry[i].gid,(int)dirEntry[i].size,dirEntry[i].fileName);
+ next:
+ }
+ }
+ if (!fclose(fd)) {
+ printf("Error Closing Directory\n");
+ }
+ return(0);
+ }
diff --git a/src/bin/muffin/Makefile b/src/bin/muffin/Makefile
new file mode 100644
index 0000000..5e18ab5
--- /dev/null
+++ b/src/bin/muffin/Makefile
@@ -0,0 +1,55 @@
+# $Id$
+# Application Makefile (C) 2002 The UbixOS Project
+
+# Include Global 'Source' Options
+include ../../Makefile.inc
+include ../Makefile.inc
+
+#Compiler Flags
+CFLAGS = -DNOBOOL -fno-builtin -fno-exceptions -nostdlib -nostdinc
+
+#Linker
+LD = ld
+
+#Binary File Name
+BINARY = muffin
+
+#Delete Program
+REMOVE = rm -f
+
+#Objects
+OBJS = main.o
+
+#Libraries
+LIBRARIES2 = ../../lib/objgfx40/*.o ../../lib/libcpp/*.o
+
+#Include
+INCLUDE = -I../../lib/libc/include -I../../lib/libcpp/include -I../../lib/objgfx40
+
+#Startup File
+STARTUP = ../../lib/ubix/startup.o
+
+# Link The Binary
+$(BINARY) : $(OBJS)
+ $(CC) $(CFLAGS) -o $@ $(STARTUP) $(LIBRARIES) $(LIBRARIES2) $(OBJS)
+ strip $(BINARY)
+
+# Compile the source files
+.cc.o:
+ $(CXX) -Wall -fomit-frame-pointer -O $(CFLAGS) $(INCLUDE) -c -o $@ $<
+
+.cc.s:
+ $(CXX) -Wall -fomit-frame-pointer -O $(CFLAGS) $(INCLUDE) -S -o $@ $<
+
+.c.o:
+ $(CC) -Wall -O $(CFLAGS) $(INCLUDE) -c -o $@ $<
+
+.c.s:
+ $(CC) -Wall -fomit-frame-pointer -O $(CFLAGS) $(INCLUDE) -S -o $@ $<
+
+.S.o:
+ $(CC) -Wall -fomit-frame-pointer $(INCLUDE) -c -o $@ $<
+
+# Clean Up The junk
+clean:
+ $(REMOVE) $(OBJS) $(BINARY)
diff --git a/src/bin/muffin/main.cc b/src/bin/muffin/main.cc
new file mode 100644
index 0000000..30868da
--- /dev/null
+++ b/src/bin/muffin/main.cc
@@ -0,0 +1,35 @@
+#include
+extern "C" {
+ #include
+ #include
+ #include
+ }
+
+int main() {
+ vWindow *window = new vWindow();
+ uInt16 i = 0x0;
+ uInt16 ii = 0x0;
+ uInt16 iii = 0x0;
+ if (fork() == 0x0) {
+ window->vCreate();
+ window->vSDECommand(1);
+ while (1) {
+ for (i=0x2;i<0xFF;i += 16) {
+ for (ii=0x0;ii<0xFF;ii+= 16) {
+ for (iii= 0x0;iii< 0xFF;iii+= 16) {
+ window->Clear(window->Pack(i,ii,iii));
+ window->FillRect(50, 50, 100, 100, window->Pack(255, 0, 0));
+ window->FillRect(50, 50, 100, 100, window->Pack(255, 0, 0));
+ window->FillRect(100, 50, 150, 100, window->Pack(0, 255, 0));
+ window->FillRect(150, 50, 200, 100, window->Pack(0, 0, 255));
+ window->FillRect(200, 50, 250, 100, window->Pack(0, 0, 0));
+ window->FillRect(250, 50, 300, 100, window->Pack(255, 255, 255));
+ window->vSDECommand(3);
+ }
+ }
+ }
+ }
+ window->vSDECommand(4);
+ }
+ return(0);
+ }
diff --git a/src/bin/shell/Makefile b/src/bin/shell/Makefile
new file mode 100644
index 0000000..9cfa222
--- /dev/null
+++ b/src/bin/shell/Makefile
@@ -0,0 +1,51 @@
+# $Id$
+# Application Makefile (C) 2002-2004 The UbixOS Project
+
+# Include Global 'Source' Options
+include ../../Makefile.inc
+include ../Makefile.inc
+
+#Linker
+LD = ld
+
+#Binary File Name
+BINARY = shell
+
+#Delete Program
+REMOVE = rm -f
+
+#Objects
+OBJS = main.o error.o commands.o exec.o input.o
+
+#Startup File
+STARTUP = ../../lib/ubix/startup.o
+
+LIBRARIES = ../../lib/libc/libc.so
+
+# Link The Binary
+$(BINARY) : $(OBJS)
+ $(CC) $(CFLAGS) -o $@ $(STARTUP) $(LIBRARIES) $(OBJS)
+ strip $(BINARY)
+
+# Compile the source files
+.cpp.o:
+ $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.cc.o:
+ $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.cc.s:
+ $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -S -o $@ $<
+
+.c.o:
+ $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.c.s:
+ $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -S -o $@ $<
+
+.S.o:
+ $(CC) -Wall $(CLFAGS) $(INCLUDES) -c -o $@ $<
+
+# Clean Up The junk
+clean:
+ $(REMOVE) $(OBJS) $(BINARY)
diff --git a/src/bin/shell/commands.c b/src/bin/shell/commands.c
new file mode 100644
index 0000000..f2f4dfb
--- /dev/null
+++ b/src/bin/shell/commands.c
@@ -0,0 +1,103 @@
+/**************************************************************************************
+ Copyright (c) 2002 The UbixOS Project
+ All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ $Id$
+
+**************************************************************************************/
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include "shell.h"
+
+int commands(inputBuffer *data) {
+ int cPid = 0x0,i = 0x0;
+ if (0 == memcmp(data->args->arg, "uname", 5)) {
+ printf("UbixOS v0.87 " __DATE__" " __TIME__ " \n");
+ return(1);
+ }
+ else if (0 == memcmp(data->args->arg, "exit", 4)) {
+ exit(1);
+ }
+ else if (0 == memcmp(data->args->arg, "mypid", 5)) {
+ printf("My Pid: [%i]\n",getpid());
+ return(1);
+ }
+ else if (memcmp(data->args->arg,"stress", 6) == 0) {
+ while (1) {
+ cPid = fork();
+ if (!cPid) {
+ printf("Pid: [%i]\n",cPid);
+ exec("clock",0x0,0x0);
+ exit(-1);
+ }
+ else {
+ while (pidStatus(cPid))
+ sched_yield();
+ }
+ }
+ }
+ else if (memcmp(data->args->arg,"echo",4) == 0) {
+ for (i=1;iargc;i++) {
+ printf("%s ",data->argv[i]);
+ }
+ printf("\n");
+ }
+ else if (memcmp(data->args->arg,"about",5) == 0) {
+ printf("UbixOS Shell v0.99 (C) 2002\n");
+ printf("Base Command Line Interface\n");
+ }
+ else if (memcmp(data->args->arg,"cd",2) == 0) {
+ if (data->argv[1]) {
+ chdir(data->argv[1]);
+ getcwd(cwd,1024);
+ }
+ }
+ else if (memcmp(data->args->arg,"unlink",6) == 0) {
+ if (data->argv[1]) {
+ unlink(data->argv[1]);
+ }
+ }
+ else if (memcmp(data->args->arg,"msg",3) == 0x0) {
+ mpiPostMessage(data->argv[1],atoi(data->argv[2]),data->argv[3]);
+ for (i=0;i<10;i++) {
+ sched_yield();
+ }
+ }
+ else if (memcmp(data->args->arg,"mkdir",5) == 0x0) {
+ if (data->argv[1]) {
+ mkdir(data->argv[1],0xEAA);
+ }
+ }
+ else if (memcmp(data->args->arg,"id",2) == 0x0) {
+ printf("UID: %i, GID: %i\n",getuid(),getgid());
+ }
+ else if (!strcmp(data->argv[0],"reboot")) {
+ mpiPostMessage("system",1000,0x0);
+ }
+ else {
+ return(0);
+ }
+ return(1);
+ }
diff --git a/src/bin/shell/error.c b/src/bin/shell/error.c
new file mode 100644
index 0000000..adf30a6
--- /dev/null
+++ b/src/bin/shell/error.c
@@ -0,0 +1,30 @@
+/**************************************************************************************
+ Copyright (c) 2002 The UbixOS Project
+ All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ $Id$
+
+**************************************************************************************/
+
+#include
+#include
+
+void error(int errorCode,const char *errorMsg) {
+ printf("ERROR: #%i Message: %s\n", errorCode, errorMsg);
+ exit(errorCode);
+ }
diff --git a/src/bin/shell/exec.c b/src/bin/shell/exec.c
new file mode 100644
index 0000000..1a34679
--- /dev/null
+++ b/src/bin/shell/exec.c
@@ -0,0 +1,45 @@
+/**************************************************************************************
+ Copyright (c) 2002 The UbixOS Project
+ All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ $Id$
+
+**************************************************************************************/
+
+#include
+#include
+#include
+#include
+#include
+#include "shell.h"
+
+void execProgram(inputBuffer *data) {
+ int cPid = 0x0;
+ cPid = fork();
+ if (!cPid) {
+ exec(data->argv[0],data->argc,data->argv);
+ printf("%s: Command Not Found.\n",data->argv[0]);
+ exit(-1);
+ }
+ else {
+ if (data->bg == 0x0) {
+ while (pidStatus(cPid) > 0)
+ sched_yield();
+ }
+ }
+ }
diff --git a/src/bin/shell/input.c b/src/bin/shell/input.c
new file mode 100644
index 0000000..7b57d7f
--- /dev/null
+++ b/src/bin/shell/input.c
@@ -0,0 +1,70 @@
+/**************************************************************************************
+ Copyright (c) 2002 The UbixOS Project
+ All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ $Id$
+
+**************************************************************************************/
+
+#include
+#include
+#include
+#include "shell.h"
+
+void parseInput(inputBuffer *buffer,char *data) {
+ int i = 0x0;
+ char *arg = 0x0;
+ struct argsStruct *tmpArgs = 0x0;
+
+ while (data[0] == ' ') {
+ data++;
+ }
+
+ if (*data == '\0') return;
+
+ buffer->args = (struct argsStruct *)malloc(sizeof(struct argsStruct));
+ tmpArgs = buffer->args;
+
+ while(data != 0x0) {
+ arg = strtok(data," ");
+ data = strtok(NULL,"\n");
+ if (arg[0] == '&') {
+ buffer->bg = 0x1;
+ }
+ else {
+ buffer->argc++;
+ tmpArgs->arg = arg;
+ if (data != 0x0) {
+ tmpArgs->next = (struct argsStruct *)malloc(sizeof(struct argsStruct));
+ }
+ tmpArgs = tmpArgs->next;
+ }
+ }
+
+ buffer->argv = (char **)malloc(4*buffer->argc);
+ tmpArgs = buffer->args;
+ for (i=0;iargc;i++) {
+ buffer->argv[i] = tmpArgs->arg;
+ tmpArgs = tmpArgs->next;
+ }
+ }
+
+void freeArgs(inputBuffer *ptr) {
+ free(ptr->args);
+ //free(tmpArgs->argv);
+ }
diff --git a/src/bin/shell/main.c b/src/bin/shell/main.c
new file mode 100644
index 0000000..76fa278
--- /dev/null
+++ b/src/bin/shell/main.c
@@ -0,0 +1,62 @@
+/**************************************************************************************
+ Copyright (c) 2002 The UbixOS Project
+ All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ $Id$
+
+**************************************************************************************/
+
+#include
+#include
+#include
+#include
+#include
+#include "shell.h"
+
+char *machine = 0x0;
+char *cwd = 0x0;
+char *cwc = 0x0;
+
+int main() {
+ char *data = 0x0;
+ char *buffer = (char *)malloc(512);
+ inputBuffer *inBuf = (inputBuffer *)malloc(sizeof(inputBuffer));
+
+ machine = (char *)malloc(32);
+ cwd = (char *)malloc(1024);
+ cwc = (char *)malloc(32);
+
+ sprintf(machine,"uBixCube");
+ getcwd(cwd,1024);
+ sprintf(cwc,"sys");
+
+ while (1) {
+ printf("%s:%s@%s> ",machine,cwd,cwc);
+ gets((char *)buffer);
+ data = (uInt8 *)buffer;
+ parseInput(inBuf,data);
+ if (inBuf->args->arg != 0x0) {
+ if (!commands(inBuf)) execProgram(inBuf);
+ }
+ freeArgs(inBuf);
+ inBuf->argc = 0x0;
+ inBuf->args = 0x0;
+ inBuf->bg = 0x0;
+ }
+ return(0x0);
+ }
diff --git a/src/bin/shell/shell.h b/src/bin/shell/shell.h
new file mode 100644
index 0000000..4d0f59f
--- /dev/null
+++ b/src/bin/shell/shell.h
@@ -0,0 +1,21 @@
+#include
+
+extern char *cwd;
+
+struct argsStruct {
+ struct argsStruct *next;
+ char *arg;
+ };
+
+typedef struct {
+ int argc;
+ char **argv;
+ uInt8 bg;
+ struct argsStruct *args;
+ } inputBuffer;
+
+void parseInput(inputBuffer *,char *);
+int commands(inputBuffer *);
+void execProgram(inputBuffer *);
+void freeArgs(inputBuffer *ptr);
+void error(int errorCode,const char *errorMsg);
diff --git a/src/bin/test/Makefile b/src/bin/test/Makefile
new file mode 100644
index 0000000..021df1a
--- /dev/null
+++ b/src/bin/test/Makefile
@@ -0,0 +1,53 @@
+# $Id$
+# Application Makefile (C) 2002-2004 The UbixOS Project
+
+# Include Global 'Source' Options
+include ../../Makefile.inc
+include ../Makefile.inc
+
+INCLUDES += -I./include -I../../lib/views/sunlight/include -I../../lib/libcpp/include -I../../lib/objgfx40
+CFLAGS = -fno-builtin -nostdlib -nostdinc -nostdlib -fno-builtin -fno-exceptions -frtti
+LIBRARIES = ../../lib/libc/libc.so ../../lib/libstdc++/*.o ../../lib/objgfx40/objgfx40.so
+
+#Linker
+LD = ld
+
+#Binary File Name
+BINARY = test
+
+#Delete Program
+REMOVE = rm -f
+
+#Objects
+OBJS = main.o
+
+#Startup File
+STARTUP = ../../lib/ubix/startup.o
+
+# Link The Binary
+$(BINARY) : $(OBJS)
+ $(CXX) $(CFLAGS) -o $@ $(STARTUP) $(LIBRARIES) $(OBJS)
+ strip $(BINARY)
+
+# Compile the source files
+.cpp.o:
+ $(CXX) -Wall -O -DNOBOOL $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.cc.o:
+ $(CXX) -Wall -O -DNOBOOL $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.cc.s:
+ $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -S -o $@ $<
+
+.c.o:
+ $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.c.s:
+ $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -S -o $@ $<
+
+.S.o:
+ $(CC) -Wall $(CLFAGS) $(INCLUDES) -c -o $@ $<
+
+# Clean Up The junk
+clean:
+ $(REMOVE) $(OBJS) $(BINARY)
diff --git a/src/bin/test/include/ubixButton.h b/src/bin/test/include/ubixButton.h
new file mode 100644
index 0000000..34ee379
--- /dev/null
+++ b/src/bin/test/include/ubixButton.h
@@ -0,0 +1,13 @@
+#ifndef UBIXBUTTON_H
+#define UBIXBUTTON_H
+
+#include
+
+class ubixButton : public vButton {
+ public:
+ ubixButton(vContext *);
+// virtual bool vCreate(void);
+ virtual void vDraw(void);
+ virtual ~ubixButton(void);
+}; // ubixButton
+#endif
diff --git a/src/bin/test/include/ubixDesktop.h b/src/bin/test/include/ubixDesktop.h
new file mode 100644
index 0000000..61a1a38
--- /dev/null
+++ b/src/bin/test/include/ubixDesktop.h
@@ -0,0 +1,14 @@
+#ifndef UBIXDESKTOP_H
+#define UBIXDESKTOP_H
+
+#include
+
+class ubixDesktop : public vContext {
+ protected:
+ public:
+ ubixDesktop(vContext *);
+ virtual bool vCreate(void);
+ virtual void vDraw(void);
+ virtual ~ubixDesktop(void);
+}; // ubixDesktop
+#endif
diff --git a/src/bin/test/main.cpp b/src/bin/test/main.cpp
new file mode 100644
index 0000000..cfe12f4
--- /dev/null
+++ b/src/bin/test/main.cpp
@@ -0,0 +1,10 @@
+#include
+
+extern "C" {
+ #include
+ }
+
+int main(void) {
+ printf("Test");
+ return 0;
+ }
diff --git a/src/bin/test/test b/src/bin/test/test
new file mode 100755
index 0000000..a7f2d9b
--- /dev/null
+++ b/src/bin/test/test
Binary files differ
diff --git a/src/bin/ubistry/Makefile b/src/bin/ubistry/Makefile
new file mode 100644
index 0000000..46bea2a
--- /dev/null
+++ b/src/bin/ubistry/Makefile
@@ -0,0 +1,51 @@
+# $Id$
+# Application Makefile (C) 2002-2004 The UbixOS Project
+
+# Include Global 'Source' Options
+include ../../Makefile.inc
+include ../Makefile.inc
+
+#Linker
+LD = ld
+
+#Binary File Name
+BINARY = ubistry
+
+#Delete Program
+REMOVE = rm -f
+
+#Objects
+OBJS = db.o message.o main.o
+
+#Startup File
+STARTUP = ../../lib/ubix/startup.o
+
+LIBRARIES = ../../lib/libc/libc.so
+
+# Link The Binary
+$(BINARY) : $(OBJS)
+ $(CC) $(CFLAGS) -o $@ $(STARTUP) $(LIBRARIES) $(OBJS)
+ strip $(BINARY)
+
+# Compile the source files
+.cpp.o:
+ $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.cc.o:
+ $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.cc.s:
+ $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -S -o $@ $<
+
+.c.o:
+ $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+.c.s:
+ $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -S -o $@ $<
+
+.S.o:
+ $(CC) -Wall $(CLFAGS) $(INCLUDES) -c -o $@ $<
+
+# Clean Up The junk
+clean:
+ $(REMOVE) $(OBJS) $(BINARY)
diff --git a/src/bin/ubistry/db.c b/src/bin/ubistry/db.c
new file mode 100644
index 0000000..d495e29
--- /dev/null
+++ b/src/bin/ubistry/db.c
@@ -0,0 +1,80 @@
+/*****************************************************************************************
+ Copyright (c) 2002-2004 The UbixOS Project
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modification, are
+ permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this list of
+ conditions, the following disclaimer and the list of authors. Redistributions in binary
+ form must reproduce the above copyright notice, this list of conditions, the following
+ disclaimer and the list of authors in the documentation and/or other materials provided
+ with the distribution. Neither the name of the UbixOS Project nor the names of its
+ contributors may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+ OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ $Id$
+
+*****************************************************************************************/
+
+#include
+#include
+#include
+#include "./include/ubistry.h"
+
+static struct ubistryKey *keys = 0x0;
+
+
+struct ubistryKey * ubistryFindKey(char *name) {
+ struct ubistryKey *tmpKey = keys;
+
+ for (;tmpKey;tmpKey=tmpKey->next) {
+ if (!strcmp(name,tmpKey->name)) {
+ return(tmpKey);
+ }
+ }
+ return(0x0);
+ }
+
+int ubistryAddKey(char *name,char *value) {
+ struct ubistryKey *tmpKey = (struct ubistryKey *)malloc(sizeof(struct ubistryKey));
+
+ sprintf(tmpKey->name,name);
+ sprintf(tmpKey->value,value);
+
+ if (keys == 0x0) {
+ keys = tmpKey;
+ keys->prev = 0x0;
+ keys->next = 0x0;
+ }
+ else {
+ tmpKey->next = keys;
+ tmpKey->prev = 0x0;
+ keys->prev = tmpKey;
+ keys = tmpKey;
+ }
+
+ return(0x0);
+ }
+
+/***
+ $Log$
+ Revision 1.2 2004/06/17 15:10:55 reddawg
+ Fixed Some Global Variables
+
+ Revision 1.1 2004/05/26 15:41:20 reddawg
+ ubistry: added command 666 which will restart the registry server also added
+ command 51 to add a key format key,value
+
+ END
+ ***/
diff --git a/src/bin/ubistry/include/ubistry.h b/src/bin/ubistry/include/ubistry.h
new file mode 100644
index 0000000..231acea
--- /dev/null
+++ b/src/bin/ubistry/include/ubistry.h
@@ -0,0 +1,15 @@
+#include
+
+#define MBOX_NAME "ubistry"
+
+struct ubistryKey {
+ struct ubistryKey *prev;
+ struct ubistryKey *next;
+ char name[128];
+ char value[512];
+ };
+
+struct ubistryKey * ubistryFindKey(char *);
+int ubistryAddKey(char *,char *);
+int ubistryInitMbox(char *);
+void ubistryProcessMessages();
diff --git a/src/bin/ubistry/main.c b/src/bin/ubistry/main.c
new file mode 100644
index 0000000..88d0eed
--- /dev/null
+++ b/src/bin/ubistry/main.c
@@ -0,0 +1,87 @@
+/*****************************************************************************************
+ Copyright (c) 2002-2004 The UbixOS Project
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modification, are
+ permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this list of
+ conditions, the following disclaimer and the list of authors. Redistributions in binary
+ form must reproduce the above copyright notice, this list of conditions, the following
+ disclaimer and the list of authors in the documentation and/or other materials provided
+ with the distribution. Neither the name of the UbixOS Project nor the names of its
+ contributors may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+ OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ $Id$
+
+*****************************************************************************************/
+
+#include
+#include
+#include
+#include
+#include
+#include "./include/ubistry.h"
+
+int main(int argc,char **argv) {
+ //FILE *pidFile;
+
+ if (fork() != 0x0) {
+ //sched_yield();
+ exit(0x0);
+ }
+
+ ubistryInitMbox(MBOX_NAME);
+
+ ubistryAddKey("Ubu","Creator Of UbixOS");
+ ubistryAddKey("TCA","The GUI GUY!!!");
+
+ while (1) {
+ ubistryProcessMessages();
+ sched_yield();
+ }
+
+ exit(0x0);
+ }
+
+/***
+ $Log$
+ Revision 1.7 2004/06/17 15:10:55 reddawg
+ Fixed Some Global Variables
+
+ Revision 1.6 2004/06/10 13:08:00 reddawg
+ Minor Bug Fixes
+
+ Revision 1.5 2004/06/01 01:30:43 reddawg
+ No more warnings and organized make files
+
+ Revision 1.4 2004/05/26 15:41:20 reddawg
+ ubistry: added command 666 which will restart the registry server also added
+ command 51 to add a key format key,value
+
+ Revision 1.3 2004/05/26 13:10:39 reddawg
+ ubistry: added two functions
+ ubistryFindKey(char *name) <- Will find key with specified name
+ ubistryAddKey(char *name,char *value) <-> Will add key with specified
+ name and value
+
+ Revision 1.2 2004/05/26 12:16:02 reddawg
+ ubistry: now runs as a deamon
+
+ Revision 1.1 2004/05/26 12:09:12 reddawg
+ ubistry: this is the frame work for the ubix registry system more to come
+ over the next few days
+
+ END
+ ***/
diff --git a/src/bin/ubistry/message.c b/src/bin/ubistry/message.c
new file mode 100644
index 0000000..1d5f9d6
--- /dev/null
+++ b/src/bin/ubistry/message.c
@@ -0,0 +1,95 @@
+/*****************************************************************************************
+ Copyright (c) 2002-2004 The UbixOS Project
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modification, are
+ permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this list of
+ conditions, the following disclaimer and the list of authors. Redistributions in binary
+ form must reproduce the above copyright notice, this list of conditions, the following
+ disclaimer and the list of authors in the documentation and/or other materials provided
+ with the distribution. Neither the name of the UbixOS Project nor the names of its
+ contributors may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+ OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ $Id$
+
+*****************************************************************************************/
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include "./include/ubistry.h"
+
+int ubistryInitMbox(char *name) {
+
+ if (mpiCreateMbox(name) != 0x0) {
+ printf("Error: Error Creating Mail Box: [%s]\n",name);
+ return(-1);
+ }
+
+ return(0x0);
+ }
+
+void ubistryProcessMessages() {
+ mpiMessage_t msg;
+ struct ubistryKey *tmpKey = 0x0;
+ char *key,*value;
+
+ mfmStart:
+ if (mpiFetchMessage("ubistry",&msg) == 0x0) {
+ switch (msg.type) {
+ case 50:
+ tmpKey = ubistryFindKey(msg.data);
+ if (tmpKey == 0x0)
+ printf("ubistry: Key (%s) Not Found\n",msg.data);
+ else
+ printf("ubistry: Key (%s) Found Has Value (%s)\n",tmpKey->name,tmpKey->value);
+ break;
+ case 51:
+ key = strtok(msg.data,",");
+ value = strtok(NULL,"\n");
+ printf("ubistry: Adding key (%s) with value (%s)\n",key,value);
+ ubistryAddKey(key,value);
+ break;
+ case 666:
+ mpiDestroyMbox("ubistry");
+ if (fork() == 0x0) {
+ printf("ubistry: Restarting\n");
+ exec("ubistry@sys",0x0,0x0);
+ }
+ else {
+ exit(0x0);
+ }
+ break;
+ default:
+ printf("ubistry: Command (%i) With Data (%s) Not Valid\n",msg.type,msg.data);
+ break;
+ }
+ goto mfmStart;
+ }
+ return;
+ }
+
+/***
+ $Log$
+ Revision 1.1 2004/05/26 15:41:20 reddawg
+ ubistry: added command 666 which will restart the registry server also added
+ command 51 to add a key format key,value
+
+ END
+ ***/
diff --git a/src/bin/views/Makefile b/src/bin/views/Makefile
new file mode 100644
index 0000000..363704c
--- /dev/null
+++ b/src/bin/views/Makefile
@@ -0,0 +1,52 @@
+# $Id$
+# Application Makefile (C) 2002 The UbixOS Project
+
+# Include Global 'Source' Options
+include ../../Makefile.inc
+
+#Compiler Flags
+CFLAGS = -I../../lib/libc/include -fno-builtin -nostdlib -nostdinc
+
+#Linker
+LD = ld
+
+#Binary File Name
+BINARY = views
+
+#Delete Program
+REMOVE = rm -f
+
+#Objects
+OBJS = main.o
+
+#Libraries
+#LIBRARIES = ../../lib/libc/libc.so
+LIBRARIES = ../../lib/libc/locale/*.o ../../lib/libc/stdio/*.o ../../lib/libc/stdlib/*.o ../../lib/libc/sys/*.o ../../lib/libc/string/*.o
+
+#Startup File
+STARTUP = ../../lib/ubix/startup.o
+
+# Link The Binary
+$(BINARY) : $(OBJS)
+ $(CC) $(CFLAGS) -o $@ $(STARTUP) $(LIBRARIES) $(OBJS)
+ strip $(BINARY)
+
+# Compile the source files
+.cc.o:
+ $(CXX) -Wall -fomit-frame-pointer -O $(CFLAGS) -c -o $@ $<
+
+.cc.s:
+ $(CXX) -Wall -fomit-frame-pointer -O $(CFLAGS) -S -o $@ $<
+
+.c.o:
+ $(CC) -Wall -O $(CFLAGS) -c -o $@ $<
+
+.c.s:
+ $(CC) -Wall -fomit-frame-pointer -O $(CFLAGS) -S -o $@ $<
+
+.S.o:
+ $(CC) -Wall -fomit-frame-pointer -c -o $@ $<
+
+# Clean Up The junk
+clean:
+ $(REMOVE) $(OBJS) $(BINARY)
diff --git a/src/bin/views/main.c b/src/bin/views/main.c
new file mode 100644
index 0000000..e86deaa
--- /dev/null
+++ b/src/bin/views/main.c
@@ -0,0 +1,34 @@
+/**************************************************************************************
+ Copyright (c) 2002 The UbixOS Project
+ All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ $Id$
+
+**************************************************************************************/
+
+#include
+#include
+
+int main(int argc,char **argv) {
+ return(0);
+ }
+
+/***
+ END
+ ***/
+
diff --git a/src/include/_semaphore.h b/src/include/_semaphore.h
new file mode 100644
index 0000000..e65181f
--- /dev/null
+++ b/src/include/_semaphore.h
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2002 Alfred Perlstein
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: src/sys/posix4/_semaphore.h,v 1.3 2004/02/03 22:27:03 deischen Exp $
+ */
+#ifndef __SEMAPHORE_H_
+#define __SEMAPHORE_H_
+
+typedef intptr_t semid_t;
+struct timespec;
+
+#ifndef _KERNEL
+
+#include
+
+/*
+ * Semaphore definitions.
+ */
+struct sem {
+#define SEM_MAGIC ((u_int32_t) 0x09fa4012)
+ u_int32_t magic;
+ pthread_mutex_t lock;
+ pthread_cond_t gtzero;
+ u_int32_t count;
+ u_int32_t nwaiters;
+#define SEM_USER (NULL)
+ semid_t semid; /* semaphore id if kernel (shared) semaphore */
+ int syssem; /* 1 if kernel (shared) semaphore */
+ LIST_ENTRY(sem) entry;
+ struct sem **backpointer;
+};
+
+__BEGIN_DECLS
+
+int ksem_close(semid_t id);
+int ksem_post(semid_t id);
+int ksem_wait(semid_t id);
+int ksem_trywait(semid_t id);
+int ksem_timedwait(semid_t id, struct timespec *abstime);
+int ksem_init(semid_t *idp, unsigned int value);
+int ksem_open(semid_t *idp, const char *name, int oflag, mode_t mode,
+ unsigned int value);
+int ksem_unlink(const char *name);
+int ksem_getvalue(semid_t id, int *val);
+int ksem_destroy(semid_t id);
+
+__END_DECLS
+
+#endif /* !_KERNEL */
+
+#endif /* __SEMAPHORE_H_ */
diff --git a/src/include/a.out.h b/src/include/a.out.h
new file mode 100644
index 0000000..176b39c
--- /dev/null
+++ b/src/include/a.out.h
@@ -0,0 +1,47 @@
+/*-
+ * Copyright (c) 1991, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)a.out.h 8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _AOUT_H_
+#define _AOUT_H_
+
+#include
+#include
+#include
+#include
+
+#define _AOUT_INCLUDE_
+#include
+
+#endif /* !_AOUT_H_ */
diff --git a/src/include/aio.h b/src/include/aio.h
new file mode 100644
index 0000000..f311e3c
--- /dev/null
+++ b/src/include/aio.h
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 1997 John S. Dyson. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. John S. Dyson's name may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * DISCLAIMER: This code isn't warranted to do anything useful. Anything
+ * bad that happens because of using this software isn't the responsibility
+ * of the author. This software is distributed AS-IS.
+ *
+ * $FreeBSD: src/sys/sys/aio.h,v 1.29 2002/01/06 21:03:39 alc Exp $
+ */
+
+#ifndef _SYS_AIO_H_
+#define _SYS_AIO_H_
+
+#include
+#include
+#include
+
+/*
+ * Returned by aio_cancel:
+ */
+#define AIO_CANCELED 0x1
+#define AIO_NOTCANCELED 0x2
+#define AIO_ALLDONE 0x3
+
+/*
+ * LIO opcodes
+ */
+#define LIO_NOP 0x0
+#define LIO_WRITE 0x1
+#define LIO_READ 0x2
+
+/*
+ * LIO modes
+ */
+#define LIO_NOWAIT 0x0
+#define LIO_WAIT 0x1
+
+/*
+ * Maximum number of allowed LIO operations
+ */
+#define AIO_LISTIO_MAX 16
+
+/*
+ * Private members for aiocb -- don't access
+ * directly.
+ */
+struct __aiocb_private {
+ long status;
+ long error;
+ void *kernelinfo;
+};
+
+/*
+ * I/O control block
+ */
+typedef struct aiocb {
+ int aio_fildes; /* File descriptor */
+ off_t aio_offset; /* File offset for I/O */
+ volatile void *aio_buf; /* I/O buffer in process space */
+ size_t aio_nbytes; /* Number of bytes for I/O */
+ struct sigevent aio_sigevent; /* Signal to deliver */
+ int aio_lio_opcode; /* LIO opcode */
+ int aio_reqprio; /* Request priority -- ignored */
+ struct __aiocb_private _aiocb_private;
+} aiocb_t;
+
+#ifndef _KERNEL
+
+__BEGIN_DECLS
+/*
+ * Asynchronously read from a file
+ */
+int aio_read(struct aiocb *);
+
+/*
+ * Asynchronously write to file
+ */
+int aio_write(struct aiocb *);
+
+/*
+ * List I/O Asynchronously/synchronously read/write to/from file
+ * "lio_mode" specifies whether or not the I/O is synchronous.
+ * "acb_list" is an array of "nacb_listent" I/O control blocks.
+ * when all I/Os are complete, the optional signal "sig" is sent.
+ */
+int lio_listio(int, struct aiocb * const [], int, struct sigevent *);
+
+/*
+ * Get completion status
+ * returns EINPROGRESS until I/O is complete.
+ * this routine does not block.
+ */
+int aio_error(const struct aiocb *);
+
+/*
+ * Finish up I/O, releasing I/O resources and returns the value
+ * that would have been associated with a synchronous I/O request.
+ * This routine must be called once and only once for each
+ * I/O control block who has had I/O associated with it.
+ */
+ssize_t aio_return(struct aiocb *);
+
+/*
+ * Cancel I/O
+ */
+int aio_cancel(int, struct aiocb *);
+
+/*
+ * Suspend until all specified I/O or timeout is complete.
+ */
+int aio_suspend(const struct aiocb * const[], int, const struct timespec *);
+
+int aio_waitcomplete(struct aiocb **, struct timespec *);
+
+__END_DECLS
+
+#else
+
+/* Forward declarations for prototypes below. */
+struct socket;
+struct sockbuf;
+
+extern void (*aio_swake)(struct socket *, struct sockbuf *);
+
+#endif
+
+#endif
diff --git a/src/include/alias.h b/src/include/alias.h
new file mode 100644
index 0000000..a3cccab
--- /dev/null
+++ b/src/include/alias.h
@@ -0,0 +1,264 @@
+/* lint -save -library Flexelint comment for external headers */
+
+/*-
+ * Copyright (c) 2001 Charles Mott
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: src/lib/libalias/alias.h,v 1.27 2004/03/16 21:30:41 des Exp $
+ */
+
+/*-
+ * Alias.h defines the outside world interfaces for the packet aliasing
+ * software.
+ *
+ * This software is placed into the public domain with no restrictions on its
+ * distribution.
+ */
+
+#ifndef _ALIAS_H_
+#define _ALIAS_H_
+
+/*
+ * The external interface to libalias, the packet aliasing engine.
+ *
+ * There are two sets of functions:
+ *
+ * PacketAlias*() the old API which doesn't take an instance pointer
+ * and therefore can only have one packet engine at a time.
+ *
+ * LibAlias*() the new API which takes as first argument a pointer to
+ * the instance of the packet aliasing engine.
+ *
+ * The functions otherwise correspond to each other one for one, except
+ * for the LibAliasUnaliasOut()/PacketUnaliasOut() function which were
+ * were misnamed in the old API.
+ */
+
+/*
+ * The instance structure
+ */
+struct libalias;
+
+/*
+ * An anonymous structure, a pointer to which is returned from
+ * PacketAliasRedirectAddr(), PacketAliasRedirectPort() or
+ * PacketAliasRedirectProto(), passed to PacketAliasAddServer(),
+ * and freed by PacketAliasRedirectDelete().
+ */
+struct alias_link;
+
+
+/* OLD API */
+
+/* Initialization and control functions. */
+void PacketAliasInit(void);
+void PacketAliasSetAddress(struct in_addr _addr);
+void PacketAliasSetFWBase(unsigned int _base, unsigned int _num);
+void PacketAliasSetSkinnyPort(unsigned int _port);
+unsigned int
+ PacketAliasSetMode(unsigned int _flags, unsigned int _mask);
+void PacketAliasUninit(void);
+
+/* Packet Handling functions. */
+int PacketAliasIn(char *_ptr, int _maxpacketsize);
+int PacketAliasOut(char *_ptr, int _maxpacketsize);
+int PacketUnaliasOut(char *_ptr, int _maxpacketsize);
+
+/* Port and address redirection functions. */
+
+
+int
+PacketAliasAddServer(struct alias_link *_link,
+ struct in_addr _addr, unsigned short _port);
+struct alias_link *
+PacketAliasRedirectAddr(struct in_addr _src_addr,
+ struct in_addr _alias_addr);
+int PacketAliasRedirectDynamic(struct alias_link *_link);
+void PacketAliasRedirectDelete(struct alias_link *_link);
+struct alias_link *
+PacketAliasRedirectPort(struct in_addr _src_addr,
+ unsigned short _src_port, struct in_addr _dst_addr,
+ unsigned short _dst_port, struct in_addr _alias_addr,
+ unsigned short _alias_port, unsigned char _proto);
+struct alias_link *
+PacketAliasRedirectProto(struct in_addr _src_addr,
+ struct in_addr _dst_addr, struct in_addr _alias_addr,
+ unsigned char _proto);
+
+/* Fragment Handling functions. */
+void PacketAliasFragmentIn(char *_ptr, char *_ptr_fragment);
+char *PacketAliasGetFragment(char *_ptr);
+int PacketAliasSaveFragment(char *_ptr);
+
+/* Miscellaneous functions. */
+int PacketAliasCheckNewLink(void);
+unsigned short
+ PacketAliasInternetChecksum(unsigned short *_ptr, int _nbytes);
+void PacketAliasSetTarget(struct in_addr _target_addr);
+
+/* Transparent proxying routines. */
+int PacketAliasProxyRule(const char *_cmd);
+
+/* NEW API */
+
+/* Initialization and control functions. */
+struct libalias *LibAliasInit(struct libalias *);
+void LibAliasSetAddress(struct libalias *, struct in_addr _addr);
+void LibAliasSetFWBase(struct libalias *, unsigned int _base, unsigned int _num);
+void LibAliasSetSkinnyPort(struct libalias *, unsigned int _port);
+unsigned int
+ LibAliasSetMode(struct libalias *, unsigned int _flags, unsigned int _mask);
+void LibAliasUninit(struct libalias *);
+
+/* Packet Handling functions. */
+int LibAliasIn (struct libalias *, char *_ptr, int _maxpacketsize);
+int LibAliasOut(struct libalias *, char *_ptr, int _maxpacketsize);
+int LibAliasUnaliasOut(struct libalias *, char *_ptr, int _maxpacketsize);
+
+/* Port and address redirection functions. */
+
+int
+LibAliasAddServer(struct libalias *, struct alias_link *_link,
+ struct in_addr _addr, unsigned short _port);
+struct alias_link *
+LibAliasRedirectAddr(struct libalias *, struct in_addr _src_addr,
+ struct in_addr _alias_addr);
+int LibAliasRedirectDynamic(struct libalias *, struct alias_link *_link);
+void LibAliasRedirectDelete(struct libalias *, struct alias_link *_link);
+struct alias_link *
+LibAliasRedirectPort(struct libalias *, struct in_addr _src_addr,
+ unsigned short _src_port, struct in_addr _dst_addr,
+ unsigned short _dst_port, struct in_addr _alias_addr,
+ unsigned short _alias_port, unsigned char _proto);
+struct alias_link *
+LibAliasRedirectProto(struct libalias *, struct in_addr _src_addr,
+ struct in_addr _dst_addr, struct in_addr _alias_addr,
+ unsigned char _proto);
+
+/* Fragment Handling functions. */
+void LibAliasFragmentIn(struct libalias *, char *_ptr, char *_ptr_fragment);
+char *LibAliasGetFragment(struct libalias *, char *_ptr);
+int LibAliasSaveFragment(struct libalias *, char *_ptr);
+
+/* Miscellaneous functions. */
+int LibAliasCheckNewLink(struct libalias *);
+unsigned short
+ LibAliasInternetChecksum(struct libalias *, unsigned short *_ptr, int _nbytes);
+void LibAliasSetTarget(struct libalias *, struct in_addr _target_addr);
+
+/* Transparent proxying routines. */
+int LibAliasProxyRule(struct libalias *, const char *_cmd);
+
+
+/*
+ * Mode flags and other constants.
+ */
+
+
+/* Mode flags, set using PacketAliasSetMode() */
+
+/*
+ * If PKT_ALIAS_LOG is set, a message will be printed to /var/log/alias.log
+ * every time a link is created or deleted. This is useful for debugging.
+ */
+#define PKT_ALIAS_LOG 0x01
+
+/*
+ * If PKT_ALIAS_DENY_INCOMING is set, then incoming connections (e.g. to ftp,
+ * telnet or web servers will be prevented by the aliasing mechanism.
+ */
+#define PKT_ALIAS_DENY_INCOMING 0x02
+
+/*
+ * If PKT_ALIAS_SAME_PORTS is set, packets will be attempted sent from the
+ * same port as they originated on. This allows e.g. rsh to work *99% of the
+ * time*, but _not_ 100% (it will be slightly flakey instead of not working
+ * at all). This mode bit is set by PacketAliasInit(), so it is a default
+ * mode of operation.
+ */
+#define PKT_ALIAS_SAME_PORTS 0x04
+
+/*
+ * If PKT_ALIAS_USE_SOCKETS is set, then when partially specified links (e.g.
+ * destination port and/or address is zero), the packet aliasing engine will
+ * attempt to allocate a socket for the aliasing port it chooses. This will
+ * avoid interference with the host machine. Fully specified links do not
+ * require this. This bit is set after a call to PacketAliasInit(), so it is
+ * a default mode of operation.
+ */
+#define PKT_ALIAS_USE_SOCKETS 0x08
+
+/*-
+ * If PKT_ALIAS_UNREGISTERED_ONLY is set, then only packets with
+ * unregistered source addresses will be aliased. Private
+ * addresses are those in the following ranges:
+ *
+ * 10.0.0.0 -> 10.255.255.255
+ * 172.16.0.0 -> 172.31.255.255
+ * 192.168.0.0 -> 192.168.255.255
+ */
+#define PKT_ALIAS_UNREGISTERED_ONLY 0x10
+
+/*
+ * If PKT_ALIAS_RESET_ON_ADDR_CHANGE is set, then the table of dynamic
+ * aliasing links will be reset whenever PacketAliasSetAddress() changes the
+ * default aliasing address. If the default aliasing address is left
+ * unchanged by this function call, then the table of dynamic aliasing links
+ * will be left intact. This bit is set after a call to PacketAliasInit().
+ */
+#define PKT_ALIAS_RESET_ON_ADDR_CHANGE 0x20
+
+#ifndef NO_FW_PUNCH
+/*
+ * If PKT_ALIAS_PUNCH_FW is set, active FTP and IRC DCC connections will
+ * create a 'hole' in the firewall to allow the transfers to work. The
+ * ipfw rule number that the hole is created with is controlled by
+ * PacketAliasSetFWBase(). The hole will be attached to that
+ * particular alias_link, so when the link goes away the hole is deleted.
+ */
+#define PKT_ALIAS_PUNCH_FW 0x100
+#endif
+
+/*
+ * If PKT_ALIAS_PROXY_ONLY is set, then NAT will be disabled and only
+ * transparent proxying is performed.
+ */
+#define PKT_ALIAS_PROXY_ONLY 0x40
+
+/*
+ * If PKT_ALIAS_REVERSE is set, the actions of PacketAliasIn() and
+ * PacketAliasOut() are reversed.
+ */
+#define PKT_ALIAS_REVERSE 0x80
+
+/* Function return codes. */
+#define PKT_ALIAS_ERROR -1
+#define PKT_ALIAS_OK 1
+#define PKT_ALIAS_IGNORED 2
+#define PKT_ALIAS_UNRESOLVED_FRAGMENT 3
+#define PKT_ALIAS_FOUND_HEADER_FRAGMENT 4
+
+#endif /* !_ALIAS_H_ */
+
+/* lint -restore */
diff --git a/src/include/ar.h b/src/include/ar.h
new file mode 100644
index 0000000..e04874f
--- /dev/null
+++ b/src/include/ar.h
@@ -0,0 +1,67 @@
+/*-
+ * Copyright (c) 1991, 1993
+ * The Regents of the University of California. All rights reserved.
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Hugh Smith at The University of Guelph.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)ar.h 8.2 (Berkeley) 1/21/94
+ */
+
+#ifndef _AR_H_
+#define _AR_H_
+
+/* Pre-4BSD archives had these magic numbers in them. */
+#define OARMAG1 0177555
+#define OARMAG2 0177545
+
+#define ARMAG "!\n" /* ar "magic number" */
+#define SARMAG 8 /* strlen(ARMAG); */
+
+#define AR_EFMT1 "#1/" /* extended format #1 */
+
+struct ar_hdr {
+ char ar_name[16]; /* name */
+ char ar_date[12]; /* modification time */
+ char ar_uid[6]; /* user id */
+ char ar_gid[6]; /* group id */
+ char ar_mode[8]; /* octal file permissions */
+ char ar_size[10]; /* size in bytes */
+#define ARFMAG "`\n"
+ char ar_fmag[2]; /* consistency check */
+};
+
+#endif /* !_AR_H_ */
diff --git a/src/include/archive.h b/src/include/archive.h
new file mode 100644
index 0000000..070c0c0
--- /dev/null
+++ b/src/include/archive.h
@@ -0,0 +1,278 @@
+/*-
+ * Copyright (c) 2003-2004 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD: src/lib/libarchive/archive.h,v 1.9 2004/05/13 06:01:14 kientzle Exp $
+ */
+
+#ifndef ARCHIVE_H_INCLUDED
+#define ARCHIVE_H_INCLUDED
+
+#include /* For int64_t */
+#include /* For ssize_t and size_t */
+
+#define ARCHIVE_BYTES_PER_RECORD 512
+#define ARCHIVE_DEFAULT_BYTES_PER_BLOCK 10240
+
+/* Declare our basic types. */
+struct archive;
+struct archive_entry;
+
+/*
+ * Error codes: Use archive_errno() and archive_error_string()
+ * to retrieve details. Unless specified otherwise, all functions
+ * that return 'int' use these codes.
+ */
+#define ARCHIVE_EOF 1 /* Found end of archive. */
+#define ARCHIVE_OK 0 /* Operation was successful. */
+#define ARCHIVE_WARN (-1) /* Sucess, but minor problem. */
+#define ARCHIVE_RETRY (-2) /* Retry might succeed. */
+#define ARCHIVE_FATAL (-3) /* No more operations are possible. */
+
+/*
+ * As far as possible, archive_errno returns standard platform errno codes.
+ * Of course, the details vary by platform, so the actual definitions
+ * here are stored in "archive_platform.h". The symbols are listed here
+ * for reference; as a rule, clients should not need to know the exact
+ * platform-dependent error code.
+ */
+/* Unrecognized or invalid file format. */
+/* #define ARCHIVE_ERRNO_FILE_FORMAT */
+/* Illegal usage of the library. */
+/* #define ARCHIVE_ERRNO_PROGRAMMER_ERROR */
+/* Unknown or unclassified error. */
+/* #define ARCHIVE_ERRNO_MISC */
+
+/*
+ * Callbacks are invoked to automatically read/write/open/close the archive.
+ * You can provide your own for complex tasks (like breaking archives
+ * across multiple tapes) or use standard ones built into the library.
+ */
+
+/* Returns pointer and size of next block of data from archive. */
+typedef ssize_t archive_read_callback(struct archive *, void *_client_data,
+ const void **_buffer);
+/* Returns size actually written, zero on EOF, -1 on error. */
+typedef ssize_t archive_write_callback(struct archive *, void *_client_data,
+ void *_buffer, size_t _length);
+typedef int archive_open_callback(struct archive *, void *_client_data);
+typedef int archive_close_callback(struct archive *, void *_client_data);
+
+/*
+ * Codes for archive_compression.
+ */
+#define ARCHIVE_COMPRESSION_NONE 0
+#define ARCHIVE_COMPRESSION_GZIP 1
+#define ARCHIVE_COMPRESSION_BZIP2 2
+
+/*
+ * Codes returned by archive_format.
+ *
+ * Top 16 bits identifies the format family (e.g., "tar"); lower
+ * 16 bits indicate the variant. This is updated by read_next_header.
+ * Note that the lower 16 bits will often vary from entry to entry.
+ */
+#define ARCHIVE_FORMAT_BASE_MASK 0xff0000U
+#define ARCHIVE_FORMAT_CPIO 0x10000
+#define ARCHIVE_FORMAT_CPIO_POSIX (ARCHIVE_FORMAT_CPIO | 1)
+#define ARCHIVE_FORMAT_SHAR 0x20000
+#define ARCHIVE_FORMAT_SHAR_BASE (ARCHIVE_FORMAT_SHAR | 1)
+#define ARCHIVE_FORMAT_SHAR_DUMP (ARCHIVE_FORMAT_SHAR | 2)
+#define ARCHIVE_FORMAT_TAR 0x30000
+#define ARCHIVE_FORMAT_TAR_USTAR (ARCHIVE_FORMAT_TAR | 1)
+#define ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE (ARCHIVE_FORMAT_TAR | 2)
+#define ARCHIVE_FORMAT_TAR_PAX_RESTRICTED (ARCHIVE_FORMAT_TAR | 3)
+#define ARCHIVE_FORMAT_TAR_GNUTAR (ARCHIVE_FORMAT_TAR | 4)
+
+/*-
+ * Basic outline for reading an archive:
+ * 1) Ask archive_read_new for an archive reader object.
+ * 2) Update any global properties as appropriate.
+ * In particular, you'll certainly want to call appropriate
+ * archive_read_support_XXX functions.
+ * 3) Call archive_read_open_XXX to open the archive
+ * 4) Repeatedly call archive_read_next_header to get information about
+ * successive archive entries. Call archive_read_data to extract
+ * data for entries of interest.
+ * 5) Call archive_read_finish to destroy the object.
+ */
+struct archive *archive_read_new(void);
+
+/*
+ * The archive_read_support_XXX calls enable auto-detect for this
+ * archive handle. They also link in the necessary support code.
+ * For example, if you don't want bzlib linked in, don't invoke
+ * support_compression_bzip2(). The "all" functions provide the
+ * obvious shorthand.
+ */
+int archive_read_support_compression_all(struct archive *);
+int archive_read_support_compression_bzip2(struct archive *);
+int archive_read_support_compression_gzip(struct archive *);
+int archive_read_support_compression_none(struct archive *);
+
+int archive_read_support_format_all(struct archive *);
+int archive_read_support_format_cpio(struct archive *);
+int archive_read_support_format_gnutar(struct archive *);
+int archive_read_support_format_tar(struct archive *);
+
+
+/* Open the archive using callbacks for archive I/O. */
+int archive_read_open(struct archive *, void *_client_data,
+ archive_open_callback *, archive_read_callback *,
+ archive_close_callback *);
+
+/*
+ * The archive_read_open_file function is a convenience function built
+ * on archive_read_open that uses a canned callback suitable for
+ * common situations. Note that a NULL filename indicates stdin.
+ */
+int archive_read_open_file(struct archive *, const char *_file,
+ size_t _block_size);
+int archive_read_open_fd(struct archive *, int _fd,
+ size_t _block_size);
+
+/* Parses and returns next entry header. */
+int archive_read_next_header(struct archive *,
+ struct archive_entry **);
+
+/*
+ * Retrieve the byte offset in UNCOMPRESSED data where last-read
+ * header started.
+ */
+int64_t archive_read_header_position(struct archive *);
+
+/* Read data from the body of an entry. Similar to read(2). */
+ssize_t archive_read_data(struct archive *, void *, size_t);
+
+/*-
+ * Some convenience functions that are built on archive_read_data:
+ * 'skip': skips entire entry
+ * 'into_buffer': writes data into memory buffer that you provide
+ * 'into_file': writes data to specified filedes
+ */
+int archive_read_data_skip(struct archive *);
+ssize_t archive_read_data_into_buffer(struct archive *, void *buffer,
+ ssize_t len);
+ssize_t archive_read_data_into_fd(struct archive *, int fd);
+
+/*-
+ * Convenience function to recreate the current entry (whose header
+ * has just been read) on disk.
+ *
+ * This does quite a bit more than just copy data to disk. It also:
+ * - Creates intermediate directories as required.
+ * - Manages directory permissions: non-writable directories will
+ * be initially created with write permission enabled; when the
+ * archive is closed, dir permissions are edited to the values specified
+ * in the archive.
+ * - Checks hardlinks: hardlinks will not be extracted unless the
+ * linked-to file was also extracted within the same session. (TODO)
+ */
+
+/* The "flags" argument selects optional behavior, 'OR' the flags you want. */
+/* TODO: The 'Default' comments here are not quite correct; clean this up. */
+#define ARCHIVE_EXTRACT_OWNER (1) /* Default: owner/group not restored */
+#define ARCHIVE_EXTRACT_PERM (2) /* Default: restore perm only for reg file*/
+#define ARCHIVE_EXTRACT_TIME (4) /* Default: mod time not restored */
+#define ARCHIVE_EXTRACT_NO_OVERWRITE (8) /* Default: Replace files on disk */
+#define ARCHIVE_EXTRACT_UNLINK (16) /* Default: don't unlink existing files */
+
+int archive_read_extract(struct archive *, struct archive_entry *,
+ int flags);
+void archive_read_extract_set_progress_callback(struct archive *,
+ void (*_progress_func)(void *), void *_user_data);
+
+/* Close the file, release any resources, and destroy the object. */
+void archive_read_finish(struct archive *);
+
+/*-
+ * To create an archive:
+ * 1) Ask archive_write_new for a archive writer object.
+ * 2) Set any global properties. In particular, you should register
+ * open/write/close callbacks.
+ * 3) Call archive_write_open to open the file
+ * 4) For each entry:
+ * - construct an appropriate struct archive_entry structure
+ * - archive_write_header to write the header
+ * - archive_write_data to write the entry data
+ * 5) archive_write_finish to close the output and cleanup the writer
+ */
+struct archive *archive_write_new(void);
+int archive_write_set_bytes_per_block(struct archive *,
+ int bytes_per_block);
+/* XXX This is badly misnamed; suggestions appreciated. XXX */
+int archive_write_set_bytes_in_last_block(struct archive *,
+ int bytes_in_last_block);
+
+int archive_write_set_compression_bzip2(struct archive *);
+int archive_write_set_compression_gzip(struct archive *);
+int archive_write_set_compression_none(struct archive *);
+/* A convenience function to set the format based on the code or name. */
+int archive_write_set_format(struct archive *, int format_code);
+int archive_write_set_format_by_name(struct archive *,
+ const char *name);
+/* To minimize link pollution, use one or more of the following. */
+int archive_write_set_format_cpio(struct archive *);
+/* TODO: int archive_write_set_format_old_tar(struct archive *); */
+int archive_write_set_format_pax(struct archive *);
+int archive_write_set_format_pax_restricted(struct archive *);
+int archive_write_set_format_shar(struct archive *);
+int archive_write_set_format_shar_dump(struct archive *);
+int archive_write_set_format_ustar(struct archive *);
+int archive_write_open(struct archive *, void *,
+ archive_open_callback *, archive_write_callback *,
+ archive_close_callback *);
+int archive_write_open_fd(struct archive *, int _fd);
+int archive_write_open_file(struct archive *, const char *_file);
+
+/*
+ * Note that the library will truncate writes beyond the size provided
+ * to archive_write_header or pad if the provided data is short.
+ */
+int archive_write_header(struct archive *,
+ struct archive_entry *);
+int archive_write_data(struct archive *, const void *, size_t);
+void archive_write_finish(struct archive *);
+
+/*
+ * Accessor functions to read/set various information in
+ * the struct archive object:
+ */
+/* Bytes written after compression or read before decompression. */
+int64_t archive_position_compressed(struct archive *);
+/* Bytes written to compressor or read from decompressor. */
+int64_t archive_position_uncompressed(struct archive *);
+
+const char *archive_compression_name(struct archive *);
+int archive_compression(struct archive *);
+int archive_errno(struct archive *);
+const char *archive_error_string(struct archive *);
+const char *archive_format_name(struct archive *);
+int archive_format(struct archive *);
+/* void archive_set_errno(struct archive *, int); */
+/* void archive_error_printf(struct archive *, const char *fmt, ...); */
+
+void archive_set_error(struct archive *, int _err, const char *fmt, ...);
+
+#endif /* !ARCHIVE_H_INCLUDED */
diff --git a/src/include/archive_entry.h b/src/include/archive_entry.h
new file mode 100644
index 0000000..d77e255
--- /dev/null
+++ b/src/include/archive_entry.h
@@ -0,0 +1,207 @@
+/*-
+ * Copyright (c) 2003-2004 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD: src/lib/libarchive/archive_entry.h,v 1.8 2004/05/03 01:40:34 kientzle Exp $
+ */
+
+#ifndef ARCHIVE_ENTRY_H_INCLUDED
+#define ARCHIVE_ENTRY_H_INCLUDED
+
+#include
+#include
+
+/*
+ * Description of an archive entry.
+ *
+ * Basically, a "struct stat" with a few text fields added in.
+ *
+ * TODO: Add "comment", "charset", and possibly other entries that are
+ * supported by "pax interchange" format. However, GNU, ustar, cpio,
+ * and other variants don't support these features, so they're not an
+ * excruciatingly high priority right now.
+ *
+ * TODO: "pax interchange" format allows essentially arbitrary
+ * key/value attributes to be attached to any entry. Supporting
+ * such extensions may make this library useful for special
+ * applications (e.g., a package manager could attach special
+ * package-management attributes to each entry).
+ *
+ * TODO: Design a good API for handling sparse files.
+ */
+struct archive_entry;
+
+/*
+ * Basic object manipulation
+ */
+
+struct archive_entry *archive_entry_clear(struct archive_entry *);
+/* The 'clone' function does a deep copy; all of the strings are copied too. */
+struct archive_entry *archive_entry_clone(struct archive_entry *);
+void archive_entry_free(struct archive_entry *);
+struct archive_entry *archive_entry_new(void);
+
+/*
+ * Retrieve fields from an archive_entry.
+ */
+
+dev_t archive_entry_devmajor(struct archive_entry *);
+dev_t archive_entry_devminor(struct archive_entry *);
+const char *archive_entry_fflags_text(struct archive_entry *);
+void archive_entry_fflags(struct archive_entry *,
+ unsigned long *set, unsigned long *clear);
+const char *archive_entry_gname(struct archive_entry *);
+const char *archive_entry_hardlink(struct archive_entry *);
+mode_t archive_entry_mode(struct archive_entry *);
+time_t archive_entry_mtime(struct archive_entry *);
+long archive_entry_mtime_nsec(struct archive_entry *);
+const char *archive_entry_pathname(struct archive_entry *);
+const wchar_t *archive_entry_pathname_w(struct archive_entry *);
+int64_t archive_entry_size(struct archive_entry *);
+const struct stat *archive_entry_stat(struct archive_entry *);
+const char *archive_entry_symlink(struct archive_entry *);
+const char *archive_entry_uname(struct archive_entry *);
+
+/*
+ * Set fields in an archive_entry.
+ *
+ * Note that string 'set' functions do not copy the string, only the pointer.
+ * In contrast, 'copy' functions do copy the object pointed to.
+ */
+
+void archive_entry_copy_stat(struct archive_entry *, const struct stat *);
+void archive_entry_set_devmajor(struct archive_entry *, dev_t);
+void archive_entry_set_devminor(struct archive_entry *, dev_t);
+void archive_entry_set_fflags(struct archive_entry *,
+ unsigned long set, unsigned long clear);
+/* Returns pointer to start of first invalid token, or NULL if none. */
+/* Note that all recognized tokens are processed, regardless. */
+const wchar_t *archive_entry_copy_fflags_text_w(struct archive_entry *,
+ const wchar_t *);
+void archive_entry_set_gid(struct archive_entry *, gid_t);
+void archive_entry_set_gname(struct archive_entry *, const char *);
+void archive_entry_copy_gname_w(struct archive_entry *, const wchar_t *);
+void archive_entry_set_hardlink(struct archive_entry *, const char *);
+void archive_entry_copy_hardlink(struct archive_entry *, const char *);
+void archive_entry_copy_hardlink_w(struct archive_entry *, const wchar_t *);
+void archive_entry_set_link(struct archive_entry *, const char *);
+void archive_entry_set_mode(struct archive_entry *, mode_t);
+void archive_entry_set_pathname(struct archive_entry *, const char *);
+void archive_entry_copy_pathname_w(struct archive_entry *, const wchar_t *);
+void archive_entry_set_size(struct archive_entry *, int64_t);
+void archive_entry_set_symlink(struct archive_entry *, const char *);
+void archive_entry_copy_symlink_w(struct archive_entry *, const wchar_t *);
+void archive_entry_set_uid(struct archive_entry *, uid_t);
+void archive_entry_set_uname(struct archive_entry *, const char *);
+void archive_entry_copy_uname_w(struct archive_entry *, const wchar_t *);
+
+/*
+ * ACL routines. This used to simply store and return text-format ACL
+ * strings, but that proved insufficient for a number of reasons:
+ * = clients need control over uname/uid and gname/gid mappings
+ * = there are many different ACL text formats
+ * = would like to be able to read/convert archives containing ACLs
+ * on platforms that lack ACL libraries
+ */
+
+/*
+ * Permission bits mimic POSIX.1e. Note that I've not followed POSIX.1e's
+ * "permset"/"perm" abstract type nonsense. A permset is just a simple
+ * bitmap, following long-standing Unix tradition.
+ */
+#define ARCHIVE_ENTRY_ACL_EXECUTE 1
+#define ARCHIVE_ENTRY_ACL_WRITE 2
+#define ARCHIVE_ENTRY_ACL_READ 4
+
+/* We need to be able to specify either or both of these. */
+#define ARCHIVE_ENTRY_ACL_TYPE_ACCESS 256
+#define ARCHIVE_ENTRY_ACL_TYPE_DEFAULT 512
+
+/* Tag values mimic POSIX.1e */
+#define ARCHIVE_ENTRY_ACL_USER 10001 /* Specified user. */
+#define ARCHIVE_ENTRY_ACL_USER_OBJ 10002 /* User who owns the file. */
+#define ARCHIVE_ENTRY_ACL_GROUP 10003 /* Specified group. */
+#define ARCHIVE_ENTRY_ACL_GROUP_OBJ 10004 /* Group who owns the file. */
+#define ARCHIVE_ENTRY_ACL_MASK 10005 /* Modify group access. */
+#define ARCHIVE_ENTRY_ACL_OTHER 10006 /* Public. */
+
+/*
+ * Set the ACL by clearing it and adding entries one at a time.
+ * Unlike the POSIX.1e ACL routines, you must specify the type
+ * (access/default) for each entry. Internally, the ACL data is just
+ * a soup of entries. API calls here allow you to retrieve just the
+ * entries of interest. This design (which goes against the spirit of
+ * POSIX.1e) is useful for handling archive formats that combine
+ * default and access information in a single ACL list.
+ */
+void archive_entry_acl_clear(struct archive_entry *);
+void archive_entry_acl_add_entry(struct archive_entry *,
+ int type, int permset, int tag, int qual, const char *name);
+void archive_entry_acl_add_entry_w(struct archive_entry *,
+ int type, int permset, int tag, int qual, const wchar_t *name);
+
+/*
+ * To retrieve the ACL, first "reset", then repeatedly ask for the
+ * "next" entry. The want_type parameter allows you to request only
+ * access entries or only default entries.
+ */
+int archive_entry_acl_reset(struct archive_entry *, int want_type);
+int archive_entry_acl_next(struct archive_entry *, int want_type,
+ int *type, int *permset, int *tag, int *qual, const char **name);
+int archive_entry_acl_next_w(struct archive_entry *, int want_type,
+ int *type, int *permset, int *tag, int *qual,
+ const wchar_t **name);
+
+/*
+ * Construct a text-format ACL. The flags argument is a bitmask that
+ * can include any of the following:
+ *
+ * ARCHIVE_ENTRY_ACL_TYPE_ACCESS - Include access entries.
+ * ARCHIVE_ENTRY_ACL_TYPE_DEFAULT - Include default entries.
+ * ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID - Include extra numeric ID field in
+ * each ACL entry. (As used by 'star'.)
+ * ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT - Include "default:" before each
+ * default ACL entry.
+ */
+#define ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID 1024
+#define ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT 2048
+const wchar_t *archive_entry_acl_text_w(struct archive_entry *, int flags);
+
+/* Return a count of entries matching 'want_type' */
+int archive_entry_acl_count(struct archive_entry *, int want_type);
+
+/*
+ * Private ACL parser. This is private because it handles some
+ * very weird formats that clients should not be messing with.
+ * Clients should only deal with their platform-native formats.
+ * Because of the need to support many formats cleanly, new arguments
+ * are likely to get added on a regular basis. Clients who try to use
+ * this interface are likely to be surprised when it changes.
+ *
+ * You were warned!
+ */
+int __archive_entry_acl_parse_w(struct archive_entry *,
+ const wchar_t *, int type);
+
+#endif /* !ARCHIVE_ENTRY_H_INCLUDED */
diff --git a/src/include/arpa/ftp.h b/src/include/arpa/ftp.h
new file mode 100644
index 0000000..9a36488
--- /dev/null
+++ b/src/include/arpa/ftp.h
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 1983, 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)ftp.h 8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _ARPA_FTP_H_
+#define _ARPA_FTP_H_
+
+/* Definitions for FTP; see RFC-765. */
+
+/*
+ * Reply codes.
+ */
+#define PRELIM 1 /* positive preliminary */
+#define COMPLETE 2 /* positive completion */
+#define CONTINUE 3 /* positive intermediate */
+#define TRANSIENT 4 /* transient negative completion */
+#define ERROR 5 /* permanent negative completion */
+
+/*
+ * Type codes
+ */
+#define TYPE_A 1 /* ASCII */
+#define TYPE_E 2 /* EBCDIC */
+#define TYPE_I 3 /* image */
+#define TYPE_L 4 /* local byte size */
+
+#ifdef FTP_NAMES
+char *typenames[] = {"0", "ASCII", "EBCDIC", "Image", "Local" };
+#endif
+
+/*
+ * Form codes
+ */
+#define FORM_N 1 /* non-print */
+#define FORM_T 2 /* telnet format effectors */
+#define FORM_C 3 /* carriage control (ASA) */
+#ifdef FTP_NAMES
+char *formnames[] = {"0", "Nonprint", "Telnet", "Carriage-control" };
+#endif
+
+/*
+ * Structure codes
+ */
+#define STRU_F 1 /* file (no record structure) */
+#define STRU_R 2 /* record structure */
+#define STRU_P 3 /* page structure */
+#ifdef FTP_NAMES
+char *strunames[] = {"0", "File", "Record", "Page" };
+#endif
+
+/*
+ * Mode types
+ */
+#define MODE_S 1 /* stream */
+#define MODE_B 2 /* block */
+#define MODE_C 3 /* compressed */
+#ifdef FTP_NAMES
+char *modenames[] = {"0", "Stream", "Block", "Compressed" };
+#endif
+
+/*
+ * Record Tokens
+ */
+#define REC_ESC '\377' /* Record-mode Escape */
+#define REC_EOR '\001' /* Record-mode End-of-Record */
+#define REC_EOF '\002' /* Record-mode End-of-File */
+
+/*
+ * Block Header
+ */
+#define BLK_EOR 0x80 /* Block is End-of-Record */
+#define BLK_EOF 0x40 /* Block is End-of-File */
+#define BLK_ERRORS 0x20 /* Block is suspected of containing errors */
+#define BLK_RESTART 0x10 /* Block is Restart Marker */
+
+#define BLK_BYTECOUNT 2 /* Bytes in this block */
+
+#endif /* !_FTP_H_ */
diff --git a/src/include/arpa/inet.h b/src/include/arpa/inet.h
new file mode 100644
index 0000000..d50e466
--- /dev/null
+++ b/src/include/arpa/inet.h
@@ -0,0 +1,170 @@
+/*
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * -
+ * Portions Copyright (c) 1993 by Digital Equipment Corporation.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies, and that
+ * the name of Digital Equipment Corporation not be used in advertising or
+ * publicity pertaining to distribution of the document or software without
+ * specific, written prior permission.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
+ * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ *
+ * @(#)inet.h 8.1 (Berkeley) 6/2/93
+ * From: Id: inet.h,v 8.5 1997/01/29 08:48:09 vixie Exp $
+ * $FreeBSD: src/include/arpa/inet.h,v 1.25 2002/08/21 16:19:56 mike Exp $
+ */
+
+#ifndef _ARPA_INET_H_
+#define _ARPA_INET_H_
+
+/* External definitions for functions in inet(3), addr2ascii(3) */
+
+#include
+#include
+
+/* Required for byteorder(3) functions. */
+#include
+
+#define INET_ADDRSTRLEN 16
+#define INET6_ADDRSTRLEN 46
+
+#ifndef _UINT16_T_DECLARED
+typedef __uint16_t uint16_t;
+#define _UINT16_T_DECLARED
+#endif
+
+#ifndef _UINT32_T_DECLARED
+typedef __uint32_t uint32_t;
+#define _UINT32_T_DECLARED
+#endif
+
+#ifndef _IN_ADDR_T_DECLARED
+typedef uint32_t in_addr_t;
+#define _IN_ADDR_T_DECLARED
+#endif
+
+#ifndef _IN_PORT_T_DECLARED
+typedef uint16_t in_port_t;
+#define _IN_PORT_T_DECLARED
+#endif
+
+#if __BSD_VISIBLE
+#ifndef _SIZE_T_DECLARED
+typedef __size_t size_t;
+#define _SIZE_T_DECLARED
+#endif
+#endif
+
+/*
+ * XXX socklen_t is used by a POSIX.1-2001 interface, but not required by
+ * POSIX.1-2001.
+ */
+#ifndef _SOCKLEN_T_DECLARED
+typedef __socklen_t socklen_t;
+#define _SOCKLEN_T_DECLARED
+#endif
+
+#ifndef _STRUCT_IN_ADDR_DECLARED
+struct in_addr {
+ in_addr_t s_addr;
+};
+#define _STRUCT_IN_ADDR_DECLARED
+#endif
+
+/* XXX all new diversions!! argh!! */
+#if __BSD_VISIBLE
+#define inet_addr __inet_addr
+#define inet_aton __inet_aton
+#define inet_lnaof __inet_lnaof
+#define inet_makeaddr __inet_makeaddr
+#define inet_neta __inet_neta
+#define inet_netof __inet_netof
+#define inet_network __inet_network
+#define inet_net_ntop __inet_net_ntop
+#define inet_net_pton __inet_net_pton
+#define inet_ntoa __inet_ntoa
+#define inet_pton __inet_pton
+#define inet_ntop __inet_ntop
+#define inet_nsap_addr __inet_nsap_addr
+#define inet_nsap_ntoa __inet_nsap_ntoa
+#endif /* __BSD_VISIBLE */
+
+__BEGIN_DECLS
+#ifndef _BYTEORDER_PROTOTYPED
+#define _BYTEORDER_PROTOTYPED
+uint32_t htonl(uint32_t);
+uint16_t htons(uint16_t);
+uint32_t ntohl(uint32_t);
+uint16_t ntohs(uint16_t);
+#endif
+
+in_addr_t inet_addr(const char *);
+char *inet_ntoa(struct in_addr);
+const char *inet_ntop(int, const void * __restrict, char * __restrict,
+ socklen_t);
+int inet_pton(int, const char * __restrict, void * __restrict);
+
+#if __BSD_VISIBLE
+int ascii2addr(int, const char *, void *);
+char *addr2ascii(int, const void *, int, char *);
+int inet_aton(const char *, struct in_addr *);
+in_addr_t inet_lnaof(struct in_addr);
+struct in_addr inet_makeaddr(in_addr_t, in_addr_t);
+char * inet_neta(in_addr_t, char *, size_t);
+in_addr_t inet_netof(struct in_addr);
+in_addr_t inet_network(const char *);
+char *inet_net_ntop(int, const void *, int, char *, size_t);
+int inet_net_pton(int, const char *, void *, size_t);
+unsigned inet_nsap_addr(const char *, unsigned char *, int);
+char *inet_nsap_ntoa(int, const unsigned char *, char *);
+#endif /* __BSD_VISIBLE */
+__END_DECLS
+
+#ifndef _BYTEORDER_FUNC_DEFINED
+#define _BYTEORDER_FUNC_DEFINED
+#define htonl(x) __htonl(x)
+#define htons(x) __htons(x)
+#define ntohl(x) __ntohl(x)
+#define ntohs(x) __ntohs(x)
+#endif
+
+#endif /* !_ARPA_INET_H_ */
diff --git a/src/include/arpa/nameser.h b/src/include/arpa/nameser.h
new file mode 100644
index 0000000..8735b8b
--- /dev/null
+++ b/src/include/arpa/nameser.h
@@ -0,0 +1,449 @@
+/*
+ * Copyright (c) 1983, 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Copyright (c) 1996 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+/*
+ * From: Id: nameser.h,v 8.16 1998/02/06 00:35:58 halley Exp
+ * $FreeBSD: src/include/arpa/nameser.h,v 1.16 2002/03/23 17:24:55 imp Exp $
+ */
+
+#ifndef _ARPA_NAMESER_H_
+#define _ARPA_NAMESER_H_
+
+#define BIND_4_COMPAT
+
+#include
+#include
+
+/*
+ * revision information. this is the release date in YYYYMMDD format.
+ * it can change every day so the right thing to do with it is use it
+ * in preprocessor commands such as "#if (__NAMESER > 19931104)". do not
+ * compare for equality; rather, use it to determine whether your libnameser.a
+ * is new enough to contain a certain feature.
+ */
+
+/* XXXRTH I made this bigger than __BIND in 4.9.5 T6B */
+#define __NAMESER 19961001 /* New interface version stamp. */
+
+/*
+ * Define constants based on RFC 883, RFC 1034, RFC 1035
+ */
+#define NS_PACKETSZ 512 /* maximum packet size */
+#define NS_MAXDNAME 1025 /* maximum domain name */
+#define NS_MAXCDNAME 255 /* maximum compressed domain name */
+#define NS_MAXLABEL 63 /* maximum length of domain label */
+#define NS_HFIXEDSZ 12 /* #/bytes of fixed data in header */
+#define NS_QFIXEDSZ 4 /* #/bytes of fixed data in query */
+#define NS_RRFIXEDSZ 10 /* #/bytes of fixed data in r record */
+#define NS_INT32SZ 4 /* #/bytes of data in a u_int32_t */
+#define NS_INT16SZ 2 /* #/bytes of data in a u_int16_t */
+#define NS_INT8SZ 1 /* #/bytes of data in a u_int8_t */
+#define NS_INADDRSZ 4 /* IPv4 T_A */
+#define NS_IN6ADDRSZ 16 /* IPv6 T_AAAA */
+#define NS_CMPRSFLGS 0xc0 /* Flag bits indicating name compression. */
+#define NS_DEFAULTPORT 53 /* For both TCP and UDP. */
+
+/*
+ * These can be expanded with synonyms, just keep ns_parse.c:ns_parserecord()
+ * in synch with it.
+ */
+typedef enum __ns_sect {
+ ns_s_qd = 0, /* Query: Question. */
+ ns_s_zn = 0, /* Update: Zone. */
+ ns_s_an = 1, /* Query: Answer. */
+ ns_s_pr = 1, /* Update: Prerequisites. */
+ ns_s_ns = 2, /* Query: Name servers. */
+ ns_s_ud = 2, /* Update: Update. */
+ ns_s_ar = 3, /* Query|Update: Additional records. */
+ ns_s_max = 4
+} ns_sect;
+
+/*
+ * This is a message handle. It is caller allocated and has no dynamic data.
+ * This structure is intended to be opaque to all but ns_parse.c, thus the
+ * leading _'s on the member names. Use the accessor functions, not the _'s.
+ */
+typedef struct __ns_msg {
+ const u_char *_msg, *_eom;
+ u_int16_t _id, _flags, _counts[ns_s_max];
+ const u_char *_sections[ns_s_max];
+ ns_sect _sect;
+ int _rrnum;
+ const u_char *_ptr;
+} ns_msg;
+
+/* Private data structure - do not use from outside library. */
+struct _ns_flagdata { int mask, shift; };
+extern struct _ns_flagdata _ns_flagdata[];
+
+/* Accessor macros - this is part of the public interface. */
+#define ns_msg_getflag(handle, flag) ( \
+ ((handle)._flags & _ns_flagdata[flag].mask) \
+ >> _ns_flagdata[flag].shift \
+ )
+#define ns_msg_id(handle) ((handle)._id + 0)
+#define ns_msg_base(handle) ((handle)._msg + 0)
+#define ns_msg_end(handle) ((handle)._eom + 0)
+#define ns_msg_size(handle) ((handle)._eom - (handle)._msg)
+#define ns_msg_count(handle, section) ((handle)._counts[section] + 0)
+
+/*
+ * This is a parsed record. It is caller allocated and has no dynamic data.
+ */
+typedef struct __ns_rr {
+ char name[NS_MAXDNAME]; /* XXX need to malloc */
+ u_int16_t type;
+ u_int16_t rr_class;
+ u_int32_t ttl;
+ u_int16_t rdlength;
+ const u_char *rdata;
+} ns_rr;
+
+/* Accessor macros - this is part of the public interface. */
+#define ns_rr_name(rr) (((rr).name[0] != '\0') ? (rr).name : ".")
+#define ns_rr_type(rr) ((rr).type + 0)
+#define ns_rr_class(rr) ((rr).rr_class + 0)
+#define ns_rr_ttl(rr) ((rr).ttl + 0)
+#define ns_rr_rdlen(rr) ((rr).rdlength + 0)
+#define ns_rr_rdata(rr) ((rr).rdata + 0)
+
+/*
+ * These don't have to be in the same order as in the packet flags word,
+ * and they can even overlap in some cases, but they will need to be kept
+ * in synch with ns_parse.c:ns_flagdata[].
+ */
+typedef enum __ns_flag {
+ ns_f_qr, /* Question/Response. */
+ ns_f_opcode, /* Operation code. */
+ ns_f_aa, /* Authoritative Answer. */
+ ns_f_tc, /* Truncation occurred. */
+ ns_f_rd, /* Recursion Desired. */
+ ns_f_ra, /* Recursion Available. */
+ ns_f_z, /* MBZ. */
+ ns_f_ad, /* Authentic Data (DNSSEC). */
+ ns_f_cd, /* Checking Disabled (DNSSEC). */
+ ns_f_rcode, /* Response code. */
+ ns_f_max
+} ns_flag;
+
+/*
+ * Currently defined opcodes.
+ */
+typedef enum __ns_opcode {
+ ns_o_query = 0, /* Standard query. */
+ ns_o_iquery = 1, /* Inverse query (deprecated/unsupported). */
+ ns_o_status = 2, /* Name server status query (unsupported). */
+ /* Opcode 3 is undefined/reserved. */
+ ns_o_notify = 4, /* Zone change notification. */
+ ns_o_update = 5, /* Zone update message. */
+ ns_o_max = 6
+} ns_opcode;
+
+/*
+ * Currently defined response codes.
+ */
+typedef enum __ns_rcode {
+ ns_r_noerror = 0, /* No error occurred. */
+ ns_r_formerr = 1, /* Format error. */
+ ns_r_servfail = 2, /* Server failure. */
+ ns_r_nxdomain = 3, /* Name error. */
+ ns_r_notimpl = 4, /* Unimplemented. */
+ ns_r_refused = 5, /* Operation refused. */
+ /* these are for BIND_UPDATE */
+ ns_r_yxdomain = 6, /* Name exists */
+ ns_r_yxrrset = 7, /* RRset exists */
+ ns_r_nxrrset = 8, /* RRset does not exist */
+ ns_r_notauth = 9, /* Not authoritative for zone */
+ ns_r_notzone = 10, /* Zone of record different from zone section */
+ ns_r_max = 11
+} ns_rcode;
+
+/* BIND_UPDATE */
+typedef enum __ns_update_operation {
+ ns_uop_delete = 0,
+ ns_uop_add = 1,
+ ns_uop_max = 2
+} ns_update_operation;
+
+/*
+ * This RR-like structure is particular to UPDATE.
+ */
+struct ns_updrec {
+ struct ns_updrec *r_prev; /* prev record */
+ struct ns_updrec *r_next; /* next record */
+ u_int8_t r_section; /* ZONE/PREREQUISITE/UPDATE */
+ char * r_dname; /* owner of the RR */
+ u_int16_t r_class; /* class number */
+ u_int16_t r_type; /* type number */
+ u_int32_t r_ttl; /* time to live */
+ u_char * r_data; /* rdata fields as text string */
+ u_int16_t r_size; /* size of r_data field */
+ int r_opcode; /* type of operation */
+ /* following fields for private use by the resolver/server routines */
+ struct ns_updrec *r_grpnext; /* next record when grouped */
+ struct databuf *r_dp; /* databuf to process */
+ struct databuf *r_deldp; /* databuf's deleted/overwritten */
+ u_int16_t r_zone; /* zone number on server */
+};
+typedef struct ns_updrec ns_updrec;
+
+/*
+ * Currently defined type values for resources and queries.
+ */
+typedef enum __ns_type {
+ ns_t_a = 1, /* Host address. */
+ ns_t_ns = 2, /* Authoritative server. */
+ ns_t_md = 3, /* Mail destination. */
+ ns_t_mf = 4, /* Mail forwarder. */
+ ns_t_cname = 5, /* Canonical name. */
+ ns_t_soa = 6, /* Start of authority zone. */
+ ns_t_mb = 7, /* Mailbox domain name. */
+ ns_t_mg = 8, /* Mail group member. */
+ ns_t_mr = 9, /* Mail rename name. */
+ ns_t_null = 10, /* Null resource record. */
+ ns_t_wks = 11, /* Well known service. */
+ ns_t_ptr = 12, /* Domain name pointer. */
+ ns_t_hinfo = 13, /* Host information. */
+ ns_t_minfo = 14, /* Mailbox information. */
+ ns_t_mx = 15, /* Mail routing information. */
+ ns_t_txt = 16, /* Text strings. */
+ ns_t_rp = 17, /* Responsible person. */
+ ns_t_afsdb = 18, /* AFS cell database. */
+ ns_t_x25 = 19, /* X_25 calling address. */
+ ns_t_isdn = 20, /* ISDN calling address. */
+ ns_t_rt = 21, /* Router. */
+ ns_t_nsap = 22, /* NSAP address. */
+ ns_t_nsap_ptr = 23, /* Reverse NSAP lookup (deprecated). */
+ ns_t_sig = 24, /* Security signature. */
+ ns_t_key = 25, /* Security key. */
+ ns_t_px = 26, /* X.400 mail mapping. */
+ ns_t_gpos = 27, /* Geographical position (withdrawn). */
+ ns_t_aaaa = 28, /* Ip6 Address. */
+ ns_t_loc = 29, /* Location Information. */
+ ns_t_nxt = 30, /* Next domain (security). */
+ ns_t_eid = 31, /* Endpoint identifier. */
+ ns_t_nimloc = 32, /* Nimrod Locator. */
+ ns_t_srv = 33, /* Server Selection. */
+ ns_t_atma = 34, /* ATM Address */
+ ns_t_naptr = 35, /* Naming Authority PoinTeR */
+ ns_t_opt = 41, /* OPT pseudo-RR, RFC2761 */
+ /* Query type values which do not appear in resource records. */
+ ns_t_ixfr = 251, /* Incremental zone transfer. */
+ ns_t_axfr = 252, /* Transfer zone of authority. */
+ ns_t_mailb = 253, /* Transfer mailbox records. */
+ ns_t_maila = 254, /* Transfer mail agent records. */
+ ns_t_any = 255, /* Wildcard match. */
+ ns_t_max = 65536
+} ns_type;
+
+/*
+ * Values for class field
+ */
+typedef enum __ns_class {
+ ns_c_in = 1, /* Internet. */
+ /* Class 2 unallocated/unsupported. */
+ ns_c_chaos = 3, /* MIT Chaos-net. */
+ ns_c_hs = 4, /* MIT Hesiod. */
+ /* Query class values which do not appear in resource records */
+ ns_c_none = 254, /* for prereq. sections in update requests */
+ ns_c_any = 255, /* Wildcard match. */
+ ns_c_max = 65536
+} ns_class;
+
+/*
+ * Flags field of the KEY RR rdata
+ */
+#define NS_KEY_TYPEMASK 0xC000 /* Mask for "type" bits */
+#define NS_KEY_TYPE_AUTH_CONF 0x0000 /* Key usable for both */
+#define NS_KEY_TYPE_CONF_ONLY 0x8000 /* Key usable for confidentiality */
+#define NS_KEY_TYPE_AUTH_ONLY 0x4000 /* Key usable for authentication */
+#define NS_KEY_TYPE_NO_KEY 0xC000 /* No key usable for either; no key */
+/* The type bits can also be interpreted independently, as single bits: */
+#define NS_KEY_NO_AUTH 0x8000 /* Key unusable for authentication */
+#define NS_KEY_NO_CONF 0x4000 /* Key unusable for confidentiality */
+#define NS_KEY_EXPERIMENTAL 0x2000 /* Security is *mandatory* if bit=0 */
+#define NS_KEY_RESERVED3 0x1000 /* reserved - must be zero */
+#define NS_KEY_RESERVED4 0x0800 /* reserved - must be zero */
+#define NS_KEY_USERACCOUNT 0x0400 /* key is assoc. with a user acct */
+#define NS_KEY_ENTITY 0x0200 /* key is assoc. with entity eg host */
+#define NS_KEY_ZONEKEY 0x0100 /* key is zone key */
+#define NS_KEY_IPSEC 0x0080 /* key is for IPSEC (host or user)*/
+#define NS_KEY_EMAIL 0x0040 /* key is for email (MIME security) */
+#define NS_KEY_RESERVED10 0x0020 /* reserved - must be zero */
+#define NS_KEY_RESERVED11 0x0010 /* reserved - must be zero */
+#define NS_KEY_SIGNATORYMASK 0x000F /* key can sign RR's of same name */
+
+#define NS_KEY_RESERVED_BITMASK ( NS_KEY_RESERVED3 | \
+ NS_KEY_RESERVED4 | \
+ NS_KEY_RESERVED10 | \
+ NS_KEY_RESERVED11 )
+
+/* The Algorithm field of the KEY and SIG RR's is an integer, {1..254} */
+#define NS_ALG_MD5RSA 1 /* MD5 with RSA */
+#define NS_ALG_EXPIRE_ONLY 253 /* No alg, no security */
+#define NS_ALG_PRIVATE_OID 254 /* Key begins with OID giving alg */
+
+/* Signatures */
+#define NS_MD5RSA_MIN_BITS 512 /* Size of a mod or exp in bits */
+#define NS_MD5RSA_MAX_BITS 2552
+ /* Total of binary mod and exp */
+#define NS_MD5RSA_MAX_BYTES ((NS_MD5RSA_MAX_BITS+7/8)*2+3)
+ /* Max length of text sig block */
+#define NS_MD5RSA_MAX_BASE64 (((NS_MD5RSA_MAX_BYTES+2)/3)*4)
+
+/* Offsets into SIG record rdata to find various values */
+#define NS_SIG_TYPE 0 /* Type flags */
+#define NS_SIG_ALG 2 /* Algorithm */
+#define NS_SIG_LABELS 3 /* How many labels in name */
+#define NS_SIG_OTTL 4 /* Original TTL */
+#define NS_SIG_EXPIR 8 /* Expiration time */
+#define NS_SIG_SIGNED 12 /* Signature time */
+#define NS_SIG_FOOT 16 /* Key footprint */
+#define NS_SIG_SIGNER 18 /* Domain name of who signed it */
+
+/* How RR types are represented as bit-flags in NXT records */
+#define NS_NXT_BITS 8
+#define NS_NXT_BIT_SET( n,p) (p[(n)/NS_NXT_BITS] |= (0x80>>((n)%NS_NXT_BITS)))
+#define NS_NXT_BIT_CLEAR(n,p) (p[(n)/NS_NXT_BITS] &= ~(0x80>>((n)%NS_NXT_BITS)))
+#define NS_NXT_BIT_ISSET(n,p) (p[(n)/NS_NXT_BITS] & (0x80>>((n)%NS_NXT_BITS)))
+
+
+/*
+ * Inline versions of get/put short/long. Pointer is advanced.
+ */
+#define NS_GET16(s, cp) { \
+ register u_char *t_cp = (u_char *)(cp); \
+ (s) = ((u_int16_t)t_cp[0] << 8) \
+ | ((u_int16_t)t_cp[1]) \
+ ; \
+ (cp) += NS_INT16SZ; \
+}
+
+#define NS_GET32(l, cp) { \
+ register u_char *t_cp = (u_char *)(cp); \
+ (l) = ((u_int32_t)t_cp[0] << 24) \
+ | ((u_int32_t)t_cp[1] << 16) \
+ | ((u_int32_t)t_cp[2] << 8) \
+ | ((u_int32_t)t_cp[3]) \
+ ; \
+ (cp) += NS_INT32SZ; \
+}
+
+#define NS_PUT16(s, cp) { \
+ register u_int16_t t_s = (u_int16_t)(s); \
+ register u_char *t_cp = (u_char *)(cp); \
+ *t_cp++ = t_s >> 8; \
+ *t_cp = t_s; \
+ (cp) += NS_INT16SZ; \
+}
+
+#define NS_PUT32(l, cp) { \
+ register u_int32_t t_l = (u_int32_t)(l); \
+ register u_char *t_cp = (u_char *)(cp); \
+ *t_cp++ = t_l >> 24; \
+ *t_cp++ = t_l >> 16; \
+ *t_cp++ = t_l >> 8; \
+ *t_cp = t_l; \
+ (cp) += NS_INT32SZ; \
+}
+
+/*
+ * ANSI C identifier hiding.
+ */
+#define ns_get16 __ns_get16
+#define ns_get32 __ns_get32
+#define ns_put16 __ns_put16
+#define ns_put32 __ns_put32
+#define ns_initparse __ns_initparse
+#define ns_parserr __ns_parserr
+#define ns_sprintrr __ns_sprintrr
+#define ns_sprintrrf __ns_sprintrrf
+#define ns_format_ttl __ns_format_ttl
+#define ns_parse_ttl __ns_parse_ttl
+#define ns_name_ntop __ns_name_ntop
+#define ns_name_pton __ns_name_pton
+#define ns_name_unpack __ns_name_unpack
+#define ns_name_pack __ns_name_pack
+#define ns_name_compress __ns_name_compress
+#define ns_name_uncompress __ns_name_uncompress
+
+__BEGIN_DECLS
+u_int ns_get16(const u_char *);
+u_long ns_get32(const u_char *);
+void ns_put16(u_int, u_char *);
+void ns_put32(u_long, u_char *);
+int ns_initparse(const u_char *, int, ns_msg *);
+int ns_parserr(ns_msg *, ns_sect, int, ns_rr *);
+int ns_sprintrr(const ns_msg *, const ns_rr *,
+ const char *, const char *, char *, size_t);
+int ns_sprintrrf(const u_char *, size_t, const char *,
+ ns_class, ns_type, u_long, const u_char *,
+ size_t, const char *, const char *,
+ char *, size_t);
+int ns_format_ttl(u_long, char *, size_t);
+int ns_parse_ttl(const char *, u_long *);
+int ns_name_ntop(const u_char *, char *, size_t);
+int ns_name_pton(const char *, u_char *, size_t);
+int ns_name_unpack(const u_char *, const u_char *,
+ const u_char *, u_char *, size_t);
+int ns_name_pack(const u_char *, u_char *, int,
+ const u_char **, const u_char **);
+int ns_name_uncompress(const u_char *, const u_char *,
+ const u_char *, char *, size_t);
+int ns_name_compress(const char *, u_char *, size_t,
+ const u_char **, const u_char **);
+int ns_name_skip(const u_char **, const u_char *);
+__END_DECLS
+
+#ifdef BIND_4_COMPAT
+#include
+#endif
+
+#endif /* !_ARPA_NAMESER_H_ */
diff --git a/src/include/arpa/nameser_compat.h b/src/include/arpa/nameser_compat.h
new file mode 100644
index 0000000..5f3e833
--- /dev/null
+++ b/src/include/arpa/nameser_compat.h
@@ -0,0 +1,195 @@
+/* Copyright (c) 1983, 1989
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * from nameser.h 8.1 (Berkeley) 6/2/93
+ * From: Id: nameser_compat.h,v 8.9 1998/03/20 23:25:10 halley Exp
+ * $FreeBSD: src/include/arpa/nameser_compat.h,v 1.4 2002/05/28 04:32:25 mike Exp $
+ */
+
+#ifndef _ARPA_NAMESER_COMPAT_
+#define _ARPA_NAMESER_COMPAT_
+
+#define __BIND 19950621 /* (DEAD) interface version stamp. */
+
+#include
+
+#if !defined(_BYTE_ORDER) || \
+ (_BYTE_ORDER != _BIG_ENDIAN && _BYTE_ORDER != _LITTLE_ENDIAN && \
+ _BYTE_ORDER != _PDP_ENDIAN)
+ /* you must determine what the correct bit order is for
+ * your compiler - the next line is an intentional error
+ * which will force your compiles to bomb until you fix
+ * the above macros.
+ */
+#error "Undefined or invalid _BYTE_ORDER";
+#endif
+
+/*
+ * Structure for query header. The order of the fields is machine- and
+ * compiler-dependent, depending on the byte/bit order and the layout
+ * of bit fields. We use bit fields only in int variables, as this
+ * is all ANSI requires. This requires a somewhat confusing rearrangement.
+ */
+
+typedef struct {
+ unsigned id :16; /* query identification number */
+#if _BYTE_ORDER == _BIG_ENDIAN
+ /* fields in third byte */
+ unsigned qr: 1; /* response flag */
+ unsigned opcode: 4; /* purpose of message */
+ unsigned aa: 1; /* authoritive answer */
+ unsigned tc: 1; /* truncated message */
+ unsigned rd: 1; /* recursion desired */
+ /* fields in fourth byte */
+ unsigned ra: 1; /* recursion available */
+ unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
+ unsigned ad: 1; /* authentic data from named */
+ unsigned cd: 1; /* checking disabled by resolver */
+ unsigned rcode :4; /* response code */
+#endif
+#if _BYTE_ORDER == _LITTLE_ENDIAN || _BYTE_ORDER == _PDP_ENDIAN
+ /* fields in third byte */
+ unsigned rd :1; /* recursion desired */
+ unsigned tc :1; /* truncated message */
+ unsigned aa :1; /* authoritive answer */
+ unsigned opcode :4; /* purpose of message */
+ unsigned qr :1; /* response flag */
+ /* fields in fourth byte */
+ unsigned rcode :4; /* response code */
+ unsigned cd: 1; /* checking disabled by resolver */
+ unsigned ad: 1; /* authentic data from named */
+ unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
+ unsigned ra :1; /* recursion available */
+#endif
+ /* remaining bytes */
+ unsigned qdcount :16; /* number of question entries */
+ unsigned ancount :16; /* number of answer entries */
+ unsigned nscount :16; /* number of authority entries */
+ unsigned arcount :16; /* number of resource entries */
+} HEADER;
+
+#define PACKETSZ NS_PACKETSZ
+#define MAXDNAME NS_MAXDNAME
+#define MAXCDNAME NS_MAXCDNAME
+#define MAXLABEL NS_MAXLABEL
+#define HFIXEDSZ NS_HFIXEDSZ
+#define QFIXEDSZ NS_QFIXEDSZ
+#define RRFIXEDSZ NS_RRFIXEDSZ
+#define INT32SZ NS_INT32SZ
+#define INT16SZ NS_INT16SZ
+#define INADDRSZ NS_INADDRSZ
+#define IN6ADDRSZ NS_IN6ADDRSZ
+#define INDIR_MASK NS_CMPRSFLGS
+#define NAMESERVER_PORT NS_DEFAULTPORT
+
+#define S_ZONE ns_s_zn
+#define S_PREREQ ns_s_pr
+#define S_UPDATE ns_s_ud
+#define S_ADDT ns_s_ar
+
+#define QUERY ns_o_query
+#define IQUERY ns_o_iquery
+#define STATUS ns_o_status
+#define NS_NOTIFY_OP ns_o_notify
+#define NS_UPDATE_OP ns_o_update
+
+#define NOERROR ns_r_noerror
+#define FORMERR ns_r_formerr
+#define SERVFAIL ns_r_servfail
+#define NXDOMAIN ns_r_nxdomain
+#define NOTIMP ns_r_notimpl
+#define REFUSED ns_r_refused
+#define YXDOMAIN ns_r_yxdomain
+#define YXRRSET ns_r_yxrrset
+#define NXRRSET ns_r_nxrrset
+#define NOTAUTH ns_r_notauth
+#define NOTZONE ns_r_notzone
+
+#define DELETE ns_uop_delete
+#define ADD ns_uop_add
+
+#define T_A ns_t_a
+#define T_NS ns_t_ns
+#define T_MD ns_t_md
+#define T_MF ns_t_mf
+#define T_CNAME ns_t_cname
+#define T_SOA ns_t_soa
+#define T_MB ns_t_mb
+#define T_MG ns_t_mg
+#define T_MR ns_t_mr
+#define T_NULL ns_t_null
+#define T_WKS ns_t_wks
+#define T_PTR ns_t_ptr
+#define T_HINFO ns_t_hinfo
+#define T_MINFO ns_t_minfo
+#define T_MX ns_t_mx
+#define T_TXT ns_t_txt
+#define T_RP ns_t_rp
+#define T_AFSDB ns_t_afsdb
+#define T_X25 ns_t_x25
+#define T_ISDN ns_t_isdn
+#define T_RT ns_t_rt
+#define T_NSAP ns_t_nsap
+#define T_NSAP_PTR ns_t_nsap_ptr
+#define T_SIG ns_t_sig
+#define T_KEY ns_t_key
+#define T_PX ns_t_px
+#define T_GPOS ns_t_gpos
+#define T_AAAA ns_t_aaaa
+#define T_LOC ns_t_loc
+#define T_NXT ns_t_nxt
+#define T_EID ns_t_eid
+#define T_NIMLOC ns_t_nimloc
+#define T_SRV ns_t_srv
+#define T_ATMA ns_t_atma
+#define T_NAPTR ns_t_naptr
+#define T_OPT ns_t_opt
+#define T_IXFR ns_t_ixfr
+#define T_AXFR ns_t_axfr
+#define T_MAILB ns_t_mailb
+#define T_MAILA ns_t_maila
+#define T_ANY ns_t_any
+
+#define C_IN ns_c_in
+#define C_CHAOS ns_c_chaos
+#define C_HS ns_c_hs
+/* BIND_UPDATE */
+#define C_NONE ns_c_none
+#define C_ANY ns_c_any
+
+#define GETSHORT NS_GET16
+#define GETLONG NS_GET32
+#define PUTSHORT NS_PUT16
+#define PUTLONG NS_PUT32
+
+#endif /* _ARPA_NAMESER_COMPAT_ */
diff --git a/src/include/arpa/telnet.h b/src/include/arpa/telnet.h
new file mode 100644
index 0000000..b152601
--- /dev/null
+++ b/src/include/arpa/telnet.h
@@ -0,0 +1,347 @@
+/*
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)telnet.h 8.2 (Berkeley) 12/15/93
+ * $FreeBSD: src/contrib/telnet/arpa/telnet.h,v 1.9 2003/01/18 06:10:21 billf Exp $
+ */
+
+#ifndef _ARPA_TELNET_H_
+#define _ARPA_TELNET_H_
+
+/*
+ * Definitions for the TELNET protocol.
+ */
+#define IAC 255 /* interpret as command: */
+#define DONT 254 /* you are not to use option */
+#define DO 253 /* please, you use option */
+#define WONT 252 /* I won't use option */
+#define WILL 251 /* I will use option */
+#define SB 250 /* interpret as subnegotiation */
+#define GA 249 /* you may reverse the line */
+#define EL 248 /* erase the current line */
+#define EC 247 /* erase the current character */
+#define AYT 246 /* are you there */
+#define AO 245 /* abort output--but let prog finish */
+#define IP 244 /* interrupt process--permanently */
+#define BREAK 243 /* break */
+#define DM 242 /* data mark--for connect. cleaning */
+#define NOP 241 /* nop */
+#define SE 240 /* end sub negotiation */
+#define EOR 239 /* end of record (transparent mode) */
+#define ABORT 238 /* Abort process */
+#define SUSP 237 /* Suspend process */
+#define xEOF 236 /* End of file: EOF is already used... */
+
+#define SYNCH 242 /* for telfunc calls */
+
+#ifdef TELCMDS
+const char *telcmds[] = {
+ "EOF", "SUSP", "ABORT", "EOR",
+ "SE", "NOP", "DMARK", "BRK", "IP", "AO", "AYT", "EC",
+ "EL", "GA", "SB", "WILL", "WONT", "DO", "DONT", "IAC",
+ 0
+};
+#else
+extern char *telcmds[];
+#endif
+
+#define TELCMD_FIRST xEOF
+#define TELCMD_LAST IAC
+#define TELCMD_OK(x) ((unsigned int)(x) <= TELCMD_LAST && \
+ (unsigned int)(x) >= TELCMD_FIRST)
+#define TELCMD(x) telcmds[(x)-TELCMD_FIRST]
+
+/* telnet options */
+#define TELOPT_BINARY 0 /* 8-bit data path */
+#define TELOPT_ECHO 1 /* echo */
+#define TELOPT_RCP 2 /* prepare to reconnect */
+#define TELOPT_SGA 3 /* suppress go ahead */
+#define TELOPT_NAMS 4 /* approximate message size */
+#define TELOPT_STATUS 5 /* give status */
+#define TELOPT_TM 6 /* timing mark */
+#define TELOPT_RCTE 7 /* remote controlled transmission and echo */
+#define TELOPT_NAOL 8 /* negotiate about output line width */
+#define TELOPT_NAOP 9 /* negotiate about output page size */
+#define TELOPT_NAOCRD 10 /* negotiate about CR disposition */
+#define TELOPT_NAOHTS 11 /* negotiate about horizontal tabstops */
+#define TELOPT_NAOHTD 12 /* negotiate about horizontal tab disposition */
+#define TELOPT_NAOFFD 13 /* negotiate about formfeed disposition */
+#define TELOPT_NAOVTS 14 /* negotiate about vertical tab stops */
+#define TELOPT_NAOVTD 15 /* negotiate about vertical tab disposition */
+#define TELOPT_NAOLFD 16 /* negotiate about output LF disposition */
+#define TELOPT_XASCII 17 /* extended ascic character set */
+#define TELOPT_LOGOUT 18 /* force logout */
+#define TELOPT_BM 19 /* byte macro */
+#define TELOPT_DET 20 /* data entry terminal */
+#define TELOPT_SUPDUP 21 /* supdup protocol */
+#define TELOPT_SUPDUPOUTPUT 22 /* supdup output */
+#define TELOPT_SNDLOC 23 /* send location */
+#define TELOPT_TTYPE 24 /* terminal type */
+#define TELOPT_EOR 25 /* end or record */
+#define TELOPT_TUID 26 /* TACACS user identification */
+#define TELOPT_OUTMRK 27 /* output marking */
+#define TELOPT_TTYLOC 28 /* terminal location number */
+#define TELOPT_3270REGIME 29 /* 3270 regime */
+#define TELOPT_X3PAD 30 /* X.3 PAD */
+#define TELOPT_NAWS 31 /* window size */
+#define TELOPT_TSPEED 32 /* terminal speed */
+#define TELOPT_LFLOW 33 /* remote flow control */
+#define TELOPT_LINEMODE 34 /* Linemode option */
+#define TELOPT_XDISPLOC 35 /* X Display Location */
+#define TELOPT_OLD_ENVIRON 36 /* Old - Environment variables */
+#define TELOPT_AUTHENTICATION 37/* Authenticate */
+#define TELOPT_ENCRYPT 38 /* Encryption option */
+#define TELOPT_NEW_ENVIRON 39 /* New - Environment variables */
+#define TELOPT_TN3270E 40 /* RFC2355 - TN3270 Enhancements */
+#define TELOPT_CHARSET 42 /* RFC2066 - Charset */
+#define TELOPT_COMPORT 44 /* RFC2217 - Com Port Control */
+#define TELOPT_KERMIT 47 /* RFC2840 - Kermit */
+#define TELOPT_EXOPL 255 /* extended-options-list */
+
+
+#define NTELOPTS (1+TELOPT_KERMIT)
+#ifdef TELOPTS
+const char *telopts[NTELOPTS+1] = {
+ "BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME",
+ "STATUS", "TIMING MARK", "RCTE", "NAOL", "NAOP",
+ "NAOCRD", "NAOHTS", "NAOHTD", "NAOFFD", "NAOVTS",
+ "NAOVTD", "NAOLFD", "EXTEND ASCII", "LOGOUT", "BYTE MACRO",
+ "DATA ENTRY TERMINAL", "SUPDUP", "SUPDUP OUTPUT",
+ "SEND LOCATION", "TERMINAL TYPE", "END OF RECORD",
+ "TACACS UID", "OUTPUT MARKING", "TTYLOC",
+ "3270 REGIME", "X.3 PAD", "NAWS", "TSPEED", "LFLOW",
+ "LINEMODE", "XDISPLOC", "OLD-ENVIRON", "AUTHENTICATION",
+ "ENCRYPT", "NEW-ENVIRON", "TN3270E", "CHARSET", "COM-PORT",
+ "KERMIT",
+ 0
+};
+#define TELOPT_FIRST TELOPT_BINARY
+#define TELOPT_LAST TELOPT_KERMIT
+#define TELOPT_OK(x) ((unsigned int)(x) <= TELOPT_LAST)
+#define TELOPT(x) telopts[(x)-TELOPT_FIRST]
+#endif
+
+/* sub-option qualifiers */
+#define TELQUAL_IS 0 /* option is... */
+#define TELQUAL_SEND 1 /* send option */
+#define TELQUAL_INFO 2 /* ENVIRON: informational version of IS */
+#define TELQUAL_REPLY 2 /* AUTHENTICATION: client version of IS */
+#define TELQUAL_NAME 3 /* AUTHENTICATION: client version of IS */
+
+#define LFLOW_OFF 0 /* Disable remote flow control */
+#define LFLOW_ON 1 /* Enable remote flow control */
+#define LFLOW_RESTART_ANY 2 /* Restart output on any char */
+#define LFLOW_RESTART_XON 3 /* Restart output only on XON */
+
+/*
+ * LINEMODE suboptions
+ */
+
+#define LM_MODE 1
+#define LM_FORWARDMASK 2
+#define LM_SLC 3
+
+#define MODE_EDIT 0x01
+#define MODE_TRAPSIG 0x02
+#define MODE_ACK 0x04
+#define MODE_SOFT_TAB 0x08
+#define MODE_LIT_ECHO 0x10
+
+#define MODE_MASK 0x1f
+
+/* Not part of protocol, but needed to simplify things... */
+#define MODE_FLOW 0x0100
+#define MODE_ECHO 0x0200
+#define MODE_INBIN 0x0400
+#define MODE_OUTBIN 0x0800
+#define MODE_FORCE 0x1000
+
+#define SLC_SYNCH 1
+#define SLC_BRK 2
+#define SLC_IP 3
+#define SLC_AO 4
+#define SLC_AYT 5
+#define SLC_EOR 6
+#define SLC_ABORT 7
+#define SLC_EOF 8
+#define SLC_SUSP 9
+#define SLC_EC 10
+#define SLC_EL 11
+#define SLC_EW 12
+#define SLC_RP 13
+#define SLC_LNEXT 14
+#define SLC_XON 15
+#define SLC_XOFF 16
+#define SLC_FORW1 17
+#define SLC_FORW2 18
+#define SLC_MCL 19
+#define SLC_MCR 20
+#define SLC_MCWL 21
+#define SLC_MCWR 22
+#define SLC_MCBOL 23
+#define SLC_MCEOL 24
+#define SLC_INSRT 25
+#define SLC_OVER 26
+#define SLC_ECR 27
+#define SLC_EWR 28
+#define SLC_EBOL 29
+#define SLC_EEOL 30
+
+#define NSLC 30
+
+/*
+ * For backwards compatibility, we define SLC_NAMES to be the
+ * list of names if SLC_NAMES is not defined.
+ */
+#define SLC_NAMELIST "0", "SYNCH", "BRK", "IP", "AO", "AYT", "EOR", \
+ "ABORT", "EOF", "SUSP", "EC", "EL", "EW", "RP", \
+ "LNEXT", "XON", "XOFF", "FORW1", "FORW2", \
+ "MCL", "MCR", "MCWL", "MCWR", "MCBOL", \
+ "MCEOL", "INSRT", "OVER", "ECR", "EWR", \
+ "EBOL", "EEOL", \
+ 0
+
+#ifdef SLC_NAMES
+const char *slc_names[] = {
+ SLC_NAMELIST
+};
+#else
+extern char *slc_names[];
+#define SLC_NAMES SLC_NAMELIST
+#endif
+
+#define SLC_NAME_OK(x) ((unsigned int)(x) <= NSLC)
+#define SLC_NAME(x) slc_names[x]
+
+#define SLC_NOSUPPORT 0
+#define SLC_CANTCHANGE 1
+#define SLC_VARIABLE 2
+#define SLC_DEFAULT 3
+#define SLC_LEVELBITS 0x03
+
+#define SLC_FUNC 0
+#define SLC_FLAGS 1
+#define SLC_VALUE 2
+
+#define SLC_ACK 0x80
+#define SLC_FLUSHIN 0x40
+#define SLC_FLUSHOUT 0x20
+
+#define OLD_ENV_VAR 1
+#define OLD_ENV_VALUE 0
+#define NEW_ENV_VAR 0
+#define NEW_ENV_VALUE 1
+#define ENV_ESC 2
+#define ENV_USERVAR 3
+
+/*
+ * AUTHENTICATION suboptions
+ */
+
+/*
+ * Who is authenticating who ...
+ */
+#define AUTH_WHO_CLIENT 0 /* Client authenticating server */
+#define AUTH_WHO_SERVER 1 /* Server authenticating client */
+#define AUTH_WHO_MASK 1
+
+/*
+ * amount of authentication done
+ */
+#define AUTH_HOW_ONE_WAY 0
+#define AUTH_HOW_MUTUAL 2
+#define AUTH_HOW_MASK 2
+
+#define AUTHTYPE_NULL 0
+#define AUTHTYPE_KERBEROS_V4 1
+#define AUTHTYPE_KERBEROS_V5 2
+#define AUTHTYPE_SPX 3
+#define AUTHTYPE_MINK 4
+#define AUTHTYPE_SRA 6
+#define AUTHTYPE_CNT 7
+
+#define AUTHTYPE_TEST 99
+
+#ifdef AUTH_NAMES
+const char *authtype_names[] = {
+ "NULL", "KERBEROS_V4", "KERBEROS_V5", "SPX", "MINK", NULL, "SRA",
+ 0
+};
+#else
+extern char *authtype_names[];
+#endif
+
+#define AUTHTYPE_NAME_OK(x) ((unsigned int)(x) < AUTHTYPE_CNT)
+#define AUTHTYPE_NAME(x) authtype_names[x]
+
+/*
+ * ENCRYPTion suboptions
+ */
+#define ENCRYPT_IS 0 /* I pick encryption type ... */
+#define ENCRYPT_SUPPORT 1 /* I support encryption types ... */
+#define ENCRYPT_REPLY 2 /* Initial setup response */
+#define ENCRYPT_START 3 /* Am starting to send encrypted */
+#define ENCRYPT_END 4 /* Am ending encrypted */
+#define ENCRYPT_REQSTART 5 /* Request you start encrypting */
+#define ENCRYPT_REQEND 6 /* Request you end encrypting */
+#define ENCRYPT_ENC_KEYID 7
+#define ENCRYPT_DEC_KEYID 8
+#define ENCRYPT_CNT 9
+
+#define ENCTYPE_ANY 0
+#define ENCTYPE_DES_CFB64 1
+#define ENCTYPE_DES_OFB64 2
+#define ENCTYPE_CNT 3
+
+#ifdef ENCRYPT_NAMES
+const char *encrypt_names[] = {
+ "IS", "SUPPORT", "REPLY", "START", "END",
+ "REQUEST-START", "REQUEST-END", "ENC-KEYID", "DEC-KEYID",
+ 0
+};
+const char *enctype_names[] = {
+ "ANY", "DES_CFB64", "DES_OFB64",
+ 0
+};
+#else
+extern char *encrypt_names[];
+extern char *enctype_names[];
+#endif
+
+
+#define ENCRYPT_NAME_OK(x) ((unsigned int)(x) < ENCRYPT_CNT)
+#define ENCRYPT_NAME(x) encrypt_names[x]
+
+#define ENCTYPE_NAME_OK(x) ((unsigned int)(x) < ENCTYPE_CNT)
+#define ENCTYPE_NAME(x) enctype_names[x]
+
+#endif /* !_TELNET_H_ */
diff --git a/src/include/arpa/tftp.h b/src/include/arpa/tftp.h
new file mode 100644
index 0000000..1de4dd4
--- /dev/null
+++ b/src/include/arpa/tftp.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)tftp.h 8.1 (Berkeley) 6/2/93
+ * $FreeBSD: src/include/arpa/tftp.h,v 1.5 2001/09/27 20:50:14 obrien Exp $
+ */
+
+#ifndef _ARPA_TFTP_H_
+#define _ARPA_TFTP_H_
+
+/*
+ * Trivial File Transfer Protocol (IEN-133)
+ */
+#define SEGSIZE 512 /* data segment size */
+
+/*
+ * Packet types.
+ */
+#define RRQ 01 /* read request */
+#define WRQ 02 /* write request */
+#define DATA 03 /* data packet */
+#define ACK 04 /* acknowledgement */
+#define ERROR 05 /* error code */
+#define OACK 06 /* option acknowledgement */
+
+struct tftphdr {
+ unsigned short th_opcode; /* packet type */
+ union {
+ unsigned short tu_block; /* block # */
+ unsigned short tu_code; /* error code */
+ char tu_stuff[1]; /* request packet stuff */
+ } th_u;
+ char th_data[1]; /* data or error string */
+};
+
+#define th_block th_u.tu_block
+#define th_code th_u.tu_code
+#define th_stuff th_u.tu_stuff
+#define th_msg th_data
+
+/*
+ * Error codes.
+ */
+#define EUNDEF 0 /* not defined */
+#define ENOTFOUND 1 /* file not found */
+#define EACCESS 2 /* access violation */
+#define ENOSPACE 3 /* disk full or allocation exceeded */
+#define EBADOP 4 /* illegal TFTP operation */
+#define EBADID 5 /* unknown transfer ID */
+#define EEXISTS 6 /* file already exists */
+#define ENOUSER 7 /* no such user */
+#define EOPTNEG 8 /* option negotiation failed */
+
+#endif /* !_TFTP_H_ */
diff --git a/src/include/asn1_err.h b/src/include/asn1_err.h
new file mode 100644
index 0000000..0604cbf
--- /dev/null
+++ b/src/include/asn1_err.h
@@ -0,0 +1,29 @@
+/* Generated from /usr/src/kerberos5/lib/libasn1/../../../crypto/heimdal/lib/asn1/asn1_err.et */
+/* $Id$ */
+
+#ifndef __asn1_err_h__
+#define __asn1_err_h__
+
+struct et_list;
+
+void initialize_asn1_error_table_r(struct et_list **);
+
+void initialize_asn1_error_table(void);
+#define init_asn1_err_tbl initialize_asn1_error_table
+
+typedef enum asn1_error_number{
+ ASN1_BAD_TIMEFORMAT = 1859794432,
+ ASN1_MISSING_FIELD = 1859794433,
+ ASN1_MISPLACED_FIELD = 1859794434,
+ ASN1_TYPE_MISMATCH = 1859794435,
+ ASN1_OVERFLOW = 1859794436,
+ ASN1_OVERRUN = 1859794437,
+ ASN1_BAD_ID = 1859794438,
+ ASN1_BAD_LENGTH = 1859794439,
+ ASN1_BAD_FORMAT = 1859794440,
+ ASN1_PARSE_ERROR = 1859794441
+} asn1_error_number;
+
+#define ERROR_TABLE_BASE_asn1 1859794432
+
+#endif /* __asn1_err_h__ */
diff --git a/src/include/assert.h b/src/include/assert.h
new file mode 100644
index 0000000..5ad0135
--- /dev/null
+++ b/src/include/assert.h
@@ -0,0 +1,64 @@
+/*-
+ * Copyright (c) 1992, 1993
+ * The Regents of the University of California. All rights reserved.
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)assert.h 8.2 (Berkeley) 1/21/94
+ * $FreeBSD: src/include/assert.h,v 1.4 2002/03/23 17:24:53 imp Exp $
+ */
+
+#include
+
+/*
+ * Unlike other ANSI header files, may usefully be included
+ * multiple times, with and without NDEBUG defined.
+ */
+
+#undef assert
+#undef _assert
+
+#ifdef NDEBUG
+#define assert(e) ((void)0)
+#define _assert(e) ((void)0)
+#else
+#define _assert(e) assert(e)
+
+#define assert(e) ((e) ? (void)0 : __assert(__func__, __FILE__, \
+ __LINE__, #e))
+#endif /* NDEBUG */
+
+__BEGIN_DECLS
+void __assert(const char *, const char *, int, const char *);
+__END_DECLS
diff --git a/src/include/bitstring.h b/src/include/bitstring.h
new file mode 100644
index 0000000..3dfb955
--- /dev/null
+++ b/src/include/bitstring.h
@@ -0,0 +1,35 @@
+/*-
+ * Copyright (c) 2003 Poul-Henning Kamp
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: src/include/bitstring.h,v 1.3 2003/06/13 19:40:13 phk Exp $
+ */
+
+#ifndef _BITSTRING_H_
+#define _BITSTRING_H_
+
+#include
+
+#endif /* _BITSTRING_H_ */
+
diff --git a/src/include/bluetooth.h b/src/include/bluetooth.h
new file mode 100644
index 0000000..9c84cc6
--- /dev/null
+++ b/src/include/bluetooth.h
@@ -0,0 +1,78 @@
+/*
+ * bluetooth.h
+ *
+ * Copyright (c) 2001-2003 Maksim Yevmenkin
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $Id$
+ * $FreeBSD: src/lib/libbluetooth/bluetooth.h,v 1.1 2003/10/12 22:04:18 emax Exp $
+ */
+
+#ifndef _BLUETOOTH_H_
+#define _BLUETOOTH_H_
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+__BEGIN_DECLS
+
+/*
+ * Lunux BlueZ compatibility
+ */
+
+#define bacmp(ba1, ba2) memcmp((ba1), (ba2), sizeof(bdaddr_t))
+#define bacpy(dst, src) memcpy((dst), (src), sizeof(bdaddr_t))
+#define ba2str(ba, str) bt_ntoa((ba), (str))
+#define str2ba(str, ba) (bt_aton((str), (ba)) == 1? 0 : -1)
+
+/*
+ * Interface to the outside world
+ */
+
+struct hostent * bt_gethostbyname (char const *name);
+struct hostent * bt_gethostbyaddr (char const *addr, int len, int type);
+struct hostent * bt_gethostent (void);
+void bt_sethostent (int stayopen);
+void bt_endhostent (void);
+
+struct protoent * bt_getprotobyname (char const *name);
+struct protoent * bt_getprotobynumber (int proto);
+struct protoent * bt_getprotoent (void);
+void bt_setprotoent (int stayopen);
+void bt_endprotoent (void);
+
+char const * bt_ntoa (bdaddr_t const *ba, char *str);
+int bt_aton (char const *str, bdaddr_t *ba);
+
+__END_DECLS
+
+#endif /* ndef _BLUETOOTH_H_ */
+
diff --git a/src/include/bsdxml.h b/src/include/bsdxml.h
new file mode 100644
index 0000000..2694dbd
--- /dev/null
+++ b/src/include/bsdxml.h
@@ -0,0 +1,901 @@
+/* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
+ See the file src/contrib/expat/COPYING for copying permission.
+*/
+
+#ifndef _BSD_XML_H_
+#define _BSD_XML_H_ 1
+
+
+#include
+
+#ifndef XMLPARSEAPI
+#if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
+#ifdef _STATIC
+#define XMLPARSEAPI(type) type __cdecl
+#else
+#define XMLPARSEAPI(type) __declspec(dllimport) type __cdecl
+#endif
+#else
+#define XMLPARSEAPI(type) type
+#endif
+#endif /* not defined XMLPARSEAPI */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef XML_UNICODE_WCHAR_T
+#define XML_UNICODE
+#endif
+
+struct XML_ParserStruct;
+typedef struct XML_ParserStruct *XML_Parser;
+
+#ifdef XML_UNICODE /* Information is UTF-16 encoded. */
+#ifdef XML_UNICODE_WCHAR_T
+typedef wchar_t XML_Char;
+typedef wchar_t XML_LChar;
+#else
+typedef unsigned short XML_Char;
+typedef char XML_LChar;
+#endif /* XML_UNICODE_WCHAR_T */
+#else /* Information is UTF-8 encoded. */
+typedef char XML_Char;
+typedef char XML_LChar;
+#endif /* XML_UNICODE */
+
+/* Should this be defined using stdbool.h when C99 is available? */
+typedef unsigned char XML_Bool;
+#define XML_TRUE ((XML_Bool) 1)
+#define XML_FALSE ((XML_Bool) 0)
+
+enum XML_Error {
+ XML_ERROR_NONE,
+ XML_ERROR_NO_MEMORY,
+ XML_ERROR_SYNTAX,
+ XML_ERROR_NO_ELEMENTS,
+ XML_ERROR_INVALID_TOKEN,
+ XML_ERROR_UNCLOSED_TOKEN,
+ XML_ERROR_PARTIAL_CHAR,
+ XML_ERROR_TAG_MISMATCH,
+ XML_ERROR_DUPLICATE_ATTRIBUTE,
+ XML_ERROR_JUNK_AFTER_DOC_ELEMENT,
+ XML_ERROR_PARAM_ENTITY_REF,
+ XML_ERROR_UNDEFINED_ENTITY,
+ XML_ERROR_RECURSIVE_ENTITY_REF,
+ XML_ERROR_ASYNC_ENTITY,
+ XML_ERROR_BAD_CHAR_REF,
+ XML_ERROR_BINARY_ENTITY_REF,
+ XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF,
+ XML_ERROR_MISPLACED_XML_PI,
+ XML_ERROR_UNKNOWN_ENCODING,
+ XML_ERROR_INCORRECT_ENCODING,
+ XML_ERROR_UNCLOSED_CDATA_SECTION,
+ XML_ERROR_EXTERNAL_ENTITY_HANDLING,
+ XML_ERROR_NOT_STANDALONE,
+ XML_ERROR_UNEXPECTED_STATE,
+ XML_ERROR_ENTITY_DECLARED_IN_PE,
+ XML_ERROR_FEATURE_REQUIRES_XML_DTD,
+ XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING
+};
+
+enum XML_Content_Type {
+ XML_CTYPE_EMPTY = 1,
+ XML_CTYPE_ANY,
+ XML_CTYPE_MIXED,
+ XML_CTYPE_NAME,
+ XML_CTYPE_CHOICE,
+ XML_CTYPE_SEQ
+};
+
+enum XML_Content_Quant {
+ XML_CQUANT_NONE,
+ XML_CQUANT_OPT,
+ XML_CQUANT_REP,
+ XML_CQUANT_PLUS
+};
+
+/* If type == XML_CTYPE_EMPTY or XML_CTYPE_ANY, then quant will be
+ XML_CQUANT_NONE, and the other fields will be zero or NULL.
+ If type == XML_CTYPE_MIXED, then quant will be NONE or REP and
+ numchildren will contain number of elements that may be mixed in
+ and children point to an array of XML_Content cells that will be
+ all of XML_CTYPE_NAME type with no quantification.
+
+ If type == XML_CTYPE_NAME, then the name points to the name, and
+ the numchildren field will be zero and children will be NULL. The
+ quant fields indicates any quantifiers placed on the name.
+
+ CHOICE and SEQ will have name NULL, the number of children in
+ numchildren and children will point, recursively, to an array
+ of XML_Content cells.
+
+ The EMPTY, ANY, and MIXED types will only occur at top level.
+*/
+
+typedef struct XML_cp XML_Content;
+
+struct XML_cp {
+ enum XML_Content_Type type;
+ enum XML_Content_Quant quant;
+ XML_Char * name;
+ unsigned int numchildren;
+ XML_Content * children;
+};
+
+
+/* This is called for an element declaration. See above for
+ description of the model argument. It's the caller's responsibility
+ to free model when finished with it.
+*/
+typedef void (*XML_ElementDeclHandler) (void *userData,
+ const XML_Char *name,
+ XML_Content *model);
+
+XMLPARSEAPI(void)
+XML_SetElementDeclHandler(XML_Parser parser,
+ XML_ElementDeclHandler eldecl);
+
+/* The Attlist declaration handler is called for *each* attribute. So
+ a single Attlist declaration with multiple attributes declared will
+ generate multiple calls to this handler. The "default" parameter
+ may be NULL in the case of the "#IMPLIED" or "#REQUIRED"
+ keyword. The "isrequired" parameter will be true and the default
+ value will be NULL in the case of "#REQUIRED". If "isrequired" is
+ true and default is non-NULL, then this is a "#FIXED" default.
+*/
+typedef void (*XML_AttlistDeclHandler) (void *userData,
+ const XML_Char *elname,
+ const XML_Char *attname,
+ const XML_Char *att_type,
+ const XML_Char *dflt,
+ int isrequired);
+
+XMLPARSEAPI(void)
+XML_SetAttlistDeclHandler(XML_Parser parser,
+ XML_AttlistDeclHandler attdecl);
+
+/* The XML declaration handler is called for *both* XML declarations
+ and text declarations. The way to distinguish is that the version
+ parameter will be NULL for text declarations. The encoding
+ parameter may be NULL for XML declarations. The standalone
+ parameter will be -1, 0, or 1 indicating respectively that there
+ was no standalone parameter in the declaration, that it was given
+ as no, or that it was given as yes.
+*/
+typedef void (*XML_XmlDeclHandler) (void *userData,
+ const XML_Char *version,
+ const XML_Char *encoding,
+ int standalone);
+
+XMLPARSEAPI(void)
+XML_SetXmlDeclHandler(XML_Parser parser,
+ XML_XmlDeclHandler xmldecl);
+
+
+typedef struct {
+ void *(*malloc_fcn)(size_t size);
+ void *(*realloc_fcn)(void *ptr, size_t size);
+ void (*free_fcn)(void *ptr);
+} XML_Memory_Handling_Suite;
+
+/* Constructs a new parser; encoding is the encoding specified by the
+ external protocol or NULL if there is none specified.
+*/
+XMLPARSEAPI(XML_Parser)
+XML_ParserCreate(const XML_Char *encoding);
+
+/* Constructs a new parser and namespace processor. Element type
+ names and attribute names that belong to a namespace will be
+ expanded; unprefixed attribute names are never expanded; unprefixed
+ element type names are expanded only if there is a default
+ namespace. The expanded name is the concatenation of the namespace
+ URI, the namespace separator character, and the local part of the
+ name. If the namespace separator is '\0' then the namespace URI
+ and the local part will be concatenated without any separator.
+ When a namespace is not declared, the name and prefix will be
+ passed through without expansion.
+*/
+XMLPARSEAPI(XML_Parser)
+XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator);
+
+
+/* Constructs a new parser using the memory management suit referred to
+ by memsuite. If memsuite is NULL, then use the standard library memory
+ suite. If namespaceSeparator is non-NULL it creates a parser with
+ namespace processing as described above. The character pointed at
+ will serve as the namespace separator.
+
+ All further memory operations used for the created parser will come from
+ the given suite.
+*/
+XMLPARSEAPI(XML_Parser)
+XML_ParserCreate_MM(const XML_Char *encoding,
+ const XML_Memory_Handling_Suite *memsuite,
+ const XML_Char *namespaceSeparator);
+
+/* Prepare a parser object to be re-used. This is particularly
+ valuable when memory allocation overhead is disproportionatly high,
+ such as when a large number of small documnents need to be parsed.
+ All handlers are cleared from the parser, except for the
+ unknownEncodingHandler. The parser's external state is re-initialized
+ except for the values of ns and ns_triplets.
+
+ Added in Expat 1.95.3.
+*/
+XMLPARSEAPI(XML_Bool)
+XML_ParserReset(XML_Parser parser, const XML_Char *encoding);
+
+/* atts is array of name/value pairs, terminated by 0;
+ names and values are 0 terminated.
+*/
+typedef void (*XML_StartElementHandler)(void *userData,
+ const XML_Char *name,
+ const XML_Char **atts);
+
+typedef void (*XML_EndElementHandler)(void *userData,
+ const XML_Char *name);
+
+
+/* s is not 0 terminated. */
+typedef void (*XML_CharacterDataHandler)(void *userData,
+ const XML_Char *s,
+ int len);
+
+/* target and data are 0 terminated */
+typedef void (*XML_ProcessingInstructionHandler)(void *userData,
+ const XML_Char *target,
+ const XML_Char *data);
+
+/* data is 0 terminated */
+typedef void (*XML_CommentHandler)(void *userData, const XML_Char *data);
+
+typedef void (*XML_StartCdataSectionHandler)(void *userData);
+typedef void (*XML_EndCdataSectionHandler)(void *userData);
+
+/* This is called for any characters in the XML document for which
+ there is no applicable handler. This includes both characters that
+ are part of markup which is of a kind that is not reported
+ (comments, markup declarations), or characters that are part of a
+ construct which could be reported but for which no handler has been
+ supplied. The characters are passed exactly as they were in the XML
+ document except that they will be encoded in UTF-8 or UTF-16.
+ Line boundaries are not normalized. Note that a byte order mark
+ character is not passed to the default handler. There are no
+ guarantees about how characters are divided between calls to the
+ default handler: for example, a comment might be split between
+ multiple calls.
+*/
+typedef void (*XML_DefaultHandler)(void *userData,
+ const XML_Char *s,
+ int len);
+
+/* This is called for the start of the DOCTYPE declaration, before
+ any DTD or internal subset is parsed.
+*/
+typedef void (*XML_StartDoctypeDeclHandler)(void *userData,
+ const XML_Char *doctypeName,
+ const XML_Char *sysid,
+ const XML_Char *pubid,
+ int has_internal_subset);
+
+/* This is called for the start of the DOCTYPE declaration when the
+ closing > is encountered, but after processing any external
+ subset.
+*/
+typedef void (*XML_EndDoctypeDeclHandler)(void *userData);
+
+/* This is called for entity declarations. The is_parameter_entity
+ argument will be non-zero if the entity is a parameter entity, zero
+ otherwise.
+
+ For internal entities (), value will
+ be non-NULL and systemId, publicID, and notationName will be NULL.
+ The value string is NOT nul-terminated; the length is provided in
+ the value_length argument. Since it is legal to have zero-length
+ values, do not use this argument to test for internal entities.
+
+ For external entities, value will be NULL and systemId will be
+ non-NULL. The publicId argument will be NULL unless a public
+ identifier was provided. The notationName argument will have a
+ non-NULL value only for unparsed entity declarations.
+
+ Note that is_parameter_entity can't be changed to XML_Bool, since
+ that would break binary compatibility.
+*/
+typedef void (*XML_EntityDeclHandler) (void *userData,
+ const XML_Char *entityName,
+ int is_parameter_entity,
+ const XML_Char *value,
+ int value_length,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId,
+ const XML_Char *notationName);
+
+XMLPARSEAPI(void)
+XML_SetEntityDeclHandler(XML_Parser parser,
+ XML_EntityDeclHandler handler);
+
+/* OBSOLETE -- OBSOLETE -- OBSOLETE
+ This handler has been superceded by the EntityDeclHandler above.
+ It is provided here for backward compatibility.
+
+ This is called for a declaration of an unparsed (NDATA) entity.
+ The base argument is whatever was set by XML_SetBase. The
+ entityName, systemId and notationName arguments will never be
+ NULL. The other arguments may be.
+*/
+typedef void (*XML_UnparsedEntityDeclHandler)(void *userData,
+ const XML_Char *entityName,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId,
+ const XML_Char *notationName);
+
+/* This is called for a declaration of notation. The base argument is
+ whatever was set by XML_SetBase. The notationName will never be
+ NULL. The other arguments can be.
+*/
+typedef void (*XML_NotationDeclHandler)(void *userData,
+ const XML_Char *notationName,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+/* When namespace processing is enabled, these are called once for
+ each namespace declaration. The call to the start and end element
+ handlers occur between the calls to the start and end namespace
+ declaration handlers. For an xmlns attribute, prefix will be
+ NULL. For an xmlns="" attribute, uri will be NULL.
+*/
+typedef void (*XML_StartNamespaceDeclHandler)(void *userData,
+ const XML_Char *prefix,
+ const XML_Char *uri);
+
+typedef void (*XML_EndNamespaceDeclHandler)(void *userData,
+ const XML_Char *prefix);
+
+/* This is called if the document is not standalone, that is, it has an
+ external subset or a reference to a parameter entity, but does not
+ have standalone="yes". If this handler returns 0, then processing
+ will not continue, and the parser will return a
+ XML_ERROR_NOT_STANDALONE error.
+ If parameter entity parsing is enabled, then in addition to the
+ conditions above this handler will only be called if the referenced
+ entity was actually read.
+*/
+typedef int (*XML_NotStandaloneHandler)(void *userData);
+
+/* This is called for a reference to an external parsed general
+ entity. The referenced entity is not automatically parsed. The
+ application can parse it immediately or later using
+ XML_ExternalEntityParserCreate.
+
+ The parser argument is the parser parsing the entity containing the
+ reference; it can be passed as the parser argument to
+ XML_ExternalEntityParserCreate. The systemId argument is the
+ system identifier as specified in the entity declaration; it will
+ not be NULL.
+
+ The base argument is the system identifier that should be used as
+ the base for resolving systemId if systemId was relative; this is
+ set by XML_SetBase; it may be NULL.
+
+ The publicId argument is the public identifier as specified in the
+ entity declaration, or NULL if none was specified; the whitespace
+ in the public identifier will have been normalized as required by
+ the XML spec.
+
+ The context argument specifies the parsing context in the format
+ expected by the context argument to XML_ExternalEntityParserCreate;
+ context is valid only until the handler returns, so if the
+ referenced entity is to be parsed later, it must be copied.
+
+ The handler should return 0 if processing should not continue
+ because of a fatal error in the handling of the external entity.
+ In this case the calling parser will return an
+ XML_ERROR_EXTERNAL_ENTITY_HANDLING error.
+
+ Note that unlike other handlers the first argument is the parser,
+ not userData.
+*/
+typedef int (*XML_ExternalEntityRefHandler)(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+/* This is called in two situations:
+ 1) An entity reference is encountered for which no declaration
+ has been read *and* this is not an error.
+ 2) An internal entity reference is read, but not expanded, because
+ XML_SetDefaultHandler has been called.
+ Note: skipped parameter entities in declarations and skipped general
+ entities in attribute values cannot be reported, because
+ the event would be out of sync with the reporting of the
+ declarations or attribute values
+*/
+typedef void (*XML_SkippedEntityHandler)(void *userData,
+ const XML_Char *entityName,
+ int is_parameter_entity);
+
+/* This structure is filled in by the XML_UnknownEncodingHandler to
+ provide information to the parser about encodings that are unknown
+ to the parser.
+
+ The map[b] member gives information about byte sequences whose
+ first byte is b.
+
+ If map[b] is c where c is >= 0, then b by itself encodes the
+ Unicode scalar value c.
+
+ If map[b] is -1, then the byte sequence is malformed.
+
+ If map[b] is -n, where n >= 2, then b is the first byte of an
+ n-byte sequence that encodes a single Unicode scalar value.
+
+ The data member will be passed as the first argument to the convert
+ function.
+
+ The convert function is used to convert multibyte sequences; s will
+ point to a n-byte sequence where map[(unsigned char)*s] == -n. The
+ convert function must return the Unicode scalar value represented
+ by this byte sequence or -1 if the byte sequence is malformed.
+
+ The convert function may be NULL if the encoding is a single-byte
+ encoding, that is if map[b] >= -1 for all bytes b.
+
+ When the parser is finished with the encoding, then if release is
+ not NULL, it will call release passing it the data member; once
+ release has been called, the convert function will not be called
+ again.
+
+ Expat places certain restrictions on the encodings that are supported
+ using this mechanism.
+
+ 1. Every ASCII character that can appear in a well-formed XML document,
+ other than the characters
+
+ $@\^`{}~
+
+ must be represented by a single byte, and that byte must be the
+ same byte that represents that character in ASCII.
+
+ 2. No character may require more than 4 bytes to encode.
+
+ 3. All characters encoded must have Unicode scalar values <=
+ 0xFFFF, (i.e., characters that would be encoded by surrogates in
+ UTF-16 are not allowed). Note that this restriction doesn't
+ apply to the built-in support for UTF-8 and UTF-16.
+
+ 4. No Unicode character may be encoded by more than one distinct
+ sequence of bytes.
+*/
+typedef struct {
+ int map[256];
+ void *data;
+ int (*convert)(void *data, const char *s);
+ void (*release)(void *data);
+} XML_Encoding;
+
+/* This is called for an encoding that is unknown to the parser.
+
+ The encodingHandlerData argument is that which was passed as the
+ second argument to XML_SetUnknownEncodingHandler.
+
+ The name argument gives the name of the encoding as specified in
+ the encoding declaration.
+
+ If the callback can provide information about the encoding, it must
+ fill in the XML_Encoding structure, and return 1. Otherwise it
+ must return 0.
+
+ If info does not describe a suitable encoding, then the parser will
+ return an XML_UNKNOWN_ENCODING error.
+*/
+typedef int (*XML_UnknownEncodingHandler)(void *encodingHandlerData,
+ const XML_Char *name,
+ XML_Encoding *info);
+
+XMLPARSEAPI(void)
+XML_SetElementHandler(XML_Parser parser,
+ XML_StartElementHandler start,
+ XML_EndElementHandler end);
+
+XMLPARSEAPI(void)
+XML_SetStartElementHandler(XML_Parser, XML_StartElementHandler);
+
+XMLPARSEAPI(void)
+XML_SetEndElementHandler(XML_Parser, XML_EndElementHandler);
+
+XMLPARSEAPI(void)
+XML_SetCharacterDataHandler(XML_Parser parser,
+ XML_CharacterDataHandler handler);
+
+XMLPARSEAPI(void)
+XML_SetProcessingInstructionHandler(XML_Parser parser,
+ XML_ProcessingInstructionHandler handler);
+XMLPARSEAPI(void)
+XML_SetCommentHandler(XML_Parser parser,
+ XML_CommentHandler handler);
+
+XMLPARSEAPI(void)
+XML_SetCdataSectionHandler(XML_Parser parser,
+ XML_StartCdataSectionHandler start,
+ XML_EndCdataSectionHandler end);
+
+XMLPARSEAPI(void)
+XML_SetStartCdataSectionHandler(XML_Parser parser,
+ XML_StartCdataSectionHandler start);
+
+XMLPARSEAPI(void)
+XML_SetEndCdataSectionHandler(XML_Parser parser,
+ XML_EndCdataSectionHandler end);
+
+/* This sets the default handler and also inhibits expansion of
+ internal entities. These entity references will be passed to the
+ default handler, or to the skipped entity handler, if one is set.
+*/
+XMLPARSEAPI(void)
+XML_SetDefaultHandler(XML_Parser parser,
+ XML_DefaultHandler handler);
+
+/* This sets the default handler but does not inhibit expansion of
+ internal entities. The entity reference will not be passed to the
+ default handler.
+*/
+XMLPARSEAPI(void)
+XML_SetDefaultHandlerExpand(XML_Parser parser,
+ XML_DefaultHandler handler);
+
+XMLPARSEAPI(void)
+XML_SetDoctypeDeclHandler(XML_Parser parser,
+ XML_StartDoctypeDeclHandler start,
+ XML_EndDoctypeDeclHandler end);
+
+XMLPARSEAPI(void)
+XML_SetStartDoctypeDeclHandler(XML_Parser parser,
+ XML_StartDoctypeDeclHandler start);
+
+XMLPARSEAPI(void)
+XML_SetEndDoctypeDeclHandler(XML_Parser parser,
+ XML_EndDoctypeDeclHandler end);
+
+XMLPARSEAPI(void)
+XML_SetUnparsedEntityDeclHandler(XML_Parser parser,
+ XML_UnparsedEntityDeclHandler handler);
+
+XMLPARSEAPI(void)
+XML_SetNotationDeclHandler(XML_Parser parser,
+ XML_NotationDeclHandler handler);
+
+XMLPARSEAPI(void)
+XML_SetNamespaceDeclHandler(XML_Parser parser,
+ XML_StartNamespaceDeclHandler start,
+ XML_EndNamespaceDeclHandler end);
+
+XMLPARSEAPI(void)
+XML_SetStartNamespaceDeclHandler(XML_Parser parser,
+ XML_StartNamespaceDeclHandler start);
+
+XMLPARSEAPI(void)
+XML_SetEndNamespaceDeclHandler(XML_Parser parser,
+ XML_EndNamespaceDeclHandler end);
+
+XMLPARSEAPI(void)
+XML_SetNotStandaloneHandler(XML_Parser parser,
+ XML_NotStandaloneHandler handler);
+
+XMLPARSEAPI(void)
+XML_SetExternalEntityRefHandler(XML_Parser parser,
+ XML_ExternalEntityRefHandler handler);
+
+/* If a non-NULL value for arg is specified here, then it will be
+ passed as the first argument to the external entity ref handler
+ instead of the parser object.
+*/
+XMLPARSEAPI(void)
+XML_SetExternalEntityRefHandlerArg(XML_Parser, void *arg);
+
+XMLPARSEAPI(void)
+XML_SetSkippedEntityHandler(XML_Parser parser,
+ XML_SkippedEntityHandler handler);
+
+XMLPARSEAPI(void)
+XML_SetUnknownEncodingHandler(XML_Parser parser,
+ XML_UnknownEncodingHandler handler,
+ void *encodingHandlerData);
+
+/* This can be called within a handler for a start element, end
+ element, processing instruction or character data. It causes the
+ corresponding markup to be passed to the default handler.
+*/
+XMLPARSEAPI(void)
+XML_DefaultCurrent(XML_Parser parser);
+
+/* If do_nst is non-zero, and namespace processing is in effect, and
+ a name has a prefix (i.e. an explicit namespace qualifier) then
+ that name is returned as a triplet in a single string separated by
+ the separator character specified when the parser was created: URI
+ + sep + local_name + sep + prefix.
+
+ If do_nst is zero, then namespace information is returned in the
+ default manner (URI + sep + local_name) whether or not the name
+ has a prefix.
+
+ Note: Calling XML_SetReturnNSTriplet after XML_Parse or
+ XML_ParseBuffer has no effect.
+*/
+
+XMLPARSEAPI(void)
+XML_SetReturnNSTriplet(XML_Parser parser, int do_nst);
+
+/* This value is passed as the userData argument to callbacks. */
+XMLPARSEAPI(void)
+XML_SetUserData(XML_Parser parser, void *userData);
+
+/* Returns the last value set by XML_SetUserData or NULL. */
+#define XML_GetUserData(parser) (*(void **)(parser))
+
+/* This is equivalent to supplying an encoding argument to
+ XML_ParserCreate. On success XML_SetEncoding returns non-zero,
+ zero otherwise.
+ Note: Calling XML_SetEncoding after XML_Parse or XML_ParseBuffer
+ has no effect and returns zero.
+*/
+XMLPARSEAPI(int)
+XML_SetEncoding(XML_Parser parser, const XML_Char *encoding);
+
+/* If this function is called, then the parser will be passed as the
+ first argument to callbacks instead of userData. The userData will
+ still be accessible using XML_GetUserData.
+*/
+XMLPARSEAPI(void)
+XML_UseParserAsHandlerArg(XML_Parser parser);
+
+/* If useDTD == XML_TRUE is passed to this function, then the parser
+ will assume that there is an external subset, even if none is
+ specified in the document. In such a case the parser will call the
+ externalEntityRefHandler with a value of NULL for the systemId
+ argument (the publicId and context arguments will be NULL as well).
+ Note: If this function is called, then this must be done before
+ the first call to XML_Parse or XML_ParseBuffer, since it will
+ have no effect after that. Returns
+ XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING.
+ Note: If the document does not have a DOCTYPE declaration at all,
+ then startDoctypeDeclHandler and endDoctypeDeclHandler will not
+ be called, despite an external subset being parsed.
+ Note: If XML_DTD is not defined when Expat is compiled, returns
+ XML_ERROR_FEATURE_REQUIRES_XML_DTD.
+*/
+XMLPARSEAPI(enum XML_Error)
+XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD);
+
+
+/* Sets the base to be used for resolving relative URIs in system
+ identifiers in declarations. Resolving relative identifiers is
+ left to the application: this value will be passed through as the
+ base argument to the XML_ExternalEntityRefHandler,
+ XML_NotationDeclHandler and XML_UnparsedEntityDeclHandler. The base
+ argument will be copied. Returns zero if out of memory, non-zero
+ otherwise.
+*/
+XMLPARSEAPI(int)
+XML_SetBase(XML_Parser parser, const XML_Char *base);
+
+XMLPARSEAPI(const XML_Char *)
+XML_GetBase(XML_Parser parser);
+
+/* Returns the number of the attribute/value pairs passed in last call
+ to the XML_StartElementHandler that were specified in the start-tag
+ rather than defaulted. Each attribute/value pair counts as 2; thus
+ this correspondds to an index into the atts array passed to the
+ XML_StartElementHandler.
+*/
+XMLPARSEAPI(int)
+XML_GetSpecifiedAttributeCount(XML_Parser parser);
+
+/* Returns the index of the ID attribute passed in the last call to
+ XML_StartElementHandler, or -1 if there is no ID attribute. Each
+ attribute/value pair counts as 2; thus this correspondds to an
+ index into the atts array passed to the XML_StartElementHandler.
+*/
+XMLPARSEAPI(int)
+XML_GetIdAttributeIndex(XML_Parser parser);
+
+/* Parses some input. Returns XML_STATUS_ERROR if a fatal error is
+ detected. The last call to XML_Parse must have isFinal true; len
+ may be zero for this call (or any other).
+
+ The XML_Status enum gives the possible return values for the
+ XML_Parse and XML_ParseBuffer functions. Though the return values
+ for these functions has always been described as a Boolean value,
+ the implementation, at least for the 1.95.x series, has always
+ returned exactly one of these values. The preprocessor #defines
+ are included so this stanza can be added to code that still needs
+ to support older versions of Expat 1.95.x:
+
+ #ifndef XML_STATUS_OK
+ #define XML_STATUS_OK 1
+ #define XML_STATUS_ERROR 0
+ #endif
+
+ Otherwise, the #define hackery is quite ugly and would have been dropped.
+*/
+enum XML_Status {
+ XML_STATUS_ERROR = 0,
+#define XML_STATUS_ERROR XML_STATUS_ERROR
+ XML_STATUS_OK = 1
+#define XML_STATUS_OK XML_STATUS_OK
+};
+
+XMLPARSEAPI(enum XML_Status)
+XML_Parse(XML_Parser parser, const char *s, int len, int isFinal);
+
+XMLPARSEAPI(void *)
+XML_GetBuffer(XML_Parser parser, int len);
+
+XMLPARSEAPI(enum XML_Status)
+XML_ParseBuffer(XML_Parser parser, int len, int isFinal);
+
+/* Creates an XML_Parser object that can parse an external general
+ entity; context is a '\0'-terminated string specifying the parse
+ context; encoding is a '\0'-terminated string giving the name of
+ the externally specified encoding, or NULL if there is no
+ externally specified encoding. The context string consists of a
+ sequence of tokens separated by formfeeds (\f); a token consisting
+ of a name specifies that the general entity of the name is open; a
+ token of the form prefix=uri specifies the namespace for a
+ particular prefix; a token of the form =uri specifies the default
+ namespace. This can be called at any point after the first call to
+ an ExternalEntityRefHandler so longer as the parser has not yet
+ been freed. The new parser is completely independent and may
+ safely be used in a separate thread. The handlers and userData are
+ initialized from the parser argument. Returns 0 if out of memory.
+ Otherwise returns a new XML_Parser object.
+*/
+XMLPARSEAPI(XML_Parser)
+XML_ExternalEntityParserCreate(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *encoding);
+
+enum XML_ParamEntityParsing {
+ XML_PARAM_ENTITY_PARSING_NEVER,
+ XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE,
+ XML_PARAM_ENTITY_PARSING_ALWAYS
+};
+
+/* Controls parsing of parameter entities (including the external DTD
+ subset). If parsing of parameter entities is enabled, then
+ references to external parameter entities (including the external
+ DTD subset) will be passed to the handler set with
+ XML_SetExternalEntityRefHandler. The context passed will be 0.
+
+ Unlike external general entities, external parameter entities can
+ only be parsed synchronously. If the external parameter entity is
+ to be parsed, it must be parsed during the call to the external
+ entity ref handler: the complete sequence of
+ XML_ExternalEntityParserCreate, XML_Parse/XML_ParseBuffer and
+ XML_ParserFree calls must be made during this call. After
+ XML_ExternalEntityParserCreate has been called to create the parser
+ for the external parameter entity (context must be 0 for this
+ call), it is illegal to make any calls on the old parser until
+ XML_ParserFree has been called on the newly created parser.
+ If the library has been compiled without support for parameter
+ entity parsing (ie without XML_DTD being defined), then
+ XML_SetParamEntityParsing will return 0 if parsing of parameter
+ entities is requested; otherwise it will return non-zero.
+ Note: If XML_SetParamEntityParsing is called after XML_Parse or
+ XML_ParseBuffer, then it has no effect and will always return 0.
+*/
+XMLPARSEAPI(int)
+XML_SetParamEntityParsing(XML_Parser parser,
+ enum XML_ParamEntityParsing parsing);
+
+/* If XML_Parse or XML_ParseBuffer have returned 0, then
+ XML_GetErrorCode returns information about the error.
+*/
+XMLPARSEAPI(enum XML_Error)
+XML_GetErrorCode(XML_Parser parser);
+
+/* These functions return information about the current parse
+ location. They may be called when XML_Parse or XML_ParseBuffer
+ return 0; in this case the location is the location of the
+ character at which the error was detected.
+
+ They may also be called from any other callback called to report
+ some parse event; in this the location is the location of the first
+ of the sequence of characters that generated the event.
+*/
+XMLPARSEAPI(int) XML_GetCurrentLineNumber(XML_Parser parser);
+XMLPARSEAPI(int) XML_GetCurrentColumnNumber(XML_Parser parser);
+XMLPARSEAPI(long) XML_GetCurrentByteIndex(XML_Parser parser);
+
+/* Return the number of bytes in the current event.
+ Returns 0 if the event is in an internal entity.
+*/
+XMLPARSEAPI(int)
+XML_GetCurrentByteCount(XML_Parser parser);
+
+/* If XML_CONTEXT_BYTES is defined, returns the input buffer, sets
+ the integer pointed to by offset to the offset within this buffer
+ of the current parse position, and sets the integer pointed to by size
+ to the size of this buffer (the number of input bytes). Otherwise
+ returns a NULL pointer. Also returns a NULL pointer if a parse isn't
+ active.
+
+ NOTE: The character pointer returned should not be used outside
+ the handler that makes the call.
+*/
+XMLPARSEAPI(const char *)
+XML_GetInputContext(XML_Parser parser,
+ int *offset,
+ int *size);
+
+/* For backwards compatibility with previous versions. */
+#define XML_GetErrorLineNumber XML_GetCurrentLineNumber
+#define XML_GetErrorColumnNumber XML_GetCurrentColumnNumber
+#define XML_GetErrorByteIndex XML_GetCurrentByteIndex
+
+/* Frees memory used by the parser. */
+XMLPARSEAPI(void)
+XML_ParserFree(XML_Parser parser);
+
+/* Returns a string describing the error. */
+XMLPARSEAPI(const XML_LChar *)
+XML_ErrorString(enum XML_Error code);
+
+/* Return a string containing the version number of this expat */
+XMLPARSEAPI(const XML_LChar *)
+XML_ExpatVersion(void);
+
+typedef struct {
+ int major;
+ int minor;
+ int micro;
+} XML_Expat_Version;
+
+/* Return an XML_Expat_Version structure containing numeric version
+ number information for this version of expat.
+*/
+XMLPARSEAPI(XML_Expat_Version)
+XML_ExpatVersionInfo(void);
+
+/* Added in Expat 1.95.5. */
+enum XML_FeatureEnum {
+ XML_FEATURE_END = 0,
+ XML_FEATURE_UNICODE,
+ XML_FEATURE_UNICODE_WCHAR_T,
+ XML_FEATURE_DTD,
+ XML_FEATURE_CONTEXT_BYTES,
+ XML_FEATURE_MIN_SIZE,
+ XML_FEATURE_SIZEOF_XML_CHAR,
+ XML_FEATURE_SIZEOF_XML_LCHAR
+ /* Additional features must be added to the end of this enum. */
+};
+
+typedef struct {
+ enum XML_FeatureEnum feature;
+ XML_LChar *name;
+ long int value;
+} XML_Feature;
+
+XMLPARSEAPI(const XML_Feature *)
+XML_GetFeatureList(void);
+
+
+/* Expat follows the GNU/Linux convention of odd number minor version for
+ beta/development releases and even number minor version for stable
+ releases. Micro is bumped with each release, and set to 0 with each
+ change to major or minor version.
+*/
+#define XML_MAJOR_VERSION 1
+#define XML_MINOR_VERSION 95
+#define XML_MICRO_VERSION 5
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* not _BSD_XML_H_ */
diff --git a/src/include/bzlib.h b/src/include/bzlib.h
new file mode 100644
index 0000000..9ac43a1
--- /dev/null
+++ b/src/include/bzlib.h
@@ -0,0 +1,321 @@
+
+/*-------------------------------------------------------------*/
+/*--- Public header file for the library. ---*/
+/*--- bzlib.h ---*/
+/*-------------------------------------------------------------*/
+
+/*--
+ This file is a part of bzip2 and/or libbzip2, a program and
+ library for lossless, block-sorting data compression.
+
+ Copyright (C) 1996-2002 Julian R Seward. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. The origin of this software must not be misrepresented; you must
+ not claim that you wrote the original software. If you use this
+ software in a product, an acknowledgment in the product
+ documentation would be appreciated but is not required.
+
+ 3. Altered source versions must be plainly marked as such, and must
+ not be misrepresented as being the original software.
+
+ 4. The name of the author may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ Julian Seward, Cambridge, UK.
+ jseward@acm.org
+ bzip2/libbzip2 version 1.0 of 21 March 2000
+
+ This program is based on (at least) the work of:
+ Mike Burrows
+ David Wheeler
+ Peter Fenwick
+ Alistair Moffat
+ Radford Neal
+ Ian H. Witten
+ Robert Sedgewick
+ Jon L. Bentley
+
+ For more information on these sources, see the manual.
+--*/
+
+
+#ifndef _BZLIB_H
+#define _BZLIB_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define BZ_RUN 0
+#define BZ_FLUSH 1
+#define BZ_FINISH 2
+
+#define BZ_OK 0
+#define BZ_RUN_OK 1
+#define BZ_FLUSH_OK 2
+#define BZ_FINISH_OK 3
+#define BZ_STREAM_END 4
+#define BZ_SEQUENCE_ERROR (-1)
+#define BZ_PARAM_ERROR (-2)
+#define BZ_MEM_ERROR (-3)
+#define BZ_DATA_ERROR (-4)
+#define BZ_DATA_ERROR_MAGIC (-5)
+#define BZ_IO_ERROR (-6)
+#define BZ_UNEXPECTED_EOF (-7)
+#define BZ_OUTBUFF_FULL (-8)
+#define BZ_CONFIG_ERROR (-9)
+
+typedef
+ struct {
+ char *next_in;
+ unsigned int avail_in;
+ unsigned int total_in_lo32;
+ unsigned int total_in_hi32;
+
+ char *next_out;
+ unsigned int avail_out;
+ unsigned int total_out_lo32;
+ unsigned int total_out_hi32;
+
+ void *state;
+
+ void *(*bzalloc)(void *,int,int);
+ void (*bzfree)(void *,void *);
+ void *opaque;
+ }
+ bz_stream;
+
+
+#ifndef BZ_IMPORT
+#define BZ_EXPORT
+#endif
+
+/* Need a definitition for FILE */
+#include
+
+#ifdef _WIN32
+# include
+# ifdef small
+ /* windows.h define small to char */
+# undef small
+# endif
+# ifdef BZ_EXPORT
+# define BZ_API(func) WINAPI func
+# define BZ_EXTERN extern
+# else
+ /* import windows dll dynamically */
+# define BZ_API(func) (WINAPI * func)
+# define BZ_EXTERN
+# endif
+#else
+# define BZ_API(func) func
+# define BZ_EXTERN extern
+#endif
+
+
+/*-- Core (low-level) library functions --*/
+
+BZ_EXTERN int BZ_API(BZ2_bzCompressInit) (
+ bz_stream* strm,
+ int blockSize100k,
+ int verbosity,
+ int workFactor
+ );
+
+BZ_EXTERN int BZ_API(BZ2_bzCompress) (
+ bz_stream* strm,
+ int action
+ );
+
+BZ_EXTERN int BZ_API(BZ2_bzCompressEnd) (
+ bz_stream* strm
+ );
+
+BZ_EXTERN int BZ_API(BZ2_bzDecompressInit) (
+ bz_stream *strm,
+ int verbosity,
+ int small
+ );
+
+BZ_EXTERN int BZ_API(BZ2_bzDecompress) (
+ bz_stream* strm
+ );
+
+BZ_EXTERN int BZ_API(BZ2_bzDecompressEnd) (
+ bz_stream *strm
+ );
+
+
+
+/*-- High(er) level library functions --*/
+
+#ifndef BZ_NO_STDIO
+#define BZ_MAX_UNUSED 5000
+
+typedef void BZFILE;
+
+BZ_EXTERN BZFILE* BZ_API(BZ2_bzReadOpen) (
+ int* bzerror,
+ FILE* f,
+ int verbosity,
+ int small,
+ void* unused,
+ int nUnused
+ );
+
+BZ_EXTERN void BZ_API(BZ2_bzReadClose) (
+ int* bzerror,
+ BZFILE* b
+ );
+
+BZ_EXTERN void BZ_API(BZ2_bzReadGetUnused) (
+ int* bzerror,
+ BZFILE* b,
+ void** unused,
+ int* nUnused
+ );
+
+BZ_EXTERN int BZ_API(BZ2_bzRead) (
+ int* bzerror,
+ BZFILE* b,
+ void* buf,
+ int len
+ );
+
+BZ_EXTERN BZFILE* BZ_API(BZ2_bzWriteOpen) (
+ int* bzerror,
+ FILE* f,
+ int blockSize100k,
+ int verbosity,
+ int workFactor
+ );
+
+BZ_EXTERN void BZ_API(BZ2_bzWrite) (
+ int* bzerror,
+ BZFILE* b,
+ void* buf,
+ int len
+ );
+
+BZ_EXTERN void BZ_API(BZ2_bzWriteClose) (
+ int* bzerror,
+ BZFILE* b,
+ int abandon,
+ unsigned int* nbytes_in,
+ unsigned int* nbytes_out
+ );
+
+BZ_EXTERN void BZ_API(BZ2_bzWriteClose64) (
+ int* bzerror,
+ BZFILE* b,
+ int abandon,
+ unsigned int* nbytes_in_lo32,
+ unsigned int* nbytes_in_hi32,
+ unsigned int* nbytes_out_lo32,
+ unsigned int* nbytes_out_hi32
+ );
+#endif
+
+
+/*-- Utility functions --*/
+
+BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffCompress) (
+ char* dest,
+ unsigned int* destLen,
+ char* source,
+ unsigned int sourceLen,
+ int blockSize100k,
+ int verbosity,
+ int workFactor
+ );
+
+BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffDecompress) (
+ char* dest,
+ unsigned int* destLen,
+ char* source,
+ unsigned int sourceLen,
+ int small,
+ int verbosity
+ );
+
+
+/*--
+ Code contributed by Yoshioka Tsuneo
+ (QWF00133@niftyserve.or.jp/tsuneo-y@is.aist-nara.ac.jp),
+ to support better zlib compatibility.
+ This code is not _officially_ part of libbzip2 (yet);
+ I haven't tested it, documented it, or considered the
+ threading-safeness of it.
+ If this code breaks, please contact both Yoshioka and me.
+--*/
+
+BZ_EXTERN const char * BZ_API(BZ2_bzlibVersion) (
+ void
+ );
+
+#ifndef BZ_NO_STDIO
+BZ_EXTERN BZFILE * BZ_API(BZ2_bzopen) (
+ const char *path,
+ const char *mode
+ );
+
+BZ_EXTERN BZFILE * BZ_API(BZ2_bzdopen) (
+ int fd,
+ const char *mode
+ );
+
+BZ_EXTERN int BZ_API(BZ2_bzread) (
+ BZFILE* b,
+ void* buf,
+ int len
+ );
+
+BZ_EXTERN int BZ_API(BZ2_bzwrite) (
+ BZFILE* b,
+ void* buf,
+ int len
+ );
+
+BZ_EXTERN int BZ_API(BZ2_bzflush) (
+ BZFILE* b
+ );
+
+BZ_EXTERN void BZ_API(BZ2_bzclose) (
+ BZFILE* b
+ );
+
+BZ_EXTERN const char * BZ_API(BZ2_bzerror) (
+ BZFILE *b,
+ int *errnum
+ );
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+/*-------------------------------------------------------------*/
+/*--- end bzlib.h ---*/
+/*-------------------------------------------------------------*/
diff --git a/src/include/calendar.h b/src/include/calendar.h
new file mode 100644
index 0000000..378382a
--- /dev/null
+++ b/src/include/calendar.h
@@ -0,0 +1,42 @@
+/*-
+ * Copyright (c) 1997 Wolfgang Helbig
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: src/lib/libcalendar/calendar.h,v 1.4 1999/08/28 00:04:04 peter Exp $
+ */
+struct date {
+ int y; /* year */
+ int m; /* month */
+ int d; /* day */
+};
+
+struct date *easterg(int _year, struct date *_dt);
+struct date *easterog(int _year, struct date *_dt);
+struct date *easteroj(int _year, struct date *_dt);
+struct date *gdate(int _nd, struct date *_dt);
+struct date *jdate(int _nd, struct date *_dt);
+int ndaysg(struct date *_dt);
+int ndaysj(struct date *_dt);
+int week(int _nd, int *_year);
+int weekday(int _nd);
diff --git a/src/include/camlib.h b/src/include/camlib.h
new file mode 100644
index 0000000..a0d1817
--- /dev/null
+++ b/src/include/camlib.h
@@ -0,0 +1,181 @@
+/*
+ * Copyright (c) 1997, 1998 Kenneth D. Merry.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: src/lib/libcam/camlib.h,v 1.5 2002/04/23 23:58:20 obrien Exp $
+ */
+/*
+ * Buffer encoding/decoding routines taken from the original FreeBSD SCSI
+ * library and slightly modified. The original header file had the following
+ * copyright:
+ */
+/* Copyright (c) 1994 HD Associates (hd@world.std.com)
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by HD Associates
+ * 4. Neither the name of the HD Associaates nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY HD ASSOCIATES``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL HD ASSOCIATES OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#ifndef _CAMLIB_H
+#define _CAMLIB_H
+
+#include
+#include
+
+#include
+#include
+
+#define CAM_ERRBUF_SIZE 2048 /* sizeof the CAM libarary error string */
+
+/*
+ * Right now we hard code the transport layer device, but this will change
+ * if we ever get more than one transport layer.
+ */
+#define XPT_DEVICE "/dev/xpt0"
+
+
+extern char cam_errbuf[];
+
+struct cam_device {
+ char device_path[MAXPATHLEN];/*
+ * Pathname of the device
+ * given by the user. This
+ * may be null if the
+ * user states the device
+ * name and unit number
+ * separately.
+ */
+ char given_dev_name[DEV_IDLEN+1];/*
+ * Device name given by
+ * the user.
+ */
+ u_int32_t given_unit_number; /*
+ * Unit number given by
+ * the user.
+ */
+ char device_name[DEV_IDLEN+1];/*
+ * Name of the device,
+ * e.g. 'pass'
+ */
+ u_int32_t dev_unit_num; /* Unit number of the passthrough
+ * device associated with this
+ * particular device.
+ */
+
+ char sim_name[SIM_IDLEN+1]; /* Controller name, e.g. 'ahc' */
+ u_int32_t sim_unit_number; /* Controller unit number */
+ u_int32_t bus_id; /* Controller bus number */
+ lun_id_t target_lun; /* Logical Unit Number */
+ target_id_t target_id; /* Target ID */
+ path_id_t path_id; /* System SCSI bus number */
+ u_int16_t pd_type; /* type of peripheral device */
+ struct scsi_inquiry_data inq_data; /* SCSI Inquiry data */
+ u_int8_t serial_num[252]; /* device serial number */
+ u_int8_t serial_num_len; /* length of the serial number */
+ u_int8_t sync_period; /* Negotiated sync period */
+ u_int8_t sync_offset; /* Negotiated sync offset */
+ u_int8_t bus_width; /* Negotiated bus width */
+ int fd; /* file descriptor for device */
+};
+
+__BEGIN_DECLS
+/* Basic utility commands */
+struct cam_device * cam_open_device(const char *path, int flags);
+void cam_close_device(struct cam_device *dev);
+void cam_close_spec_device(struct cam_device *dev);
+struct cam_device * cam_open_spec_device(const char *dev_name,
+ int unit, int flags,
+ struct cam_device *device);
+struct cam_device * cam_open_btl(path_id_t path_id, target_id_t target_id,
+ lun_id_t target_lun, int flags,
+ struct cam_device *device);
+struct cam_device * cam_open_pass(const char *path, int flags,
+ struct cam_device *device);
+union ccb * cam_getccb(struct cam_device *dev);
+void cam_freeccb(union ccb *ccb);
+int cam_send_ccb(struct cam_device *device, union ccb *ccb);
+char * cam_path_string(struct cam_device *dev, char *str,
+ int len);
+struct cam_device * cam_device_dup(struct cam_device *device);
+void cam_device_copy(struct cam_device *src,
+ struct cam_device *dst);
+int cam_get_device(const char *path, char *dev_name,
+ int devnamelen, int *unit);
+
+/*
+ * Buffer encoding/decoding routines, from the old SCSI library.
+ */
+int csio_decode(struct ccb_scsiio *csio, const char *fmt, ...)
+ __printflike(2, 3);
+int csio_decode_visit(struct ccb_scsiio *csio, const char *fmt,
+ void (*arg_put)(void *, int, void *, int, char *),
+ void *puthook);
+int buff_decode(u_int8_t *buff, size_t len, const char *fmt, ...)
+ __printflike(3, 4);
+int buff_decode_visit(u_int8_t *buff, size_t len, const char *fmt,
+ void (*arg_put)(void *, int, void *, int, char *),
+ void *puthook);
+int csio_build(struct ccb_scsiio *csio, u_int8_t *data_ptr,
+ u_int32_t dxfer_len, u_int32_t flags, int retry_count,
+ int timeout, const char *cmd_spec, ...);
+int csio_build_visit(struct ccb_scsiio *csio, u_int8_t *data_ptr,
+ u_int32_t dxfer_len, u_int32_t flags, int retry_count,
+ int timeout, const char *cmd_spec,
+ int (*arg_get)(void *hook, char *field_name),
+ void *gethook);
+int csio_encode(struct ccb_scsiio *csio, const char *fmt, ...)
+ __printflike(2, 3);
+int buff_encode_visit(u_int8_t *buff, size_t len, const char *fmt,
+ int (*arg_get)(void *hook, char *field_name),
+ void *gethook);
+int csio_encode_visit(struct ccb_scsiio *csio, const char *fmt,
+ int (*arg_get)(void *hook, char *field_name),
+ void *gethook);
+__END_DECLS
+
+#endif /* _CAMLIB_H */
diff --git a/src/include/com_err.h b/src/include/com_err.h
new file mode 100644
index 0000000..8979ffc
--- /dev/null
+++ b/src/include/com_err.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 1997 - 2001 Kungliga Tekniska H�gskolan
+ * (Royal Institute of Technology, Stockholm, Sweden).
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of the Institute nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/* $FreeBSD: src/contrib/com_err/com_err.h,v 1.3 2004/04/03 21:17:01 nectar Exp $ */
+/* $Id$ */
+
+/* MIT compatible com_err library */
+
+#ifndef __COM_ERR_H__
+#define __COM_ERR_H__
+
+#include
+#include
+
+#include
+
+typedef void (*errf) __P((const char *, long, const char *, va_list));
+
+const char * error_message __P((long));
+int init_error_table __P((const char**, long, int));
+
+void com_err_va __P((const char *, long, const char *, va_list))
+ __printflike(3, 0);
+
+void com_err __P((const char *, long, const char *, ...))
+ __printflike(3, 4);
+
+errf set_com_err_hook __P((errf));
+errf reset_com_err_hook __P((void));
+
+const char *error_table_name __P((int num));
+
+void add_to_error_table __P((struct et_list *new_table));
+
+#endif /* __COM_ERR_H__ */
diff --git a/src/include/com_right.h b/src/include/com_right.h
new file mode 100644
index 0000000..8d453bd
--- /dev/null
+++ b/src/include/com_right.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 1997 - 2000 Kungliga Tekniska H�gskolan
+ * (Royal Institute of Technology, Stockholm, Sweden).
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of the Institute nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/* $Id$ */
+/* $FreeBSD: src/contrib/com_err/com_right.h,v 1.3 2004/04/03 21:17:01 nectar Exp $ */
+
+#ifndef __COM_RIGHT_H__
+#define __COM_RIGHT_H__
+
+#include
+#include
+
+struct error_table {
+ char const * const * msgs;
+ long base;
+ int n_msgs;
+};
+struct et_list {
+ struct et_list *next;
+ struct error_table *table;
+};
+extern struct et_list *_et_list;
+
+const char *com_right __P((struct et_list *list, long code));
+void initialize_error_table_r __P((struct et_list **, const char **, int, long));
+void free_error_table __P((struct et_list *));
+
+#endif /* __COM_RIGHT_H__ */
diff --git a/src/include/complex.h b/src/include/complex.h
new file mode 100644
index 0000000..8995280
--- /dev/null
+++ b/src/include/complex.h
@@ -0,0 +1,60 @@
+/*-
+ * Copyright (c) 2001 The FreeBSD Project.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: src/include/complex.h,v 1.2 2002/03/23 17:24:53 imp Exp $
+ */
+
+#ifndef _COMPLEX_H
+#define _COMPLEX_H
+
+#ifdef __GNUC__
+#define _Complex __complex__
+#define _Complex_I 1.0fi
+#endif
+
+#define complex _Complex
+#define I _Complex_I
+
+#include
+
+__BEGIN_DECLS
+
+double cabs(double complex);
+float cabsf(float complex);
+double cimag(double complex);
+float cimagf(float complex);
+double creal(double complex);
+float crealf(float complex);
+
+__END_DECLS
+
+#ifdef __GNUC__
+#define cimag(z) (__imag__ (z))
+#define cimagf(z) (__imag__ (z))
+#define creal(z) (__real__ (z))
+#define crealf(z) (__real__ (z))
+#endif
+
+#endif /* _COMPLEX_H */
diff --git a/src/include/cpio.h b/src/include/cpio.h
new file mode 100644
index 0000000..d287af6
--- /dev/null
+++ b/src/include/cpio.h
@@ -0,0 +1,55 @@
+/*-
+ * Copyright (c) 2002 Mike Barcroft
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: src/include/cpio.h,v 1.1 2002/08/01 07:18:38 mike Exp $
+ */
+
+#ifndef _CPIO_H_
+#define _CPIO_H_
+
+#define C_ISSOCK 0140000 /* Socket. */
+#define C_ISLNK 0120000 /* Symbolic link. */
+#define C_ISCTG 0110000 /* Reserved. */
+#define C_ISREG 0100000 /* Regular file. */
+#define C_ISBLK 0060000 /* Block special. */
+#define C_ISDIR 0040000 /* Directory. */
+#define C_ISCHR 0020000 /* Character special. */
+#define C_ISFIFO 0010000 /* FIFO. */
+#define C_ISUID 0004000 /* Set user ID. */
+#define C_ISGID 0002000 /* Set group ID. */
+#define C_ISVTX 0001000 /* On directories, restricted deletion flag. */
+#define C_IRUSR 0000400 /* Read by owner. */
+#define C_IWUSR 0000200 /* Write by owner. */
+#define C_IXUSR 0000100 /* Execute by owner. */
+#define C_IRGRP 0000040 /* Read by group. */
+#define C_IWGRP 0000020 /* Write by group. */
+#define C_IXGRP 0000010 /* Execute by group. */
+#define C_IROTH 0000004 /* Read by others. */
+#define C_IWOTH 0000002 /* Write by others. */
+#define C_IXOTH 0000001 /* Execute by others. */
+
+#define MAGIC "070707"
+
+#endif /* _CPIO_H_ */
diff --git a/src/include/ctype.h b/src/include/ctype.h
new file mode 100644
index 0000000..c2e576e
--- /dev/null
+++ b/src/include/ctype.h
@@ -0,0 +1,234 @@
+/*
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Paul Borman at Krystal Technologies.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)ctype.h 8.4 (Berkeley) 1/21/94
+ * $FreeBSD: src/include/ctype.h,v 1.25 2004/04/21 13:25:55 tjr Exp $
+ */
+
+#ifndef _CTYPE_H_
+#define _CTYPE_H_
+
+#include
+#include
+
+#define _CTYPE_A 0x00000100L /* Alpha */
+#define _CTYPE_C 0x00000200L /* Control */
+#define _CTYPE_D 0x00000400L /* Digit */
+#define _CTYPE_G 0x00000800L /* Graph */
+#define _CTYPE_L 0x00001000L /* Lower */
+#define _CTYPE_P 0x00002000L /* Punct */
+#define _CTYPE_S 0x00004000L /* Space */
+#define _CTYPE_U 0x00008000L /* Upper */
+#define _CTYPE_X 0x00010000L /* X digit */
+#define _CTYPE_B 0x00020000L /* Blank */
+#define _CTYPE_R 0x00040000L /* Print */
+#define _CTYPE_I 0x00080000L /* Ideogram */
+#define _CTYPE_T 0x00100000L /* Special */
+#define _CTYPE_Q 0x00200000L /* Phonogram */
+#define _CTYPE_SW0 0x20000000L /* 0 width character */
+#define _CTYPE_SW1 0x40000000L /* 1 width character */
+#define _CTYPE_SW2 0x80000000L /* 2 width character */
+#define _CTYPE_SW3 0xc0000000L /* 3 width character */
+
+__BEGIN_DECLS
+int isalnum(int);
+int isalpha(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);
+int tolower(int);
+int toupper(int);
+
+#if __XSI_VISIBLE
+int _tolower(int);
+int _toupper(int);
+int isascii(int);
+int toascii(int);
+#endif
+
+#if __ISO_C_VISIBLE >= 1999
+int isblank(int);
+#endif
+
+#if __BSD_VISIBLE
+int digittoint(int);
+int ishexnumber(int);
+int isideogram(int);
+int isnumber(int);
+int isphonogram(int);
+int isrune(int);
+int isspecial(int);
+#endif
+__END_DECLS
+
+#define isalnum(c) __istype((c), _CTYPE_A|_CTYPE_D)
+#define isalpha(c) __istype((c), _CTYPE_A)
+#define iscntrl(c) __istype((c), _CTYPE_C)
+#define isdigit(c) __isctype((c), _CTYPE_D) /* ANSI -- locale independent */
+#define isgraph(c) __istype((c), _CTYPE_G)
+#define islower(c) __istype((c), _CTYPE_L)
+#define isprint(c) __istype((c), _CTYPE_R)
+#define ispunct(c) __istype((c), _CTYPE_P)
+#define isspace(c) __istype((c), _CTYPE_S)
+#define isupper(c) __istype((c), _CTYPE_U)
+#define isxdigit(c) __isctype((c), _CTYPE_X) /* ANSI -- locale independent */
+#define tolower(c) __tolower(c)
+#define toupper(c) __toupper(c)
+
+#if __XSI_VISIBLE
+/*
+ * POSIX.1-2001 specifies _tolower() and _toupper() to be macros equivalent to
+ * tolower() and toupper() respectively, minus extra checking to ensure that
+ * the argument is a lower or uppercase letter respectively. We've chosen to
+ * implement these macros with the same error checking as tolower() and
+ * toupper() since this doesn't violate the specification itself, only its
+ * intent. We purposely leave _tolower() and _toupper() undocumented to
+ * discourage their use.
+ *
+ * XXX isascii() and toascii() should similarly be undocumented.
+ */
+#define _tolower(c) __tolower(c)
+#define _toupper(c) __toupper(c)
+#define isascii(c) (((c) & ~0x7F) == 0)
+#define toascii(c) ((c) & 0x7F)
+#endif
+
+#if __ISO_C_VISIBLE >= 1999
+#define isblank(c) __istype((c), _CTYPE_B)
+#endif
+
+#if __BSD_VISIBLE
+#define digittoint(c) __maskrune((c), 0xFF)
+#define ishexnumber(c) __istype((c), _CTYPE_X)
+#define isideogram(c) __istype((c), _CTYPE_I)
+#define isnumber(c) __istype((c), _CTYPE_D)
+#define isphonogram(c) __istype((c), _CTYPE_Q)
+#define isrune(c) __istype((c), 0xFFFFFF00L)
+#define isspecial(c) __istype((c), _CTYPE_T)
+#endif
+
+/* See comments in about __ct_rune_t. */
+__BEGIN_DECLS
+unsigned long ___runetype(__ct_rune_t);
+__ct_rune_t ___tolower(__ct_rune_t);
+__ct_rune_t ___toupper(__ct_rune_t);
+__END_DECLS
+
+/*
+ * _EXTERNALIZE_CTYPE_INLINES_ is defined in locale/nomacros.c to tell us
+ * to generate code for extern versions of all our inline functions.
+ */
+#ifdef _EXTERNALIZE_CTYPE_INLINES_
+#define _USE_CTYPE_INLINE_
+#define static
+#define __inline
+#endif
+
+/*
+ * brings namespace pollution (struct member names). This prevents
+ * us from using the inline optimizations in the more strict __POSIX_VISIBLE and
+ * __XSI_VISIBLE namespaces. To fix this properly would require that we rename
+ * member names of long-standing structs, or something equally evil.
+ */
+#if !__BSD_VISIBLE && !defined(_USE_CTYPE_INLINE_) && \
+ !defined(_DONT_USE_CTYPE_INLINE_)
+#define _DONT_USE_CTYPE_INLINE_
+#endif
+
+/*
+ * Use inline functions if we are allowed to and the compiler supports them.
+ */
+#if !defined(_DONT_USE_CTYPE_INLINE_) && \
+ (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus))
+
+#include
+
+static __inline int
+__maskrune(__ct_rune_t _c, unsigned long _f)
+{
+ return ((_c < 0 || _c >= _CACHED_RUNES) ? ___runetype(_c) :
+ _CurrentRuneLocale->runetype[_c]) & _f;
+}
+
+static __inline int
+__istype(__ct_rune_t _c, unsigned long _f)
+{
+ return (!!__maskrune(_c, _f));
+}
+
+static __inline int
+__isctype(__ct_rune_t _c, unsigned long _f)
+{
+ return (_c < 0 || _c >= _CACHED_RUNES) ? 0 :
+ !!(_DefaultRuneLocale.runetype[_c] & _f);
+}
+
+static __inline __ct_rune_t
+__toupper(__ct_rune_t _c)
+{
+ return (_c < 0 || _c >= _CACHED_RUNES) ? ___toupper(_c) :
+ _CurrentRuneLocale->mapupper[_c];
+}
+
+static __inline __ct_rune_t
+__tolower(__ct_rune_t _c)
+{
+ return (_c < 0 || _c >= _CACHED_RUNES) ? ___tolower(_c) :
+ _CurrentRuneLocale->maplower[_c];
+}
+
+#else /* not using inlines */
+
+__BEGIN_DECLS
+int __maskrune(__ct_rune_t, unsigned long);
+int __istype(__ct_rune_t, unsigned long);
+int __isctype(__ct_rune_t, unsigned long);
+__ct_rune_t __toupper(__ct_rune_t);
+__ct_rune_t __tolower(__ct_rune_t);
+__END_DECLS
+#endif /* using inlines */
+
+#endif /* !_CTYPE_H_ */
diff --git a/src/include/ctypes.h b/src/include/ctypes.h
new file mode 100644
index 0000000..b817f43
--- /dev/null
+++ b/src/include/ctypes.h
@@ -0,0 +1,25 @@
+/**************************************************************************************
+ Copyright (c) 2002 The UbixOS Project
+ All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors
+in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its
+contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ $Id$
+
+**************************************************************************************/
+
+int toupper(int c);
+int tolower(int c);
\ No newline at end of file
diff --git a/src/include/curses.h b/src/include/curses.h
new file mode 100644
index 0000000..059fc5f
--- /dev/null
+++ b/src/include/curses.h
@@ -0,0 +1,1194 @@
+/****************************************************************************
+ * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Zeyd M. Ben-Halim 1992,1995 *
+ * and: Eric S. Raymond *
+ * and: Thomas E. Dickey 1996-on *
+ ****************************************************************************/
+
+/* $Id$ */
+
+#ifndef __NCURSES_H
+#define __NCURSES_H
+
+#define CURSES 1
+#define CURSES_H 1
+
+/* This should be defined for the enhanced functionality to be visible.
+ * However, none of the wide-character (enhanced) functionality is implemented.
+ * So we do not define it (yet).
+#define _XOPEN_CURSES 1
+ */
+
+/* These are defined only in curses.h, and are used for conditional compiles */
+#define NCURSES_VERSION_MAJOR 5
+#define NCURSES_VERSION_MINOR 2
+#define NCURSES_VERSION_PATCH 20020615
+
+/* This is defined in more than one ncurses header, for identification */
+#undef NCURSES_VERSION
+#define NCURSES_VERSION "5.2"
+
+#include
+
+#ifdef NCURSES_NOMACROS
+#define NCURSES_ATTR_T attr_t
+#endif
+
+#ifndef NCURSES_ATTR_T
+#define NCURSES_ATTR_T int
+#endif
+
+#undef NCURSES_CONST
+#define NCURSES_CONST const
+
+#undef NCURSES_COLOR_T
+#define NCURSES_COLOR_T short
+
+#undef NCURSES_SIZE_T
+#define NCURSES_SIZE_T short
+
+#undef NCURSES_CH_T
+#define NCURSES_CH_T chtype
+
+typedef unsigned long chtype;
+
+#include
+#include
+#include /* we need va_list */
+#ifdef _XOPEN_SOURCE_EXTENDED
+#include /* we want wchar_t */
+#endif /* _XOPEN_SOURCE_EXTENDED */
+
+/* XSI and SVr4 specify that curses implements 'bool'. However, C++ may also
+ * implement it. If so, we must use the C++ compiler's type to avoid conflict
+ * with other interfaces.
+ *
+ * A further complication is that may declare 'bool' to be a
+ * different type, such as an enum which is not necessarily compatible with
+ * C++. If we have , make 'bool' a macro, so users may #undef it.
+ * Otherwise, let it remain a typedef to avoid conflicts with other #define's.
+ * In either case, make a typedef for NCURSES_BOOL which can be used if needed
+ * from either C or C++.
+ */
+
+#undef TRUE
+#define TRUE 1
+
+#undef FALSE
+#define FALSE 0
+
+typedef unsigned char NCURSES_BOOL;
+
+#if (!defined(__cplusplus) || !1) && (!0)
+
+#if 1
+#include
+#endif
+
+#undef bool
+
+#if 1
+#define bool NCURSES_BOOL
+#else
+typedef unsigned char bool;
+#endif
+
+#endif /* !__cplusplus, etc. */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * XSI attributes. In the ncurses implementation, they are identical to the
+ * A_ attributes.
+ */
+#define WA_ATTRIBUTES A_ATTRIBUTES
+#define WA_NORMAL A_NORMAL
+#define WA_STANDOUT A_STANDOUT
+#define WA_UNDERLINE A_UNDERLINE
+#define WA_REVERSE A_REVERSE
+#define WA_BLINK A_BLINK
+#define WA_DIM A_DIM
+#define WA_BOLD A_BOLD
+#define WA_ALTCHARSET A_ALTCHARSET
+#define WA_INVIS A_INVIS
+#define WA_PROTECT A_PROTECT
+#define WA_HORIZONTAL A_HORIZONTAL
+#define WA_LEFT A_LEFT
+#define WA_LOW A_LOW
+#define WA_RIGHT A_RIGHT
+#define WA_TOP A_TOP
+#define WA_VERTICAL A_VERTICAL
+
+/* colors */
+extern NCURSES_EXPORT_VAR(int) COLORS;
+extern NCURSES_EXPORT_VAR(int) COLOR_PAIRS;
+
+#define COLOR_BLACK 0
+#define COLOR_RED 1
+#define COLOR_GREEN 2
+#define COLOR_YELLOW 3
+#define COLOR_BLUE 4
+#define COLOR_MAGENTA 5
+#define COLOR_CYAN 6
+#define COLOR_WHITE 7
+
+/* line graphics */
+
+#if 0
+extern NCURSES_EXPORT_VAR(chtype*) _nc_acs_map(void);
+#define acs_map (_nc_acs_map())
+#else
+extern NCURSES_EXPORT_VAR(chtype) acs_map[];
+#endif
+
+/* VT100 symbols begin here */
+#define ACS_ULCORNER (acs_map['l']) /* upper left corner */
+#define ACS_LLCORNER (acs_map['m']) /* lower left corner */
+#define ACS_URCORNER (acs_map['k']) /* upper right corner */
+#define ACS_LRCORNER (acs_map['j']) /* lower right corner */
+#define ACS_LTEE (acs_map['t']) /* tee pointing right */
+#define ACS_RTEE (acs_map['u']) /* tee pointing left */
+#define ACS_BTEE (acs_map['v']) /* tee pointing up */
+#define ACS_TTEE (acs_map['w']) /* tee pointing down */
+#define ACS_HLINE (acs_map['q']) /* horizontal line */
+#define ACS_VLINE (acs_map['x']) /* vertical line */
+#define ACS_PLUS (acs_map['n']) /* large plus or crossover */
+#define ACS_S1 (acs_map['o']) /* scan line 1 */
+#define ACS_S9 (acs_map['s']) /* scan line 9 */
+#define ACS_DIAMOND (acs_map['`']) /* diamond */
+#define ACS_CKBOARD (acs_map['a']) /* checker board (stipple) */
+#define ACS_DEGREE (acs_map['f']) /* degree symbol */
+#define ACS_PLMINUS (acs_map['g']) /* plus/minus */
+#define ACS_BULLET (acs_map['~']) /* bullet */
+/* Teletype 5410v1 symbols begin here */
+#define ACS_LARROW (acs_map[',']) /* arrow pointing left */
+#define ACS_RARROW (acs_map['+']) /* arrow pointing right */
+#define ACS_DARROW (acs_map['.']) /* arrow pointing down */
+#define ACS_UARROW (acs_map['-']) /* arrow pointing up */
+#define ACS_BOARD (acs_map['h']) /* board of squares */
+#define ACS_LANTERN (acs_map['i']) /* lantern symbol */
+#define ACS_BLOCK (acs_map['0']) /* solid square block */
+/*
+ * These aren't documented, but a lot of System Vs have them anyway
+ * (you can spot pprryyzz{{||}} in a lot of AT&T terminfo strings).
+ * The ACS_names may not match AT&T's, our source didn't know them.
+ */
+#define ACS_S3 (acs_map['p']) /* scan line 3 */
+#define ACS_S7 (acs_map['r']) /* scan line 7 */
+#define ACS_LEQUAL (acs_map['y']) /* less/equal */
+#define ACS_GEQUAL (acs_map['z']) /* greater/equal */
+#define ACS_PI (acs_map['{']) /* Pi */
+#define ACS_NEQUAL (acs_map['|']) /* not equal */
+#define ACS_STERLING (acs_map['}']) /* UK pound sign */
+
+/*
+ * Line drawing ACS names are of the form ACS_trbl, where t is the top, r
+ * is the right, b is the bottom, and l is the left. t, r, b, and l might
+ * be B (blank), S (single), D (double), or T (thick). The subset defined
+ * here only uses B and S.
+ */
+#define ACS_BSSB ACS_ULCORNER
+#define ACS_SSBB ACS_LLCORNER
+#define ACS_BBSS ACS_URCORNER
+#define ACS_SBBS ACS_LRCORNER
+#define ACS_SBSS ACS_RTEE
+#define ACS_SSSB ACS_LTEE
+#define ACS_SSBS ACS_BTEE
+#define ACS_BSSS ACS_TTEE
+#define ACS_BSBS ACS_HLINE
+#define ACS_SBSB ACS_VLINE
+#define ACS_SSSS ACS_PLUS
+
+#if defined(ERR) && ((ERR) != -1)
+#undef ERR
+#endif
+
+#if !defined(ERR)
+#define ERR (-1)
+#endif
+
+#if defined(OK) && ((OK) != 0)
+#undef OK
+#endif
+
+#if !defined(OK)
+#define OK (0)
+#endif
+
+/* values for the _flags member */
+#define _SUBWIN 0x01 /* is this a sub-window? */
+#define _ENDLINE 0x02 /* is the window flush right? */
+#define _FULLWIN 0x04 /* is the window full-screen? */
+#define _SCROLLWIN 0x08 /* bottom edge is at screen bottom? */
+#define _ISPAD 0x10 /* is this window a pad? */
+#define _HASMOVED 0x20 /* has cursor moved since last refresh? */
+#define _WRAPPED 0x40 /* cursor was just wrappped */
+
+/*
+ * this value is used in the firstchar and lastchar fields to mark
+ * unchanged lines
+ */
+#define _NOCHANGE -1
+
+/*
+ * this value is used in the oldindex field to mark lines created by insertions
+ * and scrolls.
+ */
+#define _NEWINDEX -1
+
+typedef struct screen SCREEN;
+typedef struct _win_st WINDOW;
+
+typedef chtype attr_t; /* ...must be at least as wide as chtype */
+
+#ifdef _XOPEN_SOURCE_EXTENDED
+
+#if 0
+#ifdef mblen /* libutf8.h defines it w/o undefining first */
+#undef mblen
+#endif
+#include
+#define __wchar_t
+#define __wint_t
+#endif
+
+#if 0
+#include /* ...to get mbstate_t, etc. */
+#endif
+
+#ifndef __wchar_t
+typedef unsigned long wchar_t;
+#endif /* __wchar_t */
+#ifndef __wint_t
+typedef long int wint_t;
+#endif /* __wint_t */
+
+#define CCHARW_MAX 5
+typedef struct
+{
+ attr_t attr;
+ wchar_t chars[CCHARW_MAX];
+}
+cchar_t;
+
+#endif /* _XOPEN_SOURCE_EXTENDED */
+
+struct ldat;
+
+struct _win_st
+{
+ NCURSES_SIZE_T _cury, _curx; /* current cursor position */
+
+ /* window location and size */
+ NCURSES_SIZE_T _maxy, _maxx; /* maximums of x and y, NOT window size */
+ NCURSES_SIZE_T _begy, _begx; /* screen coords of upper-left-hand corner */
+
+ short _flags; /* window state flags */
+
+ /* attribute tracking */
+ attr_t _attrs; /* current attribute for non-space character */
+ chtype _bkgd; /* current background char/attribute pair */
+
+ /* option values set by user */
+ bool _notimeout; /* no time out on function-key entry? */
+ bool _clear; /* consider all data in the window invalid? */
+ bool _leaveok; /* OK to not reset cursor on exit? */
+ bool _scroll; /* OK to scroll this window? */
+ bool _idlok; /* OK to use insert/delete line? */
+ bool _idcok; /* OK to use insert/delete char? */
+ bool _immed; /* window in immed mode? (not yet used) */
+ bool _sync; /* window in sync mode? */
+ bool _use_keypad; /* process function keys into KEY_ symbols? */
+ int _delay; /* 0 = nodelay, <0 = blocking, >0 = delay */
+
+ struct ldat *_line; /* the actual line data */
+
+ /* global screen state */
+ NCURSES_SIZE_T _regtop; /* top line of scrolling region */
+ NCURSES_SIZE_T _regbottom; /* bottom line of scrolling region */
+
+ /* these are used only if this is a sub-window */
+ int _parx; /* x coordinate of this window in parent */
+ int _pary; /* y coordinate of this window in parent */
+ WINDOW *_parent; /* pointer to parent if a sub-window */
+
+ /* these are used only if this is a pad */
+ struct pdat
+ {
+ NCURSES_SIZE_T _pad_y, _pad_x;
+ NCURSES_SIZE_T _pad_top, _pad_left;
+ NCURSES_SIZE_T _pad_bottom, _pad_right;
+ } _pad;
+
+ NCURSES_SIZE_T _yoffset; /* real begy is _begy + _yoffset */
+
+#ifdef _XOPEN_SOURCE_EXTENDED
+ cchar_t _bkgrnd; /* current background char/attribute pair */
+#endif
+};
+
+extern NCURSES_EXPORT_VAR(WINDOW *) stdscr;
+extern NCURSES_EXPORT_VAR(WINDOW *) curscr;
+extern NCURSES_EXPORT_VAR(WINDOW *) newscr;
+
+extern NCURSES_EXPORT_VAR(int) LINES;
+extern NCURSES_EXPORT_VAR(int) COLS;
+extern NCURSES_EXPORT_VAR(int) TABSIZE;
+
+/*
+ * This global was an undocumented feature under AIX curses.
+ */
+extern NCURSES_EXPORT_VAR(int) ESCDELAY; /* ESC expire time in milliseconds */
+
+extern NCURSES_EXPORT_VAR(char) ttytype[]; /* needed for backward compatibility */
+
+/*
+ * These functions are extensions - not in XSI Curses.
+ */
+#if 1
+extern NCURSES_EXPORT(bool) is_term_resized (int, int);
+extern NCURSES_EXPORT(char *) keybound (int, int);
+extern NCURSES_EXPORT(const char *) curses_version (void);
+extern NCURSES_EXPORT(int) assume_default_colors (int, int);
+extern NCURSES_EXPORT(int) define_key (char *, int);
+extern NCURSES_EXPORT(int) keyok (int, bool);
+extern NCURSES_EXPORT(int) resize_term (int, int);
+extern NCURSES_EXPORT(int) resizeterm (int, int);
+extern NCURSES_EXPORT(int) use_default_colors (void);
+extern NCURSES_EXPORT(int) use_extended_names (bool);
+extern NCURSES_EXPORT(int) wresize (WINDOW *, int, int);
+#else
+#define curses_version() NCURSES_VERSION
+#endif
+
+/*
+ * GCC (and some other compilers) define '__attribute__'; we're using this
+ * macro to alert the compiler to flag inconsistencies in printf/scanf-like
+ * function calls. Just in case '__attribute__' isn't defined, make a dummy.
+ * G++ doesn't accept it anyway.
+ */
+#if !defined(__GNUC__) && !defined(__attribute__)
+#define __attribute__(p) /* nothing */
+#endif
+
+/*
+ * For g++, turn off our macros that use __attribute__ (g++ recognizes some
+ * of them, but not at the same version levels as gcc).
+ */
+#ifdef __cplusplus
+#undef GCC_NORETURN
+#undef GCC_PRINTF
+#undef GCC_SCANF
+#undef GCC_UNUSED
+#endif
+
+/*
+ * We cannot define these in ncurses_cfg.h, since they require parameters to be
+ * passed (that's non-portable).
+ */
+#ifndef GCC_PRINTFLIKE
+#if defined(GCC_PRINTF) && !defined(printf)
+#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
+#else
+#define GCC_PRINTFLIKE(fmt,var) /*nothing*/
+#endif
+#endif
+
+#ifndef GCC_SCANFLIKE
+#if defined(GCC_SCANF) && !defined(scanf)
+#define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var)))
+#else
+#define GCC_SCANFLIKE(fmt,var) /*nothing*/
+#endif
+#endif
+
+#ifndef GCC_NORETURN
+#define GCC_NORETURN /* nothing */
+#endif
+
+#ifndef GCC_UNUSED
+#define GCC_UNUSED /* nothing */
+#endif
+
+/*
+ * Function prototypes. This is the complete XSI Curses list of required
+ * functions. Those marked `generated' will have sources generated from the
+ * macro definitions later in this file, in order to satisfy XPG4.2
+ * requirements.
+ */
+
+extern NCURSES_EXPORT(int) addch (const chtype); /* generated */
+extern NCURSES_EXPORT(int) addchnstr (const chtype *, int); /* generated */
+extern NCURSES_EXPORT(int) addchstr (const chtype *); /* generated */
+extern NCURSES_EXPORT(int) addnstr (const char *, int); /* generated */
+extern NCURSES_EXPORT(int) addstr (const char *); /* generated */
+extern NCURSES_EXPORT(int) attroff (NCURSES_ATTR_T); /* generated */
+extern NCURSES_EXPORT(int) attron (NCURSES_ATTR_T); /* generated */
+extern NCURSES_EXPORT(int) attrset (NCURSES_ATTR_T); /* generated */
+extern NCURSES_EXPORT(int) attr_get (attr_t *, short *, void *); /* generated */
+extern NCURSES_EXPORT(int) attr_off (attr_t, void *); /* generated */
+extern NCURSES_EXPORT(int) attr_on (attr_t, void *); /* generated */
+extern NCURSES_EXPORT(int) attr_set (attr_t, short, void *); /* generated */
+extern NCURSES_EXPORT(int) baudrate (void); /* implemented */
+extern NCURSES_EXPORT(int) beep (void); /* implemented */
+extern NCURSES_EXPORT(int) bkgd (chtype); /* generated */
+extern NCURSES_EXPORT(void) bkgdset (chtype); /* generated */
+extern NCURSES_EXPORT(int) border (chtype,chtype,chtype,chtype,chtype,chtype,chtype,chtype); /* generated */
+extern NCURSES_EXPORT(int) box (WINDOW *, chtype, chtype); /* generated */
+extern NCURSES_EXPORT(bool) can_change_color (void); /* implemented */
+extern NCURSES_EXPORT(int) cbreak (void); /* implemented */
+extern NCURSES_EXPORT(int) chgat (int, attr_t, short, const void *); /* generated */
+extern NCURSES_EXPORT(int) clear (void); /* generated */
+extern NCURSES_EXPORT(int) clearok (WINDOW *,bool); /* implemented */
+extern NCURSES_EXPORT(int) clrtobot (void); /* generated */
+extern NCURSES_EXPORT(int) clrtoeol (void); /* generated */
+extern NCURSES_EXPORT(int) color_content (short,short*,short*,short*); /* implemented */
+extern NCURSES_EXPORT(int) color_set (short,void*); /* generated */
+extern NCURSES_EXPORT(int) COLOR_PAIR (int); /* generated */
+extern NCURSES_EXPORT(int) copywin (const WINDOW*,WINDOW*,int,int,int,int,int,int,int); /* implemented */
+extern NCURSES_EXPORT(int) curs_set (int); /* implemented */
+extern NCURSES_EXPORT(int) def_prog_mode (void); /* implemented */
+extern NCURSES_EXPORT(int) def_shell_mode (void); /* implemented */
+extern NCURSES_EXPORT(int) delay_output (int); /* implemented */
+extern NCURSES_EXPORT(int) delch (void); /* generated */
+extern NCURSES_EXPORT(void) delscreen (SCREEN *); /* implemented */
+extern NCURSES_EXPORT(int) delwin (WINDOW *); /* implemented */
+extern NCURSES_EXPORT(int) deleteln (void); /* generated */
+extern NCURSES_EXPORT(WINDOW *) derwin (WINDOW *,int,int,int,int); /* implemented */
+extern NCURSES_EXPORT(int) doupdate (void); /* implemented */
+extern NCURSES_EXPORT(WINDOW *) dupwin (WINDOW *); /* implemented */
+extern NCURSES_EXPORT(int) echo (void); /* implemented */
+extern NCURSES_EXPORT(int) echochar (const chtype); /* generated */
+extern NCURSES_EXPORT(int) erase (void); /* generated */
+extern NCURSES_EXPORT(int) endwin (void); /* implemented */
+extern NCURSES_EXPORT(char) erasechar (void); /* implemented */
+extern NCURSES_EXPORT(void) filter (void); /* implemented */
+extern NCURSES_EXPORT(int) flash (void); /* implemented */
+extern NCURSES_EXPORT(int) flushinp (void); /* implemented */
+extern NCURSES_EXPORT(chtype) getbkgd (WINDOW *); /* generated */
+extern NCURSES_EXPORT(int) getch (void); /* generated */
+extern NCURSES_EXPORT(int) getnstr (char *, int); /* generated */
+extern NCURSES_EXPORT(int) getstr (char *); /* generated */
+extern NCURSES_EXPORT(WINDOW *) getwin (FILE *); /* implemented */
+extern NCURSES_EXPORT(int) halfdelay (int); /* implemented */
+extern NCURSES_EXPORT(bool) has_colors (void); /* implemented */
+extern NCURSES_EXPORT(bool) has_ic (void); /* implemented */
+extern NCURSES_EXPORT(bool) has_il (void); /* implemented */
+extern NCURSES_EXPORT(int) hline (chtype, int); /* generated */
+extern NCURSES_EXPORT(void) idcok (WINDOW *, bool); /* implemented */
+extern NCURSES_EXPORT(int) idlok (WINDOW *, bool); /* implemented */
+extern NCURSES_EXPORT(void) immedok (WINDOW *, bool); /* implemented */
+extern NCURSES_EXPORT(chtype) inch (void); /* generated */
+extern NCURSES_EXPORT(int) inchnstr (chtype *, int); /* generated */
+extern NCURSES_EXPORT(int) inchstr (chtype *); /* generated */
+extern NCURSES_EXPORT(WINDOW *) initscr (void); /* implemented */
+extern NCURSES_EXPORT(int) init_color (short,short,short,short); /* implemented */
+extern NCURSES_EXPORT(int) init_pair (short,short,short); /* implemented */
+extern NCURSES_EXPORT(int) innstr (char *, int); /* generated */
+extern NCURSES_EXPORT(int) insch (chtype); /* generated */
+extern NCURSES_EXPORT(int) insdelln (int); /* generated */
+extern NCURSES_EXPORT(int) insertln (void); /* generated */
+extern NCURSES_EXPORT(int) insnstr (const char *, int); /* generated */
+extern NCURSES_EXPORT(int) insstr (const char *); /* generated */
+extern NCURSES_EXPORT(int) instr (char *); /* generated */
+extern NCURSES_EXPORT(int) intrflush (WINDOW *,bool); /* implemented */
+extern NCURSES_EXPORT(bool) isendwin (void); /* implemented */
+extern NCURSES_EXPORT(bool) is_linetouched (WINDOW *,int); /* implemented */
+extern NCURSES_EXPORT(bool) is_wintouched (WINDOW *); /* implemented */
+extern NCURSES_EXPORT(NCURSES_CONST char *) keyname (int); /* implemented */
+extern NCURSES_EXPORT(int) keypad (WINDOW *,bool); /* implemented */
+extern NCURSES_EXPORT(char) killchar (void); /* implemented */
+extern NCURSES_EXPORT(int) leaveok (WINDOW *,bool); /* implemented */
+extern NCURSES_EXPORT(char *) longname (void); /* implemented */
+extern NCURSES_EXPORT(int) meta (WINDOW *,bool); /* implemented */
+extern NCURSES_EXPORT(int) move (int, int); /* generated */
+extern NCURSES_EXPORT(int) mvaddch (int, int, const chtype); /* generated */
+extern NCURSES_EXPORT(int) mvaddchnstr (int, int, const chtype *, int); /* generated */
+extern NCURSES_EXPORT(int) mvaddchstr (int, int, const chtype *); /* generated */
+extern NCURSES_EXPORT(int) mvaddnstr (int, int, const char *, int); /* generated */
+extern NCURSES_EXPORT(int) mvaddstr (int, int, const char *); /* generated */
+extern NCURSES_EXPORT(int) mvchgat (int, int, int, attr_t, short, const void *); /* generated */
+extern NCURSES_EXPORT(int) mvcur (int,int,int,int); /* implemented */
+extern NCURSES_EXPORT(int) mvdelch (int, int); /* generated */
+extern NCURSES_EXPORT(int) mvderwin (WINDOW *, int, int); /* implemented */
+extern NCURSES_EXPORT(int) mvgetch (int, int); /* generated */
+extern NCURSES_EXPORT(int) mvgetnstr (int, int, char *, int); /* generated */
+extern NCURSES_EXPORT(int) mvgetstr (int, int, char *); /* generated */
+extern NCURSES_EXPORT(int) mvhline (int, int, chtype, int); /* generated */
+extern NCURSES_EXPORT(chtype) mvinch (int, int); /* generated */
+extern NCURSES_EXPORT(int) mvinchnstr (int, int, chtype *, int); /* generated */
+extern NCURSES_EXPORT(int) mvinchstr (int, int, chtype *); /* generated */
+extern NCURSES_EXPORT(int) mvinnstr (int, int, char *, int); /* generated */
+extern NCURSES_EXPORT(int) mvinsch (int, int, chtype); /* generated */
+extern NCURSES_EXPORT(int) mvinsnstr (int, int, const char *, int); /* generated */
+extern NCURSES_EXPORT(int) mvinsstr (int, int, const char *); /* generated */
+extern NCURSES_EXPORT(int) mvinstr (int, int, char *); /* generated */
+extern NCURSES_EXPORT(int) mvprintw (int,int, NCURSES_CONST char *,...) /* implemented */
+ GCC_PRINTFLIKE(3,4);
+extern NCURSES_EXPORT(int) mvscanw (int,int, NCURSES_CONST char *,...) /* implemented */
+ GCC_SCANFLIKE(3,4);
+extern NCURSES_EXPORT(int) mvvline (int, int, chtype, int); /* generated */
+extern NCURSES_EXPORT(int) mvwaddch (WINDOW *, int, int, const chtype); /* generated */
+extern NCURSES_EXPORT(int) mvwaddchnstr (WINDOW *, int, int, const chtype *, int);/* generated */
+extern NCURSES_EXPORT(int) mvwaddchstr (WINDOW *, int, int, const chtype *); /* generated */
+extern NCURSES_EXPORT(int) mvwaddnstr (WINDOW *, int, int, const char *, int); /* generated */
+extern NCURSES_EXPORT(int) mvwaddstr (WINDOW *, int, int, const char *); /* generated */
+extern NCURSES_EXPORT(int) mvwchgat (WINDOW *, int, int, int, attr_t, short, const void *);/* generated */
+extern NCURSES_EXPORT(int) mvwdelch (WINDOW *, int, int); /* generated */
+extern NCURSES_EXPORT(int) mvwgetch (WINDOW *, int, int); /* generated */
+extern NCURSES_EXPORT(int) mvwgetnstr (WINDOW *, int, int, char *, int); /* generated */
+extern NCURSES_EXPORT(int) mvwgetstr (WINDOW *, int, int, char *); /* generated */
+extern NCURSES_EXPORT(int) mvwhline (WINDOW *, int, int, chtype, int); /* generated */
+extern NCURSES_EXPORT(int) mvwin (WINDOW *,int,int); /* implemented */
+extern NCURSES_EXPORT(chtype) mvwinch (WINDOW *, int, int); /* generated */
+extern NCURSES_EXPORT(int) mvwinchnstr (WINDOW *, int, int, chtype *, int); /* generated */
+extern NCURSES_EXPORT(int) mvwinchstr (WINDOW *, int, int, chtype *); /* generated */
+extern NCURSES_EXPORT(int) mvwinnstr (WINDOW *, int, int, char *, int); /* generated */
+extern NCURSES_EXPORT(int) mvwinsch (WINDOW *, int, int, chtype); /* generated */
+extern NCURSES_EXPORT(int) mvwinsnstr (WINDOW *, int, int, const char *, int); /* generated */
+extern NCURSES_EXPORT(int) mvwinsstr (WINDOW *, int, int, const char *); /* generated */
+extern NCURSES_EXPORT(int) mvwinstr (WINDOW *, int, int, char *); /* generated */
+extern NCURSES_EXPORT(int) mvwprintw (WINDOW*,int,int, NCURSES_CONST char *,...) /* implemented */
+ GCC_PRINTFLIKE(4,5);
+extern NCURSES_EXPORT(int) mvwscanw (WINDOW *,int,int, NCURSES_CONST char *,...) /* implemented */
+ GCC_SCANFLIKE(4,5);
+extern NCURSES_EXPORT(int) mvwvline (WINDOW *,int, int, chtype, int); /* generated */
+extern NCURSES_EXPORT(int) napms (int); /* implemented */
+extern NCURSES_EXPORT(WINDOW *) newpad (int,int); /* implemented */
+extern NCURSES_EXPORT(SCREEN *) newterm (NCURSES_CONST char *,FILE *,FILE *); /* implemented */
+extern NCURSES_EXPORT(WINDOW *) newwin (int,int,int,int); /* implemented */
+extern NCURSES_EXPORT(int) nl (void); /* implemented */
+extern NCURSES_EXPORT(int) nocbreak (void); /* implemented */
+extern NCURSES_EXPORT(int) nodelay (WINDOW *,bool); /* implemented */
+extern NCURSES_EXPORT(int) noecho (void); /* implemented */
+extern NCURSES_EXPORT(int) nonl (void); /* implemented */
+extern NCURSES_EXPORT(void) noqiflush (void); /* implemented */
+extern NCURSES_EXPORT(int) noraw (void); /* implemented */
+extern NCURSES_EXPORT(int) notimeout (WINDOW *,bool); /* implemented */
+extern NCURSES_EXPORT(int) overlay (const WINDOW*,WINDOW *); /* implemented */
+extern NCURSES_EXPORT(int) overwrite (const WINDOW*,WINDOW *); /* implemented */
+extern NCURSES_EXPORT(int) pair_content (short,short*,short*); /* implemented */
+extern NCURSES_EXPORT(int) PAIR_NUMBER (int); /* generated */
+extern NCURSES_EXPORT(int) pechochar (WINDOW *, const chtype); /* implemented */
+extern NCURSES_EXPORT(int) pnoutrefresh (WINDOW*,int,int,int,int,int,int);/* implemented */
+extern NCURSES_EXPORT(int) prefresh (WINDOW *,int,int,int,int,int,int); /* implemented */
+extern NCURSES_EXPORT(int) printw (NCURSES_CONST char *,...) /* implemented */
+ GCC_PRINTFLIKE(1,2);
+extern NCURSES_EXPORT(int) putp (const char *); /* implemented */
+extern NCURSES_EXPORT(int) putwin (WINDOW *, FILE *); /* implemented */
+extern NCURSES_EXPORT(void) qiflush (void); /* implemented */
+extern NCURSES_EXPORT(int) raw (void); /* implemented */
+extern NCURSES_EXPORT(int) redrawwin (WINDOW *); /* generated */
+extern NCURSES_EXPORT(int) refresh (void); /* generated */
+extern NCURSES_EXPORT(int) resetty (void); /* implemented */
+extern NCURSES_EXPORT(int) reset_prog_mode (void); /* implemented */
+extern NCURSES_EXPORT(int) reset_shell_mode (void); /* implemented */
+extern NCURSES_EXPORT(int) ripoffline (int, int (*)(WINDOW *, int)); /* implemented */
+extern NCURSES_EXPORT(int) savetty (void); /* implemented */
+extern NCURSES_EXPORT(int) scanw (NCURSES_CONST char *,...) /* implemented */
+ GCC_SCANFLIKE(1,2);
+extern NCURSES_EXPORT(int) scr_dump (const char *); /* implemented */
+extern NCURSES_EXPORT(int) scr_init (const char *); /* implemented */
+extern NCURSES_EXPORT(int) scrl (int); /* generated */
+extern NCURSES_EXPORT(int) scroll (WINDOW *); /* generated */
+extern NCURSES_EXPORT(int) scrollok (WINDOW *,bool); /* implemented */
+extern NCURSES_EXPORT(int) scr_restore (const char *); /* implemented */
+extern NCURSES_EXPORT(int) scr_set (const char *); /* implemented */
+extern NCURSES_EXPORT(int) setscrreg (int,int); /* generated */
+extern NCURSES_EXPORT(SCREEN *) set_term (SCREEN *); /* implemented */
+extern NCURSES_EXPORT(int) slk_attroff (const chtype); /* implemented */
+extern NCURSES_EXPORT(int) slk_attr_off (const attr_t, void *); /* generated:WIDEC */
+extern NCURSES_EXPORT(int) slk_attron (const chtype); /* implemented */
+extern NCURSES_EXPORT(int) slk_attr_on (attr_t,void*); /* generated:WIDEC */
+extern NCURSES_EXPORT(int) slk_attrset (const chtype); /* implemented */
+extern NCURSES_EXPORT(attr_t) slk_attr (void); /* implemented */
+extern NCURSES_EXPORT(int) slk_attr_set (const attr_t,short,void*); /* implemented */
+extern NCURSES_EXPORT(int) slk_clear (void); /* implemented */
+extern NCURSES_EXPORT(int) slk_color (short); /* implemented */
+extern NCURSES_EXPORT(int) slk_init (int); /* implemented */
+extern NCURSES_EXPORT(char *) slk_label (int); /* implemented */
+extern NCURSES_EXPORT(int) slk_noutrefresh (void); /* implemented */
+extern NCURSES_EXPORT(int) slk_refresh (void); /* implemented */
+extern NCURSES_EXPORT(int) slk_restore (void); /* implemented */
+extern NCURSES_EXPORT(int) slk_set (int,const char *,int); /* implemented */
+extern NCURSES_EXPORT(int) slk_touch (void); /* implemented */
+extern NCURSES_EXPORT(int) standout (void); /* generated */
+extern NCURSES_EXPORT(int) standend (void); /* generated */
+extern NCURSES_EXPORT(int) start_color (void); /* implemented */
+extern NCURSES_EXPORT(WINDOW *) subpad (WINDOW *, int, int, int, int); /* implemented */
+extern NCURSES_EXPORT(WINDOW *) subwin (WINDOW *,int,int,int,int); /* implemented */
+extern NCURSES_EXPORT(int) syncok (WINDOW *, bool); /* implemented */
+extern NCURSES_EXPORT(chtype) termattrs (void); /* implemented */
+extern NCURSES_EXPORT(char *) termname (void); /* implemented */
+extern NCURSES_EXPORT(int) tigetflag (NCURSES_CONST char *); /* implemented */
+extern NCURSES_EXPORT(int) tigetnum (NCURSES_CONST char *); /* implemented */
+extern NCURSES_EXPORT(char *) tigetstr (NCURSES_CONST char *); /* implemented */
+extern NCURSES_EXPORT(void) timeout (int); /* generated */
+extern NCURSES_EXPORT(int) touchline (WINDOW *, int, int); /* generated */
+extern NCURSES_EXPORT(int) touchwin (WINDOW *); /* generated */
+extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, ...); /* implemented */
+extern NCURSES_EXPORT(int) typeahead (int); /* implemented */
+extern NCURSES_EXPORT(int) ungetch (int); /* implemented */
+extern NCURSES_EXPORT(int) untouchwin (WINDOW *); /* generated */
+extern NCURSES_EXPORT(void) use_env (bool); /* implemented */
+extern NCURSES_EXPORT(int) vidattr (chtype); /* implemented */
+extern NCURSES_EXPORT(int) vidputs (chtype, int (*)(int)); /* implemented */
+extern NCURSES_EXPORT(int) vline (chtype, int); /* generated */
+extern NCURSES_EXPORT(int) vwprintw (WINDOW *, NCURSES_CONST char *,va_list); /* implemented */
+extern NCURSES_EXPORT(int) vw_printw (WINDOW *, NCURSES_CONST char *,va_list); /* generated */
+extern NCURSES_EXPORT(int) vwscanw (WINDOW *, NCURSES_CONST char *,va_list); /* implemented */
+extern NCURSES_EXPORT(int) vw_scanw (WINDOW *, NCURSES_CONST char *,va_list); /* generated */
+extern NCURSES_EXPORT(int) waddch (WINDOW *, const chtype); /* implemented */
+extern NCURSES_EXPORT(int) waddchnstr (WINDOW *,const chtype *const,int); /* implemented */
+extern NCURSES_EXPORT(int) waddchstr (WINDOW *,const chtype *); /* generated */
+extern NCURSES_EXPORT(int) waddnstr (WINDOW *,const char *const,int); /* implemented */
+extern NCURSES_EXPORT(int) waddstr (WINDOW *,const char *); /* generated */
+extern NCURSES_EXPORT(int) wattron (WINDOW *, int); /* generated */
+extern NCURSES_EXPORT(int) wattroff (WINDOW *, int); /* generated */
+extern NCURSES_EXPORT(int) wattrset (WINDOW *, int); /* generated */
+extern NCURSES_EXPORT(int) wattr_get (WINDOW *, attr_t *, short *, void *); /* generated */
+extern NCURSES_EXPORT(int) wattr_on (WINDOW *, NCURSES_CONST attr_t, void *); /* implemented */
+extern NCURSES_EXPORT(int) wattr_off (WINDOW *, NCURSES_CONST attr_t, void *); /* implemented */
+extern NCURSES_EXPORT(int) wattr_set (WINDOW *, attr_t, short, void *); /* generated */
+extern NCURSES_EXPORT(int) wbkgd (WINDOW *,const chtype); /* implemented */
+extern NCURSES_EXPORT(void) wbkgdset (WINDOW *,chtype); /* implemented */
+extern NCURSES_EXPORT(int) wborder (WINDOW *,chtype,chtype,chtype,chtype,chtype,chtype,chtype,chtype); /* implemented */
+extern NCURSES_EXPORT(int) wchgat (WINDOW *, int, attr_t, short, const void *);/* implemented */
+extern NCURSES_EXPORT(int) wclear (WINDOW *); /* implemented */
+extern NCURSES_EXPORT(int) wclrtobot (WINDOW *); /* implemented */
+extern NCURSES_EXPORT(int) wclrtoeol (WINDOW *); /* implemented */
+extern NCURSES_EXPORT(int) wcolor_set (WINDOW*,short,void*); /* implemented */
+extern NCURSES_EXPORT(void) wcursyncup (WINDOW *); /* implemented */
+extern NCURSES_EXPORT(int) wdelch (WINDOW *); /* implemented */
+extern NCURSES_EXPORT(int) wdeleteln (WINDOW *); /* generated */
+extern NCURSES_EXPORT(int) wechochar (WINDOW *, const chtype); /* implemented */
+extern NCURSES_EXPORT(int) werase (WINDOW *); /* implemented */
+extern NCURSES_EXPORT(int) wgetch (WINDOW *); /* implemented */
+extern NCURSES_EXPORT(int) wgetnstr (WINDOW *,char *,int); /* implemented */
+extern NCURSES_EXPORT(int) wgetstr (WINDOW *, char *); /* generated */
+extern NCURSES_EXPORT(int) whline (WINDOW *, chtype, int); /* implemented */
+extern NCURSES_EXPORT(chtype) winch (WINDOW *); /* implemented */
+extern NCURSES_EXPORT(int) winchnstr (WINDOW *, chtype *, int); /* implemented */
+extern NCURSES_EXPORT(int) winchstr (WINDOW *, chtype *); /* generated */
+extern NCURSES_EXPORT(int) winnstr (WINDOW *, char *, int); /* implemented */
+extern NCURSES_EXPORT(int) winsch (WINDOW *, chtype); /* implemented */
+extern NCURSES_EXPORT(int) winsdelln (WINDOW *,int); /* implemented */
+extern NCURSES_EXPORT(int) winsertln (WINDOW *); /* generated */
+extern NCURSES_EXPORT(int) winsnstr (WINDOW *, const char *,int); /* implemented */
+extern NCURSES_EXPORT(int) winsstr (WINDOW *, const char *); /* generated */
+extern NCURSES_EXPORT(int) winstr (WINDOW *, char *); /* generated */
+extern NCURSES_EXPORT(int) wmove (WINDOW *,int,int); /* implemented */
+extern NCURSES_EXPORT(int) wnoutrefresh (WINDOW *); /* implemented */
+extern NCURSES_EXPORT(int) wprintw (WINDOW *, NCURSES_CONST char *,...) /* implemented */
+ GCC_PRINTFLIKE(2,3);
+extern NCURSES_EXPORT(int) wredrawln (WINDOW *,int,int); /* implemented */
+extern NCURSES_EXPORT(int) wrefresh (WINDOW *); /* implemented */
+extern NCURSES_EXPORT(int) wscanw (WINDOW *, NCURSES_CONST char *,...) /* implemented */
+ GCC_SCANFLIKE(2,3);
+extern NCURSES_EXPORT(int) wscrl (WINDOW *,int); /* implemented */
+extern NCURSES_EXPORT(int) wsetscrreg (WINDOW *,int,int); /* implemented */
+extern NCURSES_EXPORT(int) wstandout (WINDOW *); /* generated */
+extern NCURSES_EXPORT(int) wstandend (WINDOW *); /* generated */
+extern NCURSES_EXPORT(void) wsyncdown (WINDOW *); /* implemented */
+extern NCURSES_EXPORT(void) wsyncup (WINDOW *); /* implemented */
+extern NCURSES_EXPORT(void) wtimeout (WINDOW *,int); /* implemented */
+extern NCURSES_EXPORT(int) wtouchln (WINDOW *,int,int,int); /* implemented */
+extern NCURSES_EXPORT(int) wvline (WINDOW *,chtype,int); /* implemented */
+
+/*
+ * vid_attr() was implemented originally based on the draft of XSI curses.
+ */
+#ifndef _XOPEN_SOURCE_EXTENDED
+#define vid_attr(a,pair,opts) vidattr(a)
+#endif
+
+/* attributes */
+
+#define NCURSES_ATTR_SHIFT 8
+#define NCURSES_BITS(mask,shift) ((mask) << ((shift) + NCURSES_ATTR_SHIFT))
+
+#define A_NORMAL 0L
+#define A_ATTRIBUTES NCURSES_BITS(~(1UL - 1UL),0)
+#define A_CHARTEXT (NCURSES_BITS(1UL,0) - 1UL)
+#define A_COLOR NCURSES_BITS(((1UL) << 8) - 1UL,0)
+#define A_STANDOUT NCURSES_BITS(1UL,8)
+#define A_UNDERLINE NCURSES_BITS(1UL,9)
+#define A_REVERSE NCURSES_BITS(1UL,10)
+#define A_BLINK NCURSES_BITS(1UL,11)
+#define A_DIM NCURSES_BITS(1UL,12)
+#define A_BOLD NCURSES_BITS(1UL,13)
+#define A_ALTCHARSET NCURSES_BITS(1UL,14)
+#define A_INVIS NCURSES_BITS(1UL,15)
+#define A_PROTECT NCURSES_BITS(1UL,16)
+#define A_HORIZONTAL NCURSES_BITS(1UL,17)
+#define A_LEFT NCURSES_BITS(1UL,18)
+#define A_LOW NCURSES_BITS(1UL,19)
+#define A_RIGHT NCURSES_BITS(1UL,20)
+#define A_TOP NCURSES_BITS(1UL,21)
+#define A_VERTICAL NCURSES_BITS(1UL,22)
+
+#define COLOR_PAIR(n) NCURSES_BITS(n, 0)
+#define PAIR_NUMBER(a) (((a) & A_COLOR) >> NCURSES_ATTR_SHIFT)
+
+/*
+ * pseudo functions
+ */
+#define wgetstr(w, s) wgetnstr(w, s, -1)
+#define getnstr(s, n) wgetnstr(stdscr, s, n)
+
+#define setterm(term) setupterm(term, 1, (int *)0)
+
+#define fixterm() reset_prog_mode()
+#define resetterm() reset_shell_mode()
+#define saveterm() def_prog_mode()
+#define crmode() cbreak()
+#define nocrmode() nocbreak()
+#define gettmode()
+
+#define getyx(win,y,x) (y = (win)?(win)->_cury:ERR, x = (win)?(win)->_curx:ERR)
+#define getbegyx(win,y,x) (y = (win)?(win)->_begy:ERR, x = (win)?(win)->_begx:ERR)
+#define getmaxyx(win,y,x) (y = (win)?((win)->_maxy + 1):ERR, x = (win)?((win)->_maxx + 1):ERR)
+#define getparyx(win,y,x) (y = (win)?(win)->_pary:ERR, x = (win)?(win)->_parx:ERR)
+#define getsyx(y,x) do { if(newscr->_leaveok) (y)=(x)=-1; \
+ else getyx(newscr,(y),(x)); \
+ } while(0)
+#define setsyx(y,x) do { if((y)==-1 && (x)==-1) newscr->_leaveok=TRUE; \
+ else {newscr->_leaveok=FALSE;wmove(newscr,(y),(x));} \
+ } while(0)
+
+/* It seems older SYSV curses versions define these */
+#define getattrs(win) ((win)?(win)->_attrs:A_NORMAL)
+#define getcurx(win) ((win)?(win)->_curx:ERR)
+#define getcury(win) ((win)?(win)->_cury:ERR)
+#define getbegx(win) ((win)?(win)->_begx:ERR)
+#define getbegy(win) ((win)?(win)->_begy:ERR)
+#define getmaxx(win) ((win)?((win)->_maxx + 1):ERR)
+#define getmaxy(win) ((win)?((win)->_maxy + 1):ERR)
+#define getparx(win) ((win)?(win)->_parx:ERR)
+#define getpary(win) ((win)?(win)->_pary:ERR)
+
+#define wstandout(win) (wattrset(win,A_STANDOUT))
+#define wstandend(win) (wattrset(win,A_NORMAL))
+#define wattr_set(win,a,p,opts) ((win)->_attrs = (((a) & ~A_COLOR) | COLOR_PAIR(p)), OK)
+
+#define wattron(win,at) wattr_on(win, at, (void *)0)
+#define wattroff(win,at) wattr_off(win, at, (void *)0)
+#define wattrset(win,at) ((win)->_attrs = (at))
+
+#define scroll(win) wscrl(win,1)
+
+#define touchwin(win) wtouchln((win), 0, getmaxy(win), 1)
+#define touchline(win, s, c) wtouchln((win), s, c, 1)
+#define untouchwin(win) wtouchln((win), 0, getmaxy(win), 0)
+
+#define box(win, v, h) wborder(win, v, v, h, h, 0, 0, 0, 0)
+#define border(ls, rs, ts, bs, tl, tr, bl, br) wborder(stdscr, ls, rs, ts, bs, tl, tr, bl, br)
+#define hline(ch, n) whline(stdscr, ch, n)
+#define vline(ch, n) wvline(stdscr, ch, n)
+
+#define winstr(w, s) winnstr(w, s, -1)
+#define winchstr(w, s) winchnstr(w, s, -1)
+#define winsstr(w, s) winsnstr(w, s, -1)
+
+#define redrawwin(win) wredrawln(win, 0, (win)->_maxy+1)
+#define waddstr(win,str) waddnstr(win,str,-1)
+#define waddchstr(win,str) waddchnstr(win,str,-1)
+
+/*
+ * pseudo functions for standard screen
+ */
+
+#define addch(ch) waddch(stdscr,ch)
+#define addchnstr(str,n) waddchnstr(stdscr,str,n)
+#define addchstr(str) waddchstr(stdscr,str)
+#define addnstr(str,n) waddnstr(stdscr,str,n)
+#define addstr(str) waddnstr(stdscr,str,-1)
+#define attroff(at) wattroff(stdscr,at)
+#define attron(at) wattron(stdscr,at)
+#define attrset(at) wattrset(stdscr,at)
+#define attr_get(ap,cp,o) wattr_get(stdscr,ap,cp,o)
+#define attr_off(a,o) wattr_off(stdscr,a,o)
+#define attr_on(a,o) wattr_on(stdscr,a,o)
+#define attr_set(a,c,o) wattr_set(stdscr,a,c,o)
+#define bkgd(ch) wbkgd(stdscr,ch)
+#define bkgdset(ch) wbkgdset(stdscr,ch)
+#define chgat(n,a,c,o) wchgat(stdscr,n,a,c,o)
+#define clear() wclear(stdscr)
+#define clrtobot() wclrtobot(stdscr)
+#define clrtoeol() wclrtoeol(stdscr)
+#define color_set(c,o) wcolor_set(stdscr,c,o)
+#define delch() wdelch(stdscr)
+#define deleteln() winsdelln(stdscr,-1)
+#define echochar(c) wechochar(stdscr,c)
+#define erase() werase(stdscr)
+#define getch() wgetch(stdscr)
+#define getstr(str) wgetstr(stdscr,str)
+#define inch() winch(stdscr)
+#define inchnstr(s,n) winchnstr(stdscr,s,n)
+#define inchstr(s) winchstr(stdscr,s)
+#define innstr(s,n) winnstr(stdscr,s,n)
+#define insch(c) winsch(stdscr,c)
+#define insdelln(n) winsdelln(stdscr,n)
+#define insertln() winsdelln(stdscr,1)
+#define insnstr(s,n) winsnstr(stdscr,s,n)
+#define insstr(s) winsstr(stdscr,s)
+#define instr(s) winstr(stdscr,s)
+#define move(y,x) wmove(stdscr,y,x)
+#define refresh() wrefresh(stdscr)
+#define scrl(n) wscrl(stdscr,n)
+#define setscrreg(t,b) wsetscrreg(stdscr,t,b)
+#define standend() wstandend(stdscr)
+#define standout() wstandout(stdscr)
+#define timeout(delay) wtimeout(stdscr,delay)
+#define wdeleteln(win) winsdelln(win,-1)
+#define winsertln(win) winsdelln(win,1)
+
+/*
+ * mv functions
+ */
+
+#define mvwaddch(win,y,x,ch) (wmove(win,y,x) == ERR ? ERR : waddch(win,ch))
+#define mvwaddchnstr(win,y,x,str,n) (wmove(win,y,x) == ERR ? ERR : waddchnstr(win,str,n))
+#define mvwaddchstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : waddchnstr(win,str,-1))
+#define mvwaddnstr(win,y,x,str,n) (wmove(win,y,x) == ERR ? ERR : waddnstr(win,str,n))
+#define mvwaddstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : waddnstr(win,str,-1))
+#define mvwdelch(win,y,x) (wmove(win,y,x) == ERR ? ERR : wdelch(win))
+#define mvwchgat(win,y,x,n,a,c,o) (wmove(win,y,x) == ERR ? ERR : wchgat(win,n,a,c,o))
+#define mvwgetch(win,y,x) (wmove(win,y,x) == ERR ? ERR : wgetch(win))
+#define mvwgetnstr(win,y,x,str,n) (wmove(win,y,x) == ERR ? ERR : wgetnstr(win,str,n))
+#define mvwgetstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : wgetstr(win,str))
+#define mvwhline(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : whline(win,c,n))
+#define mvwinch(win,y,x) (wmove(win,y,x) == ERR ? (chtype)ERR : winch(win))
+#define mvwinchnstr(win,y,x,s,n) (wmove(win,y,x) == ERR ? ERR : winchnstr(win,s,n))
+#define mvwinchstr(win,y,x,s) (wmove(win,y,x) == ERR ? ERR : winchstr(win,s))
+#define mvwinnstr(win,y,x,s,n) (wmove(win,y,x) == ERR ? ERR : winnstr(win,s,n))
+#define mvwinsch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : winsch(win,c))
+#define mvwinsnstr(win,y,x,s,n) (wmove(win,y,x) == ERR ? ERR : winsnstr(win,s,n))
+#define mvwinsstr(win,y,x,s) (wmove(win,y,x) == ERR ? ERR : winsstr(win,s))
+#define mvwinstr(win,y,x,s) (wmove(win,y,x) == ERR ? ERR : winstr(win,s))
+#define mvwvline(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : wvline(win,c,n))
+
+#define mvaddch(y,x,ch) mvwaddch(stdscr,y,x,ch)
+#define mvaddchnstr(y,x,str,n) mvwaddchnstr(stdscr,y,x,str,n)
+#define mvaddchstr(y,x,str) mvwaddchstr(stdscr,y,x,str)
+#define mvaddnstr(y,x,str,n) mvwaddnstr(stdscr,y,x,str,n)
+#define mvaddstr(y,x,str) mvwaddstr(stdscr,y,x,str)
+#define mvchgat(y,x,n,a,c,o) mvwchgat(stdscr,y,x,n,a,c,o)
+#define mvdelch(y,x) mvwdelch(stdscr,y,x)
+#define mvgetch(y,x) mvwgetch(stdscr,y,x)
+#define mvgetnstr(y,x,str,n) mvwgetnstr(stdscr,y,x,str,n)
+#define mvgetstr(y,x,str) mvwgetstr(stdscr,y,x,str)
+#define mvhline(y,x,c,n) mvwhline(stdscr,y,x,c,n)
+#define mvinch(y,x) mvwinch(stdscr,y,x)
+#define mvinchnstr(y,x,s,n) mvwinchnstr(stdscr,y,x,s,n)
+#define mvinchstr(y,x,s) mvwinchstr(stdscr,y,x,s)
+#define mvinnstr(y,x,s,n) mvwinnstr(stdscr,y,x,s,n)
+#define mvinsch(y,x,c) mvwinsch(stdscr,y,x,c)
+#define mvinsnstr(y,x,s,n) mvwinsnstr(stdscr,y,x,s,n)
+#define mvinsstr(y,x,s) mvwinsstr(stdscr,y,x,s)
+#define mvinstr(y,x,s) mvwinstr(stdscr,y,x,s)
+#define mvvline(y,x,c,n) mvwvline(stdscr,y,x,c,n)
+
+/*
+ * Some wide-character functions do not depend on the extensions.
+ */
+#define getbkgd(win) ((win)->_bkgd)
+
+#define slk_attr_off(a,v) ((v) ? ERR : slk_attroff(a))
+#define slk_attr_on(a,v) ((v) ? ERR : slk_attron(a))
+
+#define wattr_get(win,a,p,opts) ((void)((a) != 0 && (*(a) = (win)->_attrs)), \
+ (void)((p) != 0 && (*(p) = PAIR_NUMBER((win)->_attrs))), \
+ OK)
+
+/*
+ * XSI curses deprecates SVr4 vwprintw/vwscanw, which are supposed to use
+ * varargs.h. It adds new calls vw_printw/vw_scanw, which are supposed to
+ * use POSIX stdarg.h. The ncurses versions of vwprintw/vwscanw already
+ * use stdarg.h, so...
+ */
+#define vw_printw vwprintw
+#define vw_scanw vwscanw
+
+/*
+ * Export fallback function for use in C++ binding.
+ */
+#if !1
+#define vsscanf(a,b,c) _nc_vsscanf(a,b,c)
+NCURSES_EXPORT(int) vsscanf(const char *, const char *, va_list);
+#endif
+
+/*
+ * Pseudo-character tokens outside ASCII range. The curses wgetch() function
+ * will return any given one of these only if the corresponding k- capability
+ * is defined in your terminal's terminfo entry.
+ *
+ * Some keys (KEY_A1, etc) are arranged like this:
+ * a1 up a3
+ * left b2 right
+ * c1 down c3
+ *
+ * A few key codes do not depend upon the terminfo entry.
+ */
+#define KEY_CODE_YES 0400 /* A wchar_t contains a key code */
+#define KEY_MIN 0401 /* Minimum curses key */
+#define KEY_BREAK 0401 /* Break key (unreliable) */
+#define KEY_SRESET 0530 /* Soft (partial) reset (unreliable) */
+#define KEY_RESET 0531 /* Reset or hard reset (unreliable) */
+/*
+ * These definitions were generated by /usr/src/lib/libncurses/../../contrib/ncurses/include/MKkey_defs.sh /usr/src/lib/libncurses/../../contrib/ncurses/include/Caps
+ */
+#define KEY_DOWN 0402 /* down-arrow key */
+#define KEY_UP 0403 /* up-arrow key */
+#define KEY_LEFT 0404 /* left-arrow key */
+#define KEY_RIGHT 0405 /* right-arrow key */
+#define KEY_HOME 0406 /* home key */
+#define KEY_BACKSPACE 0407 /* backspace key */
+#define KEY_F0 0410 /* Function keys. Space for 64 */
+#define KEY_F(n) (KEY_F0+(n)) /* Value of function key n */
+#define KEY_DL 0510 /* delete-line key */
+#define KEY_IL 0511 /* insert-line key */
+#define KEY_DC 0512 /* delete-character key */
+#define KEY_IC 0513 /* insert-character key */
+#define KEY_EIC 0514 /* sent by rmir or smir in insert mode */
+#define KEY_CLEAR 0515 /* clear-screen or erase key */
+#define KEY_EOS 0516 /* clear-to-end-of-screen key */
+#define KEY_EOL 0517 /* clear-to-end-of-line key */
+#define KEY_SF 0520 /* scroll-forward key */
+#define KEY_SR 0521 /* scroll-backward key */
+#define KEY_NPAGE 0522 /* next-page key */
+#define KEY_PPAGE 0523 /* previous-page key */
+#define KEY_STAB 0524 /* set-tab key */
+#define KEY_CTAB 0525 /* clear-tab key */
+#define KEY_CATAB 0526 /* clear-all-tabs key */
+#define KEY_ENTER 0527 /* enter/send key */
+#define KEY_PRINT 0532 /* print key */
+#define KEY_LL 0533 /* lower-left key (home down) */
+#define KEY_A1 0534 /* upper left of keypad */
+#define KEY_A3 0535 /* upper right of keypad */
+#define KEY_B2 0536 /* center of keypad */
+#define KEY_C1 0537 /* lower left of keypad */
+#define KEY_C3 0540 /* lower right of keypad */
+#define KEY_BTAB 0541 /* back-tab key */
+#define KEY_BEG 0542 /* begin key */
+#define KEY_CANCEL 0543 /* cancel key */
+#define KEY_CLOSE 0544 /* close key */
+#define KEY_COMMAND 0545 /* command key */
+#define KEY_COPY 0546 /* copy key */
+#define KEY_CREATE 0547 /* create key */
+#define KEY_END 0550 /* end key */
+#define KEY_EXIT 0551 /* exit key */
+#define KEY_FIND 0552 /* find key */
+#define KEY_HELP 0553 /* help key */
+#define KEY_MARK 0554 /* mark key */
+#define KEY_MESSAGE 0555 /* message key */
+#define KEY_MOVE 0556 /* move key */
+#define KEY_NEXT 0557 /* next key */
+#define KEY_OPEN 0560 /* open key */
+#define KEY_OPTIONS 0561 /* options key */
+#define KEY_PREVIOUS 0562 /* previous key */
+#define KEY_REDO 0563 /* redo key */
+#define KEY_REFERENCE 0564 /* reference key */
+#define KEY_REFRESH 0565 /* refresh key */
+#define KEY_REPLACE 0566 /* replace key */
+#define KEY_RESTART 0567 /* restart key */
+#define KEY_RESUME 0570 /* resume key */
+#define KEY_SAVE 0571 /* save key */
+#define KEY_SBEG 0572 /* shifted begin key */
+#define KEY_SCANCEL 0573 /* shifted cancel key */
+#define KEY_SCOMMAND 0574 /* shifted command key */
+#define KEY_SCOPY 0575 /* shifted copy key */
+#define KEY_SCREATE 0576 /* shifted create key */
+#define KEY_SDC 0577 /* shifted delete-character key */
+#define KEY_SDL 0600 /* shifted delete-line key */
+#define KEY_SELECT 0601 /* select key */
+#define KEY_SEND 0602 /* shifted end key */
+#define KEY_SEOL 0603 /* shifted clear-to-end-of-line key */
+#define KEY_SEXIT 0604 /* shifted exit key */
+#define KEY_SFIND 0605 /* shifted find key */
+#define KEY_SHELP 0606 /* shifted help key */
+#define KEY_SHOME 0607 /* shifted home key */
+#define KEY_SIC 0610 /* shifted insert-character key */
+#define KEY_SLEFT 0611 /* shifted left-arrow key */
+#define KEY_SMESSAGE 0612 /* shifted message key */
+#define KEY_SMOVE 0613 /* shifted move key */
+#define KEY_SNEXT 0614 /* shifted next key */
+#define KEY_SOPTIONS 0615 /* shifted options key */
+#define KEY_SPREVIOUS 0616 /* shifted previous key */
+#define KEY_SPRINT 0617 /* shifted print key */
+#define KEY_SREDO 0620 /* shifted redo key */
+#define KEY_SREPLACE 0621 /* shifted replace key */
+#define KEY_SRIGHT 0622 /* shifted right-arrow key */
+#define KEY_SRSUME 0623 /* shifted resume key */
+#define KEY_SSAVE 0624 /* shifted save key */
+#define KEY_SSUSPEND 0625 /* shifted suspend key */
+#define KEY_SUNDO 0626 /* shifted undo key */
+#define KEY_SUSPEND 0627 /* suspend key */
+#define KEY_UNDO 0630 /* undo key */
+#define KEY_MOUSE 0631 /* Mouse event has occurred */
+#define KEY_RESIZE 0632 /* Terminal resize event */
+
+#define KEY_MAX 0777 /* Maximum key value is 0632 */
+/* $Id$ */
+
+/* mouse interface */
+#define NCURSES_MOUSE_VERSION 1
+
+/* event masks */
+#define BUTTON1_RELEASED 000000000001L
+#define BUTTON1_PRESSED 000000000002L
+#define BUTTON1_CLICKED 000000000004L
+#define BUTTON1_DOUBLE_CLICKED 000000000010L
+#define BUTTON1_TRIPLE_CLICKED 000000000020L
+#define BUTTON1_RESERVED_EVENT 000000000040L
+#define BUTTON2_RELEASED 000000000100L
+#define BUTTON2_PRESSED 000000000200L
+#define BUTTON2_CLICKED 000000000400L
+#define BUTTON2_DOUBLE_CLICKED 000000001000L
+#define BUTTON2_TRIPLE_CLICKED 000000002000L
+#define BUTTON2_RESERVED_EVENT 000000004000L
+#define BUTTON3_RELEASED 000000010000L
+#define BUTTON3_PRESSED 000000020000L
+#define BUTTON3_CLICKED 000000040000L
+#define BUTTON3_DOUBLE_CLICKED 000000100000L
+#define BUTTON3_TRIPLE_CLICKED 000000200000L
+#define BUTTON3_RESERVED_EVENT 000000400000L
+#define BUTTON4_RELEASED 000001000000L
+#define BUTTON4_PRESSED 000002000000L
+#define BUTTON4_CLICKED 000004000000L
+#define BUTTON4_DOUBLE_CLICKED 000010000000L
+#define BUTTON4_TRIPLE_CLICKED 000020000000L
+#define BUTTON4_RESERVED_EVENT 000040000000L
+#define BUTTON_CTRL 000100000000L
+#define BUTTON_SHIFT 000200000000L
+#define BUTTON_ALT 000400000000L
+#define ALL_MOUSE_EVENTS 000777777777L
+#define REPORT_MOUSE_POSITION 001000000000L
+
+/* macros to extract single event-bits from masks */
+#define BUTTON_RELEASE(e, x) ((e) & (001 << (6 * ((x) - 1))))
+#define BUTTON_PRESS(e, x) ((e) & (002 << (6 * ((x) - 1))))
+#define BUTTON_CLICK(e, x) ((e) & (004 << (6 * ((x) - 1))))
+#define BUTTON_DOUBLE_CLICK(e, x) ((e) & (010 << (6 * ((x) - 1))))
+#define BUTTON_TRIPLE_CLICK(e, x) ((e) & (020 << (6 * ((x) - 1))))
+#define BUTTON_RESERVED_EVENT(e, x) ((e) & (040 << (6 * ((x) - 1))))
+
+typedef unsigned long mmask_t;
+
+typedef struct
+{
+ short id; /* ID to distinguish multiple devices */
+ int x, y, z; /* event coordinates (character-cell) */
+ mmask_t bstate; /* button state bits */
+}
+MEVENT;
+
+extern NCURSES_EXPORT(int) getmouse (MEVENT *);
+extern NCURSES_EXPORT(int) ungetmouse (MEVENT *);
+extern NCURSES_EXPORT(mmask_t) mousemask (mmask_t, mmask_t *);
+extern NCURSES_EXPORT(bool) wenclose (const WINDOW *, int, int);
+extern NCURSES_EXPORT(int) mouseinterval (int);
+extern NCURSES_EXPORT(bool) wmouse_trafo (const WINDOW* win,int* y, int* x, bool to_screen);
+extern NCURSES_EXPORT(bool) mouse_trafo (int*, int*, bool); /* generated */
+
+#define mouse_trafo(y,x,to_screen) wmouse_trafo(stdscr,y,x,to_screen)
+
+/* other non-XSI functions */
+
+extern NCURSES_EXPORT(int) mcprint (char *, int); /* direct data to printer */
+extern NCURSES_EXPORT(int) has_key (int); /* do we have given key? */
+
+/* Debugging : use with libncurses_g.a */
+
+extern NCURSES_EXPORT(void) _tracef (const char *, ...) GCC_PRINTFLIKE(1,2);
+extern NCURSES_EXPORT(void) _tracedump (const char *, WINDOW *);
+extern NCURSES_EXPORT(char *) _traceattr (attr_t);
+extern NCURSES_EXPORT(char *) _traceattr2 (int, chtype);
+extern NCURSES_EXPORT(char *) _nc_tracebits (void);
+extern NCURSES_EXPORT(char *) _tracechar (int);
+extern NCURSES_EXPORT(char *) _tracechtype (chtype);
+extern NCURSES_EXPORT(char *) _tracechtype2 (int, chtype);
+#ifdef _XOPEN_SOURCE_EXTENDED
+#define _tracech_t _tracecchar_t
+extern NCURSES_EXPORT(char *) _tracecchar_t (const cchar_t *);
+#define _tracech_t2 _tracecchar_t2
+extern NCURSES_EXPORT(char *) _tracecchar_t2 (int, const cchar_t *);
+#else
+#define _tracech_t _tracechtype
+#define _tracech_t2 _tracechtype2
+#endif
+extern NCURSES_EXPORT(char *) _tracemouse (const MEVENT *);
+extern NCURSES_EXPORT(void) trace (const unsigned int);
+
+/* trace masks */
+#define TRACE_DISABLE 0x0000 /* turn off tracing */
+#define TRACE_TIMES 0x0001 /* trace user and system times of updates */
+#define TRACE_TPUTS 0x0002 /* trace tputs calls */
+#define TRACE_UPDATE 0x0004 /* trace update actions, old & new screens */
+#define TRACE_MOVE 0x0008 /* trace cursor moves and scrolls */
+#define TRACE_CHARPUT 0x0010 /* trace all character outputs */
+#define TRACE_ORDINARY 0x001F /* trace all update actions */
+#define TRACE_CALLS 0x0020 /* trace all curses calls */
+#define TRACE_VIRTPUT 0x0040 /* trace virtual character puts */
+#define TRACE_IEVENT 0x0080 /* trace low-level input processing */
+#define TRACE_BITS 0x0100 /* trace state of TTY control bits */
+#define TRACE_ICALLS 0x0200 /* trace internal/nested calls */
+#define TRACE_CCALLS 0x0400 /* trace per-character calls */
+#define TRACE_DATABASE 0x0800 /* trace read/write of terminfo/termcap data */
+#define TRACE_ATTRS 0x1000 /* trace attribute updates */
+#define TRACE_MAXIMUM 0xffff /* maximum trace level */
+
+#if defined(TRACE) || defined(NCURSES_TEST)
+extern NCURSES_EXPORT_VAR(int) _nc_optimize_enable; /* enable optimizations */
+#ifdef _XOPEN_SOURCE_EXTENDED
+extern NCURSES_EXPORT(const char *) _nc_viswbuf(const wchar_t *);
+#endif
+extern NCURSES_EXPORT(const char *) _nc_visbuf (const char *);
+#define OPTIMIZE_MVCUR 0x01 /* cursor movement optimization */
+#define OPTIMIZE_HASHMAP 0x02 /* diff hashing to detect scrolls */
+#define OPTIMIZE_SCROLL 0x04 /* scroll optimization */
+#define OPTIMIZE_ALL 0xff /* enable all optimizations (dflt) */
+#endif
+
+#ifdef __cplusplus
+
+/* these names conflict with STL */
+#undef box
+#undef clear
+#undef erase
+#undef move
+#undef refresh
+
+}
+#endif
+
+#endif /* __NCURSES_H */
diff --git a/src/include/db.h b/src/include/db.h
new file mode 100644
index 0000000..a3975f0
--- /dev/null
+++ b/src/include/db.h
@@ -0,0 +1,219 @@
+/*-
+ * Copyright (c) 1990, 1993, 1994
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)db.h 8.7 (Berkeley) 6/16/94
+ * $FreeBSD: src/include/db.h,v 1.5 2002/03/26 01:35:05 bde Exp $
+ */
+
+#ifndef _DB_H_
+#define _DB_H_
+
+#include
+#include
+
+#include
+
+#define RET_ERROR -1 /* Return values. */
+#define RET_SUCCESS 0
+#define RET_SPECIAL 1
+
+#define MAX_PAGE_NUMBER 0xffffffff /* >= # of pages in a file */
+typedef u_int32_t pgno_t;
+#define MAX_PAGE_OFFSET 65535 /* >= # of bytes in a page */
+typedef u_int16_t indx_t;
+#define MAX_REC_NUMBER 0xffffffff /* >= # of records in a tree */
+typedef u_int32_t recno_t;
+
+/* Key/data structure -- a Data-Base Thang. */
+typedef struct {
+ void *data; /* data */
+ size_t size; /* data length */
+} DBT;
+
+/* Routine flags. */
+#define R_CURSOR 1 /* del, put, seq */
+#define __R_UNUSED 2 /* UNUSED */
+#define R_FIRST 3 /* seq */
+#define R_IAFTER 4 /* put (RECNO) */
+#define R_IBEFORE 5 /* put (RECNO) */
+#define R_LAST 6 /* seq (BTREE, RECNO) */
+#define R_NEXT 7 /* seq */
+#define R_NOOVERWRITE 8 /* put */
+#define R_PREV 9 /* seq (BTREE, RECNO) */
+#define R_SETCURSOR 10 /* put (RECNO) */
+#define R_RECNOSYNC 11 /* sync (RECNO) */
+
+typedef enum { DB_BTREE, DB_HASH, DB_RECNO } DBTYPE;
+
+/*
+ * !!!
+ * The following flags are included in the dbopen(3) call as part of the
+ * open(2) flags. In order to avoid conflicts with the open flags, start
+ * at the top of the 16 or 32-bit number space and work our way down. If
+ * the open flags were significantly expanded in the future, it could be
+ * a problem. Wish I'd left another flags word in the dbopen call.
+ *
+ * !!!
+ * None of this stuff is implemented yet. The only reason that it's here
+ * is so that the access methods can skip copying the key/data pair when
+ * the DB_LOCK flag isn't set.
+ */
+#if UINT_MAX > 65535
+#define DB_LOCK 0x20000000 /* Do locking. */
+#define DB_SHMEM 0x40000000 /* Use shared memory. */
+#define DB_TXN 0x80000000 /* Do transactions. */
+#else
+#define DB_LOCK 0x2000 /* Do locking. */
+#define DB_SHMEM 0x4000 /* Use shared memory. */
+#define DB_TXN 0x8000 /* Do transactions. */
+#endif
+
+/* Access method description structure. */
+typedef struct __db {
+ DBTYPE type; /* Underlying db type. */
+ int (*close)(struct __db *);
+ int (*del)(const struct __db *, const DBT *, u_int);
+ int (*get)(const struct __db *, const DBT *, DBT *, u_int);
+ int (*put)(const struct __db *, DBT *, const DBT *, u_int);
+ int (*seq)(const struct __db *, DBT *, DBT *, u_int);
+ int (*sync)(const struct __db *, u_int);
+ void *internal; /* Access method private. */
+ int (*fd)(const struct __db *);
+} DB;
+
+#define BTREEMAGIC 0x053162
+#define BTREEVERSION 3
+
+/* Structure used to pass parameters to the btree routines. */
+typedef struct {
+#define R_DUP 0x01 /* duplicate keys */
+ u_long flags;
+ u_int cachesize; /* bytes to cache */
+ int maxkeypage; /* maximum keys per page */
+ int minkeypage; /* minimum keys per page */
+ u_int psize; /* page size */
+ int (*compare) /* comparison function */
+ (const DBT *, const DBT *);
+ size_t (*prefix) /* prefix function */
+ (const DBT *, const DBT *);
+ int lorder; /* byte order */
+} BTREEINFO;
+
+#define HASHMAGIC 0x061561
+#define HASHVERSION 2
+
+/* Structure used to pass parameters to the hashing routines. */
+typedef struct {
+ u_int bsize; /* bucket size */
+ u_int ffactor; /* fill factor */
+ u_int nelem; /* number of elements */
+ u_int cachesize; /* bytes to cache */
+ u_int32_t /* hash function */
+ (*hash)(const void *, size_t);
+ int lorder; /* byte order */
+} HASHINFO;
+
+/* Structure used to pass parameters to the record routines. */
+typedef struct {
+#define R_FIXEDLEN 0x01 /* fixed-length records */
+#define R_NOKEY 0x02 /* key not required */
+#define R_SNAPSHOT 0x04 /* snapshot the input */
+ u_long flags;
+ u_int cachesize; /* bytes to cache */
+ u_int psize; /* page size */
+ int lorder; /* byte order */
+ size_t reclen; /* record length (fixed-length records) */
+ u_char bval; /* delimiting byte (variable-length records */
+ char *bfname; /* btree file name */
+} RECNOINFO;
+
+#ifdef __DBINTERFACE_PRIVATE
+/*
+ * Little endian <==> big endian 32-bit swap macros.
+ * M_32_SWAP swap a memory location
+ * P_32_SWAP swap a referenced memory location
+ * P_32_COPY swap from one location to another
+ */
+#define M_32_SWAP(a) { \
+ u_int32_t _tmp = a; \
+ ((char *)&a)[0] = ((char *)&_tmp)[3]; \
+ ((char *)&a)[1] = ((char *)&_tmp)[2]; \
+ ((char *)&a)[2] = ((char *)&_tmp)[1]; \
+ ((char *)&a)[3] = ((char *)&_tmp)[0]; \
+}
+#define P_32_SWAP(a) { \
+ u_int32_t _tmp = *(u_int32_t *)a; \
+ ((char *)a)[0] = ((char *)&_tmp)[3]; \
+ ((char *)a)[1] = ((char *)&_tmp)[2]; \
+ ((char *)a)[2] = ((char *)&_tmp)[1]; \
+ ((char *)a)[3] = ((char *)&_tmp)[0]; \
+}
+#define P_32_COPY(a, b) { \
+ ((char *)&(b))[0] = ((char *)&(a))[3]; \
+ ((char *)&(b))[1] = ((char *)&(a))[2]; \
+ ((char *)&(b))[2] = ((char *)&(a))[1]; \
+ ((char *)&(b))[3] = ((char *)&(a))[0]; \
+}
+
+/*
+ * Little endian <==> big endian 16-bit swap macros.
+ * M_16_SWAP swap a memory location
+ * P_16_SWAP swap a referenced memory location
+ * P_16_COPY swap from one location to another
+ */
+#define M_16_SWAP(a) { \
+ u_int16_t _tmp = a; \
+ ((char *)&a)[0] = ((char *)&_tmp)[1]; \
+ ((char *)&a)[1] = ((char *)&_tmp)[0]; \
+}
+#define P_16_SWAP(a) { \
+ u_int16_t _tmp = *(u_int16_t *)a; \
+ ((char *)a)[0] = ((char *)&_tmp)[1]; \
+ ((char *)a)[1] = ((char *)&_tmp)[0]; \
+}
+#define P_16_COPY(a, b) { \
+ ((char *)&(b))[0] = ((char *)&(a))[1]; \
+ ((char *)&(b))[1] = ((char *)&(a))[0]; \
+}
+#endif
+
+__BEGIN_DECLS
+DB *dbopen(const char *, int, int, DBTYPE, const void *);
+
+#ifdef __DBINTERFACE_PRIVATE
+DB *__bt_open(const char *, int, int, const BTREEINFO *, int);
+DB *__hash_open(const char *, int, int, const HASHINFO *, int);
+DB *__rec_open(const char *, int, int, const RECNOINFO *, int);
+void __dbpanic(DB *dbp);
+#endif
+__END_DECLS
+#endif /* !_DB_H_ */
diff --git a/src/include/devinfo.h b/src/include/devinfo.h
new file mode 100644
index 0000000..06339fe
--- /dev/null
+++ b/src/include/devinfo.h
@@ -0,0 +1,138 @@
+/*-
+ * Copyright (c) 2000 Michael Smith
+ * Copyright (c) 2000 BSDi
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: src/lib/libdevinfo/devinfo.h,v 1.4 2002/09/20 02:16:33 imp Exp $
+ */
+
+#include
+#include
+
+typedef __uintptr_t devinfo_handle_t;
+#define DEVINFO_ROOT_DEVICE ((devinfo_handle_t)0)
+
+/*
+ * State of the device.
+ */
+/* XXX not sure if I want a copy here, or expose sys/bus.h */
+typedef enum devinfo_state {
+ DIS_NOTPRESENT, /* not probed or probe failed */
+ DIS_ALIVE, /* probe succeeded */
+ DIS_ATTACHED, /* attach method called */
+ DIS_BUSY /* device is open */
+} devinfo_state_t;
+
+struct devinfo_dev {
+ devinfo_handle_t dd_handle; /* device handle */
+ devinfo_handle_t dd_parent; /* parent handle */
+
+ char *dd_name; /* name of device */
+ char *dd_desc; /* device description */
+ char *dd_drivername; /* name of attached driver*/
+ char *dd_pnpinfo; /* pnp info from parent bus */
+ char *dd_location; /* Where bus thinks dev at */
+ uint32_t dd_devflags; /* API flags */
+ uint16_t dd_flags; /* internal dev flags */
+ devinfo_state_t dd_state; /* attacement state of dev */
+};
+
+struct devinfo_rman {
+ devinfo_handle_t dm_handle; /* resource manager handle */
+
+ unsigned long dm_start; /* resource start */
+ unsigned long dm_size; /* resource size */
+
+ char *dm_desc; /* resource description */
+};
+
+struct devinfo_res {
+ devinfo_handle_t dr_handle; /* resource handle */
+ devinfo_handle_t dr_rman; /* resource manager handle */
+ devinfo_handle_t dr_device; /* owning device */
+
+ unsigned long dr_start; /* region start */
+ unsigned long dr_size; /* region size */
+ /* XXX add flags */
+};
+
+/*
+ * Acquire a coherent copy of the kernel's device and resource tables.
+ * This must return success (zero) before any other interfaces will
+ * function. Sets errno on failure.
+ */
+extern int devinfo_init(void);
+
+/*
+ * Release the storage associated with the internal copy of the device
+ * and resource tables. devinfo_init must be called before any attempt
+ * is made to use any other interfaces.
+ */
+extern void devinfo_free(void);
+
+/*
+ * Find a device/resource/resource manager by its handle.
+ */
+extern struct devinfo_dev
+ *devinfo_handle_to_device(devinfo_handle_t handle);
+extern struct devinfo_res
+ *devinfo_handle_to_resource(devinfo_handle_t handle);
+extern struct devinfo_rman
+ *devinfo_handle_to_rman(devinfo_handle_t handle);
+
+/*
+ * Iterate over the children of a device, calling (fn) on each. If
+ * (fn) returns nonzero, abort the scan and return.
+ */
+extern int
+ devinfo_foreach_device_child(struct devinfo_dev *parent,
+ int (* fn)(struct devinfo_dev *child, void *arg),
+ void *arg);
+
+/*
+ * Iterate over all the resources owned by a device, calling (fn) on each.
+ * If (fn) returns nonzero, abort the scan and return.
+ */
+extern int
+ devinfo_foreach_device_resource(struct devinfo_dev *dev,
+ int (* fn)(struct devinfo_dev *dev,
+ struct devinfo_res *res, void *arg),
+ void *arg);
+
+/*
+ * Iterate over all the resources owned by a resource manager, calling (fn)
+ * on each. If (fn) returns nonzero, abort the scan and return.
+ */
+extern int
+ devinfo_foreach_rman_resource(struct devinfo_rman *rman,
+ int (* fn)(struct devinfo_res *res, void *arg),
+ void *arg);
+
+/*
+ * Iterate over all the resource managers, calling (fn) on each. If (fn)
+ * returns nonzero, abort the scan and return.
+ */
+extern int
+ devinfo_foreach_rman(int (* fn)(struct devinfo_rman *rman, void *arg),
+ void *arg);
diff --git a/src/include/devstat.h b/src/include/devstat.h
new file mode 100644
index 0000000..5d3ae8e
--- /dev/null
+++ b/src/include/devstat.h
@@ -0,0 +1,168 @@
+/*
+ * Copyright (c) 1997, 1998 Kenneth D. Merry.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: src/lib/libdevstat/devstat.h,v 1.10 2003/03/18 17:05:27 phk Exp $
+ */
+
+#ifndef _DEVSTAT_H
+#define _DEVSTAT_H
+#include
+#include
+
+#include
+
+/*
+ * Bumped every time we change the userland API. Hopefully this doesn't
+ * happen very often! This should be bumped every time we have to
+ * increment SHLIB_MAJOR in the libdevstat Makefile (for non-backwards
+ * compatible API changes) and should also be bumped every time we make
+ * backwards-compatible API changes, so application writers have a way to
+ * determine when a particular feature is available.
+ */
+#define DEVSTAT_USER_API_VER 5
+
+#define DEVSTAT_ERRBUF_SIZE 2048 /* size of the devstat library error string */
+
+extern char devstat_errbuf[];
+
+typedef enum {
+ DEVSTAT_MATCH_NONE = 0x00,
+ DEVSTAT_MATCH_TYPE = 0x01,
+ DEVSTAT_MATCH_IF = 0x02,
+ DEVSTAT_MATCH_PASS = 0x04
+} devstat_match_flags;
+
+typedef enum {
+ DSM_NONE,
+ DSM_TOTAL_BYTES,
+ DSM_TOTAL_BYTES_READ,
+ DSM_TOTAL_BYTES_WRITE,
+ DSM_TOTAL_TRANSFERS,
+ DSM_TOTAL_TRANSFERS_READ,
+ DSM_TOTAL_TRANSFERS_WRITE,
+ DSM_TOTAL_TRANSFERS_OTHER,
+ DSM_TOTAL_BLOCKS,
+ DSM_TOTAL_BLOCKS_READ,
+ DSM_TOTAL_BLOCKS_WRITE,
+ DSM_KB_PER_TRANSFER,
+ DSM_KB_PER_TRANSFER_READ,
+ DSM_KB_PER_TRANSFER_WRITE,
+ DSM_TRANSFERS_PER_SECOND,
+ DSM_TRANSFERS_PER_SECOND_READ,
+ DSM_TRANSFERS_PER_SECOND_WRITE,
+ DSM_TRANSFERS_PER_SECOND_OTHER,
+ DSM_MB_PER_SECOND,
+ DSM_MB_PER_SECOND_READ,
+ DSM_MB_PER_SECOND_WRITE,
+ DSM_BLOCKS_PER_SECOND,
+ DSM_BLOCKS_PER_SECOND_READ,
+ DSM_BLOCKS_PER_SECOND_WRITE,
+ DSM_MS_PER_TRANSACTION,
+ DSM_MS_PER_TRANSACTION_READ,
+ DSM_MS_PER_TRANSACTION_WRITE,
+ DSM_SKIP,
+ DSM_TOTAL_BYTES_FREE,
+ DSM_TOTAL_TRANSFERS_FREE,
+ DSM_TOTAL_BLOCKS_FREE,
+ DSM_KB_PER_TRANSFER_FREE,
+ DSM_MB_PER_SECOND_FREE,
+ DSM_TRANSFERS_PER_SECOND_FREE,
+ DSM_BLOCKS_PER_SECOND_FREE,
+ DSM_MS_PER_TRANSACTION_OTHER,
+ DSM_MS_PER_TRANSACTION_FREE,
+ DSM_BUSY_PCT,
+ DSM_QUEUE_LENGTH,
+ DSM_MAX
+} devstat_metric;
+
+struct devstat_match {
+ devstat_match_flags match_fields;
+ devstat_type_flags device_type;
+ int num_match_categories;
+};
+
+struct devstat_match_table {
+ const char * match_str;
+ devstat_type_flags type;
+ devstat_match_flags match_field;
+};
+
+struct device_selection {
+ u_int32_t device_number;
+ char device_name[DEVSTAT_NAME_LEN];
+ int unit_number;
+ int selected;
+ u_int64_t bytes;
+ int position;
+};
+
+struct devinfo {
+ struct devstat *devices;
+ u_int8_t *mem_ptr;
+ long generation;
+ int numdevs;
+};
+
+struct statinfo {
+ long cp_time[CPUSTATES];
+ long tk_nin;
+ long tk_nout;
+ struct devinfo *dinfo;
+ long double snap_time;
+};
+
+typedef enum {
+ DS_SELECT_ADD,
+ DS_SELECT_ONLY,
+ DS_SELECT_REMOVE,
+ DS_SELECT_ADDONLY
+} devstat_select_mode;
+
+__BEGIN_DECLS
+
+int devstat_getnumdevs(kvm_t *kd);
+long devstat_getgeneration(kvm_t *kd);
+int devstat_getversion(kvm_t *kd);
+int devstat_checkversion(kvm_t *kd);
+int devstat_getdevs(kvm_t *kd, struct statinfo *stats);
+int devstat_selectdevs(struct device_selection **dev_select, int *num_selected,
+ int *num_selections, long *select_generation,
+ long current_generation, struct devstat *devices,
+ int numdevs, struct devstat_match *matches,
+ int num_matches, char **dev_selections,
+ int num_dev_selections, devstat_select_mode select_mode,
+ int maxshowdevs, int perf_select);
+int devstat_buildmatch(char *match_str, struct devstat_match **matches,
+ int *num_matches);
+int devstat_compute_statistics(struct devstat *current,
+ struct devstat *previous,
+ long double etime, ...);
+long double devstat_compute_etime(struct bintime *cur_time,
+ struct bintime *prev_time);
+__END_DECLS
+
+#endif /* _DEVSTAT_H */
diff --git a/src/include/dialog.h b/src/include/dialog.h
new file mode 100644
index 0000000..2153431
--- /dev/null
+++ b/src/include/dialog.h
@@ -0,0 +1,211 @@
+#ifndef _DIALOG_H_INCLUDE
+#define _DIALOG_H_INCLUDE
+
+/*
+ * dialog.h -- common declarations for all dialog modules
+ *
+ * AUTHOR: Savio Lam (lam836@cs.cuhk.hk)
+ *
+ * Substantial rennovation: 12/18/95, Jordan K. Hubbard
+ *
+ * This program 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 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $FreeBSD: src/gnu/lib/libdialog/dialog.h,v 1.22 2000/12/14 02:35:22 jkh Exp $
+ *
+ */
+
+#define HAVE_NCURSES
+
+#ifdef HAVE_NCURSES
+#include
+
+#else
+
+#ifdef ultrix
+#include
+#else
+#include
+#endif
+
+#endif
+
+/* special return codes for `fire' actions */
+#define DITEM_STATUS(flag) ((flag) & 0x0000FFFF)
+#define DITEM_SUCCESS 0
+#define DITEM_FAILURE 1
+
+/* Flags - returned in upper 16 bits of return status */
+#define DITEM_LEAVE_MENU (1 << 16)
+#define DITEM_REDRAW (1 << 17)
+#define DITEM_RECREATE (1 << 18)
+#define DITEM_RESTORE (1 << 19)
+#define DITEM_CONTINUE (1 << 20)
+
+/* Attributes as used by entry fields right now */
+#define DITEM_NO_ECHO 0x0001
+
+
+/* negative offsets for buttons in item lists, if specified */
+#define OK_BUTTON -2
+#define CANCEL_BUTTON -1
+
+/* for use in describing more exotic behaviors */
+typedef struct _dmenu_item {
+ char *prompt;
+ char *title;
+ int (*checked)(struct _dmenu_item *self);
+ int (*fire)(struct _dmenu_item *self);
+ void (*selected)(struct _dmenu_item *self, int is_selected);
+ void *data;
+ char lbra, mark, rbra;
+ long aux;
+} dialogMenuItem;
+
+#define VERSION "0.4"
+#define MAX_LEN 2048
+
+#ifndef TRUE
+#define TRUE (1)
+#endif
+#ifndef FALSE
+#define FALSE (0)
+#endif
+
+extern int DialogX, DialogY, DialogInputAttrs;
+
+/*
+ * Attribute names
+ */
+#define screen_attr attributes[0]
+#define shadow_attr attributes[1]
+#define dialog_attr attributes[2]
+#define title_attr attributes[3]
+#define border_attr attributes[4]
+#define button_active_attr attributes[5]
+#define button_inactive_attr attributes[6]
+#define button_key_active_attr attributes[7]
+#define button_key_inactive_attr attributes[8]
+#define button_label_active_attr attributes[9]
+#define button_label_inactive_attr attributes[10]
+#define inputbox_attr attributes[11]
+#define inputbox_border_attr attributes[12]
+#define searchbox_attr attributes[13]
+#define searchbox_title_attr attributes[14]
+#define searchbox_border_attr attributes[15]
+#define position_indicator_attr attributes[16]
+#define menubox_attr attributes[17]
+#define menubox_border_attr attributes[18]
+#define item_attr attributes[19]
+#define item_selected_attr attributes[20]
+#define tag_attr attributes[21]
+#define tag_selected_attr attributes[22]
+#define tag_key_attr attributes[23]
+#define tag_key_selected_attr attributes[24]
+#define check_attr attributes[25]
+#define check_selected_attr attributes[26]
+#define uarrow_attr attributes[27]
+#define darrow_attr attributes[28]
+
+/* number of attributes */
+#define ATTRIBUTE_COUNT 29
+
+extern chtype attributes[];
+
+#ifdef HAVE_NCURSES
+extern bool use_shadow;
+void draw_shadow(WINDOW *win, int y, int x, int height, int width);
+#endif
+void draw_box(WINDOW *win, int y, int x, int height, int width, chtype box, chtype border);
+int line_edit(WINDOW *dialog, int box_y, int box_x, int flen, int box_width, chtype attrs, int first, unsigned char *result, int attr_mask);
+int strheight(const char *p);
+int strwidth(const char *p);
+
+void dialog_create_rc(unsigned char *filename);
+int dialog_yesno(unsigned char *title, unsigned char *prompt, int height, int width);
+int dialog_noyes(unsigned char *title, unsigned char *prompt, int height, int width);
+int dialog_prgbox(unsigned char *title, const unsigned char *line, int height, int width, int pause, int use_shell);
+int dialog_msgbox(unsigned char *title, unsigned char *prompt, int height, int width, int pause);
+int dialog_textbox(unsigned char *title, unsigned char *file, int height, int width);
+int dialog_menu(unsigned char *title, unsigned char *prompt, int height, int width, int menu_height,
+ int item_no, void *itptr, unsigned char *result, int *ch, int *sc);
+int dialog_checklist(unsigned char *title, unsigned char *prompt, int height, int width, int list_height,
+ int item_no, void *itptr, unsigned char *result);
+int dialog_radiolist(unsigned char *title, unsigned char *prompt, int height, int width, int list_height,
+ int item_no, void *itptr, unsigned char *result);
+int dialog_inputbox(unsigned char *title, unsigned char *prompt, int height, int width, unsigned char *result);
+void dialog_clear_norefresh(void);
+void dialog_clear(void);
+void dialog_update(void);
+void init_dialog(void);
+void end_dialog(void);
+
+/* Additions to libdialog */
+char *dialog_fselect(char *dir, char *fmask);
+int dialog_dselect(char *dir, char *fmask);
+void dialog_notify(char *msg);
+int dialog_mesgbox(unsigned char *title, unsigned char *prompt, int height, int width);
+void use_helpfile(char *helpfile);
+void use_helpline(char *helpline);
+char *get_helpline(void);
+void restore_helpline(char *helpline);
+void dialog_gauge(char *title, char *prompt, int y, int x, int height, int width, int perc);
+
+/*
+ * Display a tree menu from file
+ *
+ * filename - file with like find(1) output
+ * FS - fields separator
+ * title - title of dialog box
+ * prompt - prompt text into dialog box
+ * height - height of dialog box
+ * width - width of dialog box
+ * menu_height - height of menu box
+ * result - pointer to char array
+ *
+ * return values:
+ * -1 - ESC pressed
+ * 0 - Ok, result set (must be freed later)
+ * 1 - Cancel
+ */
+int dialog_ftree(unsigned char *filename, unsigned char FS,
+ unsigned char *title, unsigned char *prompt,
+ int height, int width, int menu_height,
+ unsigned char **result);
+
+/*
+ * Display a tree menu from array
+ *
+ * names - array with like find(1) output
+ * size - size of array
+ * FS - fields separator
+ * title - title of dialog box
+ * prompt - prompt text into dialog box
+ * height - height of dialog box
+ * width - width of dialog box
+ * menu_height - height of menu box
+ * result - pointer to char array
+ *
+ * return values:
+ * -1 - ESC pressed
+ * 0 - Ok, result set
+ * 1 - Cancel
+ */
+
+int dialog_tree(unsigned char **names, int size, unsigned char FS,
+ unsigned char *title, unsigned char *prompt,
+ int height, int width, int menu_height,
+ unsigned char **result);
+
+#endif /* _DIALOG_H_INCLUDE */
diff --git a/src/include/dirent.h b/src/include/dirent.h
new file mode 100644
index 0000000..1d0e1e0
--- /dev/null
+++ b/src/include/dirent.h
@@ -0,0 +1,121 @@
+/*-
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)dirent.h 8.2 (Berkeley) 7/28/94
+ * $FreeBSD: src/include/dirent.h,v 1.14 2003/12/07 21:10:06 marcel Exp $
+ */
+
+#ifndef _DIRENT_H_
+#define _DIRENT_H_
+
+/*
+ * The kernel defines the format of directory entries returned by
+ * the getdirentries(2) system call.
+ */
+#include
+#include
+
+#if __BSD_VISIBLE || __XSI_VISIBLE
+/*
+ * XXX this is probably illegal in the __XSI_VISIBLE case, but brings us closer
+ * to the specification.
+ */
+#define d_ino d_fileno /* backward and XSI compatibility */
+#endif
+
+#if __BSD_VISIBLE
+
+#include
+
+/* definitions for library routines operating on directories. */
+#define DIRBLKSIZ 1024
+
+struct _telldir; /* see telldir.h */
+
+/* structure describing an open directory. */
+typedef struct _dirdesc {
+ int dd_fd; /* file descriptor associated with directory */
+ long dd_loc; /* offset in current buffer */
+ long dd_size; /* amount of data returned by getdirentries */
+ char *dd_buf; /* data buffer */
+ int dd_len; /* size of data buffer */
+ long dd_seek; /* magic cookie returned by getdirentries */
+ long dd_rewind; /* magic cookie for rewinding */
+ int dd_flags; /* flags for readdir */
+ void *dd_lock; /* hack to avoid including */
+ struct _telldir *dd_td; /* telldir position recording */
+} DIR;
+
+#define dirfd(dirp) ((dirp)->dd_fd)
+
+/* flags for opendir2 */
+#define DTF_HIDEW 0x0001 /* hide whiteout entries */
+#define DTF_NODUP 0x0002 /* don't return duplicate names */
+#define DTF_REWIND 0x0004 /* rewind after reading union stack */
+#define __DTF_READALL 0x0008 /* everything has been read */
+
+#else /* !__BSD_VISIBLE */
+
+typedef void * DIR;
+
+#endif /* __BSD_VISIBLE */
+
+#ifndef _KERNEL
+
+__BEGIN_DECLS
+#if __BSD_VISIBLE
+DIR *__opendir2(const char *, int);
+int alphasort(const void *, const void *);
+int getdents(int, char *, int);
+int getdirentries(int, char *, int, long *);
+#endif
+DIR *opendir(const char *);
+struct dirent *
+ readdir(DIR *);
+#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 500
+int readdir_r(DIR *, struct dirent *, struct dirent **);
+#endif
+void rewinddir(DIR *);
+#if __BSD_VISIBLE
+int scandir(const char *, struct dirent ***,
+ int (*)(struct dirent *), int (*)(const void *, const void *));
+#endif
+#if __XSI_VISIBLE
+void seekdir(DIR *, long);
+long telldir(DIR *);
+#endif
+int closedir(DIR *);
+__END_DECLS
+
+#endif /* !_KERNEL */
+
+#endif /* !_DIRENT_H_ */
diff --git a/src/include/dlfcn.h b/src/include/dlfcn.h
new file mode 100644
index 0000000..581ffcf
--- /dev/null
+++ b/src/include/dlfcn.h
@@ -0,0 +1,137 @@
+/*-
+ * Copyright (c) 1994
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: src/include/dlfcn.h,v 1.19 2003/02/13 17:47:43 kan Exp $
+ */
+
+#ifndef _DLFCN_H_
+#define _DLFCN_H_
+
+#include
+
+/*
+ * Modes and flags for dlopen().
+ */
+#define RTLD_LAZY 1 /* Bind function calls lazily. */
+#define RTLD_NOW 2 /* Bind function calls immediately. */
+#define RTLD_MODEMASK 0x3
+#define RTLD_GLOBAL 0x100 /* Make symbols globally available. */
+#define RTLD_LOCAL 0 /* Opposite of RTLD_GLOBAL, and the default. */
+#define RTLD_TRACE 0x200 /* Trace loaded objects and exit. */
+
+/*
+ * Request arguments for dlinfo().
+ */
+#define RTLD_DI_LINKMAP 2 /* Obtain link map. */
+#define RTLD_DI_SERINFO 4 /* Obtain search path info. */
+#define RTLD_DI_SERINFOSIZE 5 /* ... query for required space. */
+#define RTLD_DI_ORIGIN 6 /* Obtain object origin */
+#define RTLD_DI_MAX RTLD_DI_ORIGIN
+
+/*
+ * Special handle arguments for dlsym()/dlinfo().
+ */
+#define RTLD_NEXT ((void *) -1) /* Search subsequent objects. */
+#define RTLD_DEFAULT ((void *) -2) /* Use default search algorithm. */
+#define RTLD_SELF ((void *) -3) /* Search the caller itself. */
+
+#if __BSD_VISIBLE
+
+#ifndef _SIZE_T_DECLARED
+typedef __size_t size_t;
+#define _SIZE_T_DECLARED
+#endif
+
+/*
+ * Structure filled in by dladdr().
+ */
+typedef struct dl_info {
+ const char *dli_fname; /* Pathname of shared object. */
+ void *dli_fbase; /* Base address of shared object. */
+ const char *dli_sname; /* Name of nearest symbol. */
+ void *dli_saddr; /* Address of nearest symbol. */
+} Dl_info;
+
+/*-
+ * The actual type declared by this typedef is immaterial, provided that
+ * it is a function pointer. Its purpose is to provide a return type for
+ * dlfunc() which can be cast to a function pointer type without depending
+ * on behavior undefined by the C standard, which might trigger a compiler
+ * diagnostic. We intentionally declare a unique type signature to force
+ * a diagnostic should the application not cast the return value of dlfunc()
+ * appropriately.
+ */
+struct __dlfunc_arg {
+ int __dlfunc_dummy;
+};
+
+typedef void (*dlfunc_t)(struct __dlfunc_arg);
+
+/*
+ * Structures, returned by the RTLD_DI_SERINFO dlinfo() request.
+ */
+typedef struct dl_serpath {
+ char * dls_name; /* single search path entry */
+ unsigned int dls_flags; /* path information */
+} Dl_serpath;
+
+typedef struct dl_serinfo {
+ size_t dls_size; /* total buffer size */
+ unsigned int dls_cnt; /* number of path entries */
+ Dl_serpath dls_serpath[1]; /* there may be more than one */
+} Dl_serinfo;
+
+#endif /* __BSD_VISIBLE */
+
+__BEGIN_DECLS
+/* XSI functions first. */
+int dlclose(void *);
+const char *
+ dlerror(void);
+void *dlopen(const char *, int);
+void *dlsym(void * __restrict, const char * __restrict);
+
+#if __BSD_VISIBLE
+int dladdr(const void * __restrict, Dl_info * __restrict);
+dlfunc_t dlfunc(void * __restrict, const char * __restrict);
+int dlinfo(void * __restrict, int, void * __restrict);
+void dllockinit(void *_context,
+ void *(*_lock_create)(void *_context),
+ void (*_rlock_acquire)(void *_lock),
+ void (*_wlock_acquire)(void *_lock),
+ void (*_lock_release)(void *_lock),
+ void (*_lock_destroy)(void *_lock),
+ void (*_context_destroy)(void *_context));
+#endif /* __BSD_VISIBLE */
+__END_DECLS
+
+#endif /* !_DLFCN_H_ */
diff --git a/src/include/elf-hints.h b/src/include/elf-hints.h
new file mode 100644
index 0000000..d572a4f
--- /dev/null
+++ b/src/include/elf-hints.h
@@ -0,0 +1,50 @@
+/*-
+ * Copyright (c) 1997 John D. Polstra.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: src/include/elf-hints.h,v 1.4 2001/05/02 23:56:17 obrien Exp $
+ */
+
+#ifndef _ELF_HINTS_H_
+#define _ELF_HINTS_H_
+
+/*
+ * Hints file produced by ldconfig.
+ */
+struct elfhints_hdr {
+ u_int32_t magic; /* Magic number */
+ u_int32_t version; /* File version (1) */
+ u_int32_t strtab; /* Offset of string table in file */
+ u_int32_t strsize; /* Size of string table */
+ u_int32_t dirlist; /* Offset of directory list in
+ string table */
+ u_int32_t dirlistlen; /* strlen(dirlist) */
+ u_int32_t spare[26]; /* Room for expansion */
+};
+
+#define ELFHINTS_MAGIC 0x746e6845
+
+#define _PATH_ELF_HINTS "/var/run/ld-elf.so.hints"
+
+#endif /* !_ELF_HINTS_H_ */
diff --git a/src/include/elf.h b/src/include/elf.h
new file mode 100644
index 0000000..b673187
--- /dev/null
+++ b/src/include/elf.h
@@ -0,0 +1,41 @@
+/*-
+ * Copyright (c) 2001 David E. O'Brien.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: src/include/elf.h,v 1.8 2002/07/04 11:05:39 markm Exp $
+ */
+
+/*
+ * This is a Solaris compatibility header
+ */
+
+#ifndef _ELF_H_
+#define _ELF_H_
+
+#include
+#include
+#include
+#include
+
+#endif /* !_ELF_H_ */
diff --git a/src/include/emmintrin.h b/src/include/emmintrin.h
new file mode 100644
index 0000000..7007fc5
--- /dev/null
+++ b/src/include/emmintrin.h
@@ -0,0 +1,1499 @@
+/* Copyright (C) 2003 Free Software Foundation, Inc.
+
+ This file is part of GNU CC.
+
+ GNU CC 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 2, or (at your option)
+ any later version.
+
+ GNU CC 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 GNU CC; see the file COPYING. If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* As a special exception, if you include this header file into source
+ files compiled by GCC, this header file does not by itself cause
+ the resulting executable to be covered by the GNU General Public
+ License. This exception does not however invalidate any other
+ reasons why the executable file might be covered by the GNU General
+ Public License. */
+
+/* Implemented from the specification included in the Intel C++ Compiler
+ User Guide and Reference, version 8.0. */
+
+#ifndef _EMMINTRIN_H_INCLUDED
+#define _EMMINTRIN_H_INCLUDED
+
+#ifdef __SSE2__
+#include
+
+/* SSE2 */
+typedef int __v2df __attribute__ ((mode (V2DF)));
+typedef int __v2di __attribute__ ((mode (V2DI)));
+typedef int __v4si __attribute__ ((mode (V4SI)));
+typedef int __v8hi __attribute__ ((mode (V8HI)));
+typedef int __v16qi __attribute__ ((mode (V16QI)));
+
+/* Create a selector for use with the SHUFPD instruction. */
+#define _MM_SHUFFLE2(fp1,fp0) \
+ (((fp1) << 1) | (fp0))
+
+#define __m128i __v2di
+#define __m128d __v2df
+
+/* Create a vector with element 0 as *P and the rest zero. */
+static __inline __m128d
+_mm_load_sd (double const *__P)
+{
+ return (__m128d) __builtin_ia32_loadsd (__P);
+}
+
+/* Create a vector with all two elements equal to *P. */
+static __inline __m128d
+_mm_load1_pd (double const *__P)
+{
+ __v2df __tmp = __builtin_ia32_loadsd (__P);
+ return (__m128d) __builtin_ia32_shufpd (__tmp, __tmp, _MM_SHUFFLE2 (0,0));
+}
+
+static __inline __m128d
+_mm_load_pd1 (double const *__P)
+{
+ return _mm_load1_pd (__P);
+}
+
+/* Load two DPFP values from P. The address must be 16-byte aligned. */
+static __inline __m128d
+_mm_load_pd (double const *__P)
+{
+ return (__m128d) __builtin_ia32_loadapd (__P);
+}
+
+/* Load two DPFP values from P. The address need not be 16-byte aligned. */
+static __inline __m128d
+_mm_loadu_pd (double const *__P)
+{
+ return (__m128d) __builtin_ia32_loadupd (__P);
+}
+
+/* Load two DPFP values in reverse order. The address must be aligned. */
+static __inline __m128d
+_mm_loadr_pd (double const *__P)
+{
+ __v2df __tmp = __builtin_ia32_loadapd (__P);
+ return (__m128d) __builtin_ia32_shufpd (__tmp, __tmp, _MM_SHUFFLE2 (0,1));
+}
+
+/* Create a vector with element 0 as F and the rest zero. */
+static __inline __m128d
+_mm_set_sd (double __F)
+{
+ return (__m128d) __builtin_ia32_loadsd (&__F);
+}
+
+/* Create a vector with all two elements equal to F. */
+static __inline __m128d
+_mm_set1_pd (double __F)
+{
+ __v2df __tmp = __builtin_ia32_loadsd (&__F);
+ return (__m128d) __builtin_ia32_shufpd (__tmp, __tmp, _MM_SHUFFLE2 (0,0));
+}
+
+static __inline __m128d
+_mm_set_pd1 (double __F)
+{
+ return _mm_set1_pd (__F);
+}
+
+/* Create the vector [Z Y]. */
+static __inline __m128d
+_mm_set_pd (double __Z, double __Y)
+{
+ union {
+ double __a[2];
+ __m128d __v;
+ } __u;
+
+ __u.__a[0] = __Y;
+ __u.__a[1] = __Z;
+
+ return __u.__v;
+}
+
+/* Create the vector [Y Z]. */
+static __inline __m128d
+_mm_setr_pd (double __Z, double __Y)
+{
+ return _mm_set_pd (__Y, __Z);
+}
+
+/* Create a vector of zeros. */
+static __inline __m128d
+_mm_setzero_pd (void)
+{
+ return (__m128d) __builtin_ia32_setzeropd ();
+}
+
+/* Stores the lower DPFP value. */
+static __inline void
+_mm_store_sd (double *__P, __m128d __A)
+{
+ __builtin_ia32_storesd (__P, (__v2df)__A);
+}
+
+/* Store the lower DPFP value acrosd two words. */
+static __inline void
+_mm_store1_pd (double *__P, __m128d __A)
+{
+ __v2df __va = (__v2df)__A;
+ __v2df __tmp = __builtin_ia32_shufpd (__va, __va, _MM_SHUFFLE2 (0,0));
+ __builtin_ia32_storeapd (__P, __tmp);
+}
+
+static __inline void
+_mm_store_pd1 (double *__P, __m128d __A)
+{
+ _mm_store1_pd (__P, __A);
+}
+
+/* Store two DPFP values. The address must be 16-byte aligned. */
+static __inline void
+_mm_store_pd (double *__P, __m128d __A)
+{
+ __builtin_ia32_storeapd (__P, (__v2df)__A);
+}
+
+/* Store two DPFP values. The address need not be 16-byte aligned. */
+static __inline void
+_mm_storeu_pd (double *__P, __m128d __A)
+{
+ __builtin_ia32_storeupd (__P, (__v2df)__A);
+}
+
+/* Store two DPFP values in reverse order. The address must be aligned. */
+static __inline void
+_mm_storer_pd (double *__P, __m128d __A)
+{
+ __v2df __va = (__v2df)__A;
+ __v2df __tmp = __builtin_ia32_shufpd (__va, __va, _MM_SHUFFLE2 (0,1));
+ __builtin_ia32_storeapd (__P, __tmp);
+}
+
+/* Sets the low DPFP value of A from the low value of B. */
+static __inline __m128d
+_mm_move_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_movsd ((__v2df)__A, (__v2df)__B);
+}
+
+
+static __inline __m128d
+_mm_add_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_addpd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_add_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_addsd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_sub_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_subpd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_sub_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_subsd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_mul_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_mulpd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_mul_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_mulsd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_div_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_divpd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_div_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_divsd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_sqrt_pd (__m128d __A)
+{
+ return (__m128d)__builtin_ia32_sqrtpd ((__v2df)__A);
+}
+
+/* Return pair {sqrt (A[0), B[1]}. */
+static __inline __m128d
+_mm_sqrt_sd (__m128d __A, __m128d __B)
+{
+ __v2df __tmp = __builtin_ia32_movsd ((__v2df)__A, (__v2df)__B);
+ return (__m128d)__builtin_ia32_sqrtsd ((__v2df)__tmp);
+}
+
+static __inline __m128d
+_mm_min_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_minpd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_min_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_minsd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_max_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_maxpd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_max_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_maxsd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_and_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_andpd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_andnot_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_andnpd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_or_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_orpd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_xor_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_xorpd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_cmpeq_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpeqpd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_cmplt_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpltpd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_cmple_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmplepd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_cmpgt_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpgtpd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_cmpge_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpgepd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_cmpneq_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpneqpd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_cmpnlt_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpnltpd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_cmpnle_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpnlepd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_cmpngt_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpngtpd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_cmpnge_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpngepd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_cmpord_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpordpd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_cmpunord_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpunordpd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_cmpeq_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpeqsd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_cmplt_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpltsd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_cmple_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmplesd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_cmpgt_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_movsd ((__v2df) __A,
+ (__v2df)
+ __builtin_ia32_cmpltsd ((__v2df) __B,
+ (__v2df)
+ __A));
+}
+
+static __inline __m128d
+_mm_cmpge_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_movsd ((__v2df) __A,
+ (__v2df)
+ __builtin_ia32_cmplesd ((__v2df) __B,
+ (__v2df)
+ __A));
+}
+
+static __inline __m128d
+_mm_cmpneq_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpneqsd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_cmpnlt_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpnltsd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_cmpnle_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpnlesd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_cmpngt_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_movsd ((__v2df) __A,
+ (__v2df)
+ __builtin_ia32_cmpnltsd ((__v2df) __B,
+ (__v2df)
+ __A));
+}
+
+static __inline __m128d
+_mm_cmpnge_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d) __builtin_ia32_movsd ((__v2df) __A,
+ (__v2df)
+ __builtin_ia32_cmpnlesd ((__v2df) __B,
+ (__v2df)
+ __A));
+}
+
+static __inline __m128d
+_mm_cmpord_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpordsd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_cmpunord_sd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_cmpunordsd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline int
+_mm_comieq_sd (__m128d __A, __m128d __B)
+{
+ return __builtin_ia32_comisdeq ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline int
+_mm_comilt_sd (__m128d __A, __m128d __B)
+{
+ return __builtin_ia32_comisdlt ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline int
+_mm_comile_sd (__m128d __A, __m128d __B)
+{
+ return __builtin_ia32_comisdle ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline int
+_mm_comigt_sd (__m128d __A, __m128d __B)
+{
+ return __builtin_ia32_comisdgt ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline int
+_mm_comige_sd (__m128d __A, __m128d __B)
+{
+ return __builtin_ia32_comisdge ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline int
+_mm_comineq_sd (__m128d __A, __m128d __B)
+{
+ return __builtin_ia32_comisdneq ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline int
+_mm_ucomieq_sd (__m128d __A, __m128d __B)
+{
+ return __builtin_ia32_ucomisdeq ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline int
+_mm_ucomilt_sd (__m128d __A, __m128d __B)
+{
+ return __builtin_ia32_ucomisdlt ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline int
+_mm_ucomile_sd (__m128d __A, __m128d __B)
+{
+ return __builtin_ia32_ucomisdle ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline int
+_mm_ucomigt_sd (__m128d __A, __m128d __B)
+{
+ return __builtin_ia32_ucomisdgt ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline int
+_mm_ucomige_sd (__m128d __A, __m128d __B)
+{
+ return __builtin_ia32_ucomisdge ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline int
+_mm_ucomineq_sd (__m128d __A, __m128d __B)
+{
+ return __builtin_ia32_ucomisdneq ((__v2df)__A, (__v2df)__B);
+}
+
+/* Create a vector with element 0 as *P and the rest zero. */
+
+static __inline __m128i
+_mm_load_si128 (__m128i const *__P)
+{
+ return (__m128i) __builtin_ia32_loaddqa ((char const *)__P);
+}
+
+static __inline __m128i
+_mm_loadu_si128 (__m128i const *__P)
+{
+ return (__m128i) __builtin_ia32_loaddqu ((char const *)__P);
+}
+
+static __inline __m128i
+_mm_loadl_epi64 (__m128i const *__P)
+{
+ return (__m128i) __builtin_ia32_movq2dq (*(unsigned long long *)__P);
+}
+
+static __inline void
+_mm_store_si128 (__m128i *__P, __m128i __B)
+{
+ __builtin_ia32_storedqa ((char *)__P, (__v16qi)__B);
+}
+
+static __inline void
+_mm_storeu_si128 (__m128i *__P, __m128i __B)
+{
+ __builtin_ia32_storedqu ((char *)__P, (__v16qi)__B);
+}
+
+static __inline void
+_mm_storel_epi64 (__m128i *__P, __m128i __B)
+{
+ *(long long *)__P = __builtin_ia32_movdq2q ((__v2di)__B);
+}
+
+static __inline __m64
+_mm_movepi64_pi64 (__m128i __B)
+{
+ return (__m64) __builtin_ia32_movdq2q ((__v2di)__B);
+}
+
+static __inline __m128i
+_mm_move_epi64 (__m128i __A)
+{
+ return (__m128i) __builtin_ia32_movq ((__v2di)__A);
+}
+
+/* Create a vector of zeros. */
+static __inline __m128i
+_mm_setzero_si128 (void)
+{
+ return (__m128i) __builtin_ia32_setzero128 ();
+}
+
+static __inline __m128i
+_mm_set_epi64 (__m64 __A, __m64 __B)
+{
+ __v2di __tmp = (__v2di)__builtin_ia32_movq2dq ((unsigned long long)__A);
+ __v2di __tmp2 = (__v2di)__builtin_ia32_movq2dq ((unsigned long long)__B);
+ return (__m128i)__builtin_ia32_punpcklqdq128 (__tmp2, __tmp);
+}
+
+/* Create the vector [Z Y X W]. */
+static __inline __m128i
+_mm_set_epi32 (int __Z, int __Y, int __X, int __W)
+{
+ union {
+ int __a[4];
+ __m128i __v;
+ } __u;
+
+ __u.__a[0] = __W;
+ __u.__a[1] = __X;
+ __u.__a[2] = __Y;
+ __u.__a[3] = __Z;
+
+ return __u.__v;
+}
+
+#ifdef __x86_64__
+/* Create the vector [Z Y]. */
+static __inline __m128i
+_mm_set_epi64x (long long __Z, long long __Y)
+{
+ union {
+ long __a[2];
+ __m128i __v;
+ } __u;
+
+ __u.__a[0] = __Y;
+ __u.__a[1] = __Z;
+
+ return __u.__v;
+}
+#endif
+
+/* Create the vector [S T U V Z Y X W]. */
+static __inline __m128i
+_mm_set_epi16 (short __Z, short __Y, short __X, short __W,
+ short __V, short __U, short __T, short __S)
+{
+ union {
+ short __a[8];
+ __m128i __v;
+ } __u;
+
+ __u.__a[0] = __S;
+ __u.__a[1] = __T;
+ __u.__a[2] = __U;
+ __u.__a[3] = __V;
+ __u.__a[4] = __W;
+ __u.__a[5] = __X;
+ __u.__a[6] = __Y;
+ __u.__a[7] = __Z;
+
+ return __u.__v;
+}
+
+/* Create the vector [S T U V Z Y X W]. */
+static __inline __m128i
+_mm_set_epi8 (char __Z, char __Y, char __X, char __W,
+ char __V, char __U, char __T, char __S,
+ char __Z1, char __Y1, char __X1, char __W1,
+ char __V1, char __U1, char __T1, char __S1)
+{
+ union {
+ char __a[16];
+ __m128i __v;
+ } __u;
+
+ __u.__a[0] = __S1;
+ __u.__a[1] = __T1;
+ __u.__a[2] = __U1;
+ __u.__a[3] = __V1;
+ __u.__a[4] = __W1;
+ __u.__a[5] = __X1;
+ __u.__a[6] = __Y1;
+ __u.__a[7] = __Z1;
+ __u.__a[8] = __S;
+ __u.__a[9] = __T;
+ __u.__a[10] = __U;
+ __u.__a[11] = __V;
+ __u.__a[12] = __W;
+ __u.__a[13] = __X;
+ __u.__a[14] = __Y;
+ __u.__a[15] = __Z;
+
+ return __u.__v;
+}
+
+static __inline __m128i
+_mm_set1_epi64 (__m64 __A)
+{
+ __v2di __tmp = (__v2di)__builtin_ia32_movq2dq ((unsigned long long)__A);
+ return (__m128i)__builtin_ia32_punpcklqdq128 (__tmp, __tmp);
+}
+
+static __inline __m128i
+_mm_set1_epi32 (int __A)
+{
+ __v4si __tmp = (__v4si)__builtin_ia32_loadd (&__A);
+ return (__m128i) __builtin_ia32_pshufd ((__v4si)__tmp, _MM_SHUFFLE (0,0,0,0));
+}
+
+#ifdef __x86_64__
+static __inline __m128i
+_mm_set1_epi64x (long long __A)
+{
+ __v2di __tmp = (__v2di)__builtin_ia32_movq2dq ((unsigned long long)__A);
+ return (__m128i) __builtin_ia32_shufpd ((__v2df)__tmp, (__v2df)__tmp, _MM_SHUFFLE2 (0,0));
+}
+#endif
+
+static __inline __m128i
+_mm_set1_epi16 (short __A)
+{
+ int __Acopy = (unsigned short)__A;
+ __v4si __tmp = (__v4si)__builtin_ia32_loadd (&__Acopy);
+ __tmp = (__v4si)__builtin_ia32_punpcklwd128 ((__v8hi)__tmp, (__v8hi)__tmp);
+ return (__m128i) __builtin_ia32_pshufd ((__v4si)__tmp, _MM_SHUFFLE (0,0,0,0));
+}
+
+static __inline __m128i
+_mm_set1_epi8 (char __A)
+{
+ int __Acopy = (unsigned char)__A;
+ __v4si __tmp = (__v4si)__builtin_ia32_loadd (&__Acopy);
+ __tmp = (__v4si)__builtin_ia32_punpcklbw128 ((__v16qi)__tmp, (__v16qi)__tmp);
+ __tmp = (__v4si)__builtin_ia32_punpcklbw128 ((__v16qi)__tmp, (__v16qi)__tmp);
+ return (__m128i) __builtin_ia32_pshufd ((__v4si)__tmp, _MM_SHUFFLE (0,0,0,0));
+}
+
+static __inline __m128i
+_mm_setr_epi64 (__m64 __A, __m64 __B)
+{
+ __v2di __tmp = (__v2di)__builtin_ia32_movq2dq ((unsigned long long)__A);
+ __v2di __tmp2 = (__v2di)__builtin_ia32_movq2dq ((unsigned long long)__B);
+ return (__m128i)__builtin_ia32_punpcklqdq128 (__tmp, __tmp2);
+}
+
+/* Create the vector [Z Y X W]. */
+static __inline __m128i
+_mm_setr_epi32 (int __W, int __X, int __Y, int __Z)
+{
+ union {
+ int __a[4];
+ __m128i __v;
+ } __u;
+
+ __u.__a[0] = __W;
+ __u.__a[1] = __X;
+ __u.__a[2] = __Y;
+ __u.__a[3] = __Z;
+
+ return __u.__v;
+}
+/* Create the vector [S T U V Z Y X W]. */
+static __inline __m128i
+_mm_setr_epi16 (short __S, short __T, short __U, short __V,
+ short __W, short __X, short __Y, short __Z)
+{
+ union {
+ short __a[8];
+ __m128i __v;
+ } __u;
+
+ __u.__a[0] = __S;
+ __u.__a[1] = __T;
+ __u.__a[2] = __U;
+ __u.__a[3] = __V;
+ __u.__a[4] = __W;
+ __u.__a[5] = __X;
+ __u.__a[6] = __Y;
+ __u.__a[7] = __Z;
+
+ return __u.__v;
+}
+
+/* Create the vector [S T U V Z Y X W]. */
+static __inline __m128i
+_mm_setr_epi8 (char __S1, char __T1, char __U1, char __V1,
+ char __W1, char __X1, char __Y1, char __Z1,
+ char __S, char __T, char __U, char __V,
+ char __W, char __X, char __Y, char __Z)
+{
+ union {
+ char __a[16];
+ __m128i __v;
+ } __u;
+
+ __u.__a[0] = __S1;
+ __u.__a[1] = __T1;
+ __u.__a[2] = __U1;
+ __u.__a[3] = __V1;
+ __u.__a[4] = __W1;
+ __u.__a[5] = __X1;
+ __u.__a[6] = __Y1;
+ __u.__a[7] = __Z1;
+ __u.__a[8] = __S;
+ __u.__a[9] = __T;
+ __u.__a[10] = __U;
+ __u.__a[11] = __V;
+ __u.__a[12] = __W;
+ __u.__a[13] = __X;
+ __u.__a[14] = __Y;
+ __u.__a[15] = __Z;
+
+ return __u.__v;
+}
+
+static __inline __m128d
+_mm_cvtepi32_pd (__m128i __A)
+{
+ return (__m128d)__builtin_ia32_cvtdq2pd ((__v4si) __A);
+}
+
+static __inline __m128
+_mm_cvtepi32_ps (__m128i __A)
+{
+ return (__m128)__builtin_ia32_cvtdq2ps ((__v4si) __A);
+}
+
+static __inline __m128i
+_mm_cvtpd_epi32 (__m128d __A)
+{
+ return (__m128i)__builtin_ia32_cvtpd2dq ((__v2df) __A);
+}
+
+static __inline __m64
+_mm_cvtpd_pi32 (__m128d __A)
+{
+ return (__m64)__builtin_ia32_cvtpd2pi ((__v2df) __A);
+}
+
+static __inline __m128
+_mm_cvtpd_ps (__m128d __A)
+{
+ return (__m128)__builtin_ia32_cvtpd2ps ((__v2df) __A);
+}
+
+static __inline __m128i
+_mm_cvttpd_epi32 (__m128d __A)
+{
+ return (__m128i)__builtin_ia32_cvttpd2dq ((__v2df) __A);
+}
+
+static __inline __m64
+_mm_cvttpd_pi32 (__m128d __A)
+{
+ return (__m64)__builtin_ia32_cvttpd2pi ((__v2df) __A);
+}
+
+static __inline __m128d
+_mm_cvtpi32_pd (__m64 __A)
+{
+ return (__m128d)__builtin_ia32_cvtpi2pd ((__v2si) __A);
+}
+
+static __inline __m128i
+_mm_cvtps_epi32 (__m128 __A)
+{
+ return (__m128i)__builtin_ia32_cvtps2dq ((__v4sf) __A);
+}
+
+static __inline __m128i
+_mm_cvttps_epi32 (__m128 __A)
+{
+ return (__m128i)__builtin_ia32_cvttps2dq ((__v4sf) __A);
+}
+
+static __inline __m128d
+_mm_cvtps_pd (__m128 __A)
+{
+ return (__m128d)__builtin_ia32_cvtps2pd ((__v4sf) __A);
+}
+
+static __inline int
+_mm_cvtsd_si32 (__m128d __A)
+{
+ return __builtin_ia32_cvtsd2si ((__v2df) __A);
+}
+
+#ifdef __x86_64__
+static __inline long long
+_mm_cvtsd_si64x (__m128d __A)
+{
+ return __builtin_ia32_cvtsd2si64 ((__v2df) __A);
+}
+#endif
+
+static __inline int
+_mm_cvttsd_si32 (__m128d __A)
+{
+ return __builtin_ia32_cvttsd2si ((__v2df) __A);
+}
+
+#ifdef __x86_64__
+static __inline long long
+_mm_cvttsd_si64x (__m128d __A)
+{
+ return __builtin_ia32_cvttsd2si64 ((__v2df) __A);
+}
+#endif
+
+static __inline __m128
+_mm_cvtsd_ss (__m128 __A, __m128d __B)
+{
+ return (__m128)__builtin_ia32_cvtsd2ss ((__v4sf) __A, (__v2df) __B);
+}
+
+static __inline __m128d
+_mm_cvtsi32_sd (__m128d __A, int __B)
+{
+ return (__m128d)__builtin_ia32_cvtsi2sd ((__v2df) __A, __B);
+}
+
+#ifdef __x86_64__
+static __inline __m128d
+_mm_cvtsi64x_sd (__m128d __A, long long __B)
+{
+ return (__m128d)__builtin_ia32_cvtsi642sd ((__v2df) __A, __B);
+}
+#endif
+
+static __inline __m128d
+_mm_cvtss_sd (__m128d __A, __m128 __B)
+{
+ return (__m128d)__builtin_ia32_cvtss2sd ((__v2df) __A, (__v4sf)__B);
+}
+
+#define _mm_shuffle_pd(__A, __B, __C) ((__m128d)__builtin_ia32_shufpd ((__v2df)__A, (__v2df)__B, (__C)))
+
+static __inline __m128d
+_mm_unpackhi_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_unpckhpd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_unpacklo_pd (__m128d __A, __m128d __B)
+{
+ return (__m128d)__builtin_ia32_unpcklpd ((__v2df)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_loadh_pd (__m128d __A, double const *__B)
+{
+ return (__m128d)__builtin_ia32_loadhpd ((__v2df)__A, (__v2si *)__B);
+}
+
+static __inline void
+_mm_storeh_pd (double *__A, __m128d __B)
+{
+ __builtin_ia32_storehpd ((__v2si *)__A, (__v2df)__B);
+}
+
+static __inline __m128d
+_mm_loadl_pd (__m128d __A, double const *__B)
+{
+ return (__m128d)__builtin_ia32_loadlpd ((__v2df)__A, (__v2si *)__B);
+}
+
+static __inline void
+_mm_storel_pd (double *__A, __m128d __B)
+{
+ __builtin_ia32_storelpd ((__v2si *)__A, (__v2df)__B);
+}
+
+static __inline int
+_mm_movemask_pd (__m128d __A)
+{
+ return __builtin_ia32_movmskpd ((__v2df)__A);
+}
+
+static __inline __m128i
+_mm_packs_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_packsswb128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+static __inline __m128i
+_mm_packs_epi32 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_packssdw128 ((__v4si)__A, (__v4si)__B);
+}
+
+static __inline __m128i
+_mm_packus_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_packuswb128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+static __inline __m128i
+_mm_unpackhi_epi8 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_punpckhbw128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+static __inline __m128i
+_mm_unpackhi_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_punpckhwd128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+static __inline __m128i
+_mm_unpackhi_epi32 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_punpckhdq128 ((__v4si)__A, (__v4si)__B);
+}
+
+static __inline __m128i
+_mm_unpackhi_epi64 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_punpckhqdq128 ((__v2di)__A, (__v2di)__B);
+}
+
+static __inline __m128i
+_mm_unpacklo_epi8 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_punpcklbw128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+static __inline __m128i
+_mm_unpacklo_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_punpcklwd128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+static __inline __m128i
+_mm_unpacklo_epi32 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_punpckldq128 ((__v4si)__A, (__v4si)__B);
+}
+
+static __inline __m128i
+_mm_unpacklo_epi64 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_punpcklqdq128 ((__v2di)__A, (__v2di)__B);
+}
+
+static __inline __m128i
+_mm_add_epi8 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_paddb128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+static __inline __m128i
+_mm_add_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_paddw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+static __inline __m128i
+_mm_add_epi32 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_paddd128 ((__v4si)__A, (__v4si)__B);
+}
+
+static __inline __m128i
+_mm_add_epi64 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_paddq128 ((__v2di)__A, (__v2di)__B);
+}
+
+static __inline __m128i
+_mm_adds_epi8 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_paddsb128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+static __inline __m128i
+_mm_adds_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_paddsw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+static __inline __m128i
+_mm_adds_epu8 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_paddusb128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+static __inline __m128i
+_mm_adds_epu16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_paddusw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+static __inline __m128i
+_mm_sub_epi8 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_psubb128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+static __inline __m128i
+_mm_sub_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_psubw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+static __inline __m128i
+_mm_sub_epi32 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_psubd128 ((__v4si)__A, (__v4si)__B);
+}
+
+static __inline __m128i
+_mm_sub_epi64 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_psubq128 ((__v2di)__A, (__v2di)__B);
+}
+
+static __inline __m128i
+_mm_subs_epi8 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_psubsb128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+static __inline __m128i
+_mm_subs_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_psubsw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+static __inline __m128i
+_mm_subs_epu8 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_psubusb128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+static __inline __m128i
+_mm_subs_epu16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_psubusw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+static __inline __m128i
+_mm_madd_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pmaddwd128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+static __inline __m128i
+_mm_mulhi_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pmulhw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+static __inline __m128i
+_mm_mullo_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pmullw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+static __inline __m64
+_mm_mul_su32 (__m64 __A, __m64 __B)
+{
+ return (__m64)__builtin_ia32_pmuludq ((__v2si)__A, (__v2si)__B);
+}
+
+static __inline __m128i
+_mm_mul_epu32 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pmuludq128 ((__v4si)__A, (__v4si)__B);
+}
+
+static __inline __m128i
+_mm_sll_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_psllw128 ((__v8hi)__A, (__v2di)__B);
+}
+
+static __inline __m128i
+_mm_sll_epi32 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pslld128 ((__v4si)__A, (__v2di)__B);
+}
+
+static __inline __m128i
+_mm_sll_epi64 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_psllq128 ((__v2di)__A, (__v2di)__B);
+}
+
+static __inline __m128i
+_mm_sra_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_psraw128 ((__v8hi)__A, (__v2di)__B);
+}
+
+static __inline __m128i
+_mm_sra_epi32 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_psrad128 ((__v4si)__A, (__v2di)__B);
+}
+
+static __inline __m128i
+_mm_srl_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_psrlw128 ((__v8hi)__A, (__v2di)__B);
+}
+
+static __inline __m128i
+_mm_srl_epi32 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_psrld128 ((__v4si)__A, (__v2di)__B);
+}
+
+static __inline __m128i
+_mm_srl_epi64 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_psrlq128 ((__v2di)__A, (__v2di)__B);
+}
+
+static __inline __m128i
+_mm_slli_epi16 (__m128i __A, int __B)
+{
+ return (__m128i)__builtin_ia32_psllwi128 ((__v8hi)__A, __B);
+}
+
+static __inline __m128i
+_mm_slli_epi32 (__m128i __A, int __B)
+{
+ return (__m128i)__builtin_ia32_pslldi128 ((__v4si)__A, __B);
+}
+
+static __inline __m128i
+_mm_slli_epi64 (__m128i __A, int __B)
+{
+ return (__m128i)__builtin_ia32_psllqi128 ((__v2di)__A, __B);
+}
+
+static __inline __m128i
+_mm_srai_epi16 (__m128i __A, int __B)
+{
+ return (__m128i)__builtin_ia32_psrawi128 ((__v8hi)__A, __B);
+}
+
+static __inline __m128i
+_mm_srai_epi32 (__m128i __A, int __B)
+{
+ return (__m128i)__builtin_ia32_psradi128 ((__v4si)__A, __B);
+}
+
+#if 0
+static __m128i __attribute__((__always_inline__))
+_mm_srli_si128 (__m128i __A, const int __B)
+{
+ return ((__m128i)__builtin_ia32_psrldqi128 (__A, __B))
+}
+
+static __m128i __attribute__((__always_inline__))
+_mm_srli_si128 (__m128i __A, const int __B)
+{
+ return ((__m128i)__builtin_ia32_pslldqi128 (__A, __B))
+}
+#endif
+#define _mm_srli_si128(__A, __B) ((__m128i)__builtin_ia32_psrldqi128 (__A, __B))
+#define _mm_slli_si128(__A, __B) ((__m128i)__builtin_ia32_pslldqi128 (__A, __B))
+
+static __inline __m128i
+_mm_srli_epi16 (__m128i __A, int __B)
+{
+ return (__m128i)__builtin_ia32_psrlwi128 ((__v8hi)__A, __B);
+}
+
+static __inline __m128i
+_mm_srli_epi32 (__m128i __A, int __B)
+{
+ return (__m128i)__builtin_ia32_psrldi128 ((__v4si)__A, __B);
+}
+
+static __inline __m128i
+_mm_srli_epi64 (__m128i __A, int __B)
+{
+ return (__m128i)__builtin_ia32_psrlqi128 ((__v2di)__A, __B);
+}
+
+static __inline __m128i
+_mm_and_si128 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pand128 ((__v2di)__A, (__v2di)__B);
+}
+
+static __inline __m128i
+_mm_andnot_si128 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pandn128 ((__v2di)__A, (__v2di)__B);
+}
+
+static __inline __m128i
+_mm_or_si128 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_por128 ((__v2di)__A, (__v2di)__B);
+}
+
+static __inline __m128i
+_mm_xor_si128 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pxor128 ((__v2di)__A, (__v2di)__B);
+}
+
+static __inline __m128i
+_mm_cmpeq_epi8 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pcmpeqb128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+static __inline __m128i
+_mm_cmpeq_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pcmpeqw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+static __inline __m128i
+_mm_cmpeq_epi32 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pcmpeqd128 ((__v4si)__A, (__v4si)__B);
+}
+
+static __inline __m128i
+_mm_cmplt_epi8 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pcmpgtb128 ((__v16qi)__B, (__v16qi)__A);
+}
+
+static __inline __m128i
+_mm_cmplt_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pcmpgtw128 ((__v8hi)__B, (__v8hi)__A);
+}
+
+static __inline __m128i
+_mm_cmplt_epi32 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pcmpgtd128 ((__v4si)__B, (__v4si)__A);
+}
+
+static __inline __m128i
+_mm_cmpgt_epi8 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pcmpgtb128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+static __inline __m128i
+_mm_cmpgt_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pcmpgtw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+static __inline __m128i
+_mm_cmpgt_epi32 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pcmpgtd128 ((__v4si)__A, (__v4si)__B);
+}
+
+#define _mm_extract_epi16(__A, __B) __builtin_ia32_pextrw128 ((__v8hi)__A, __B)
+
+#define _mm_insert_epi16(__A, __B, __C) ((__m128i)__builtin_ia32_pinsrw128 ((__v8hi)__A, __B, __C))
+
+static __inline __m128i
+_mm_max_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pmaxsw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+static __inline __m128i
+_mm_max_epu8 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pmaxub128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+static __inline __m128i
+_mm_min_epi16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pminsw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+static __inline __m128i
+_mm_min_epu8 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pminub128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+static __inline int
+_mm_movemask_epi8 (__m128i __A)
+{
+ return __builtin_ia32_pmovmskb128 ((__v16qi)__A);
+}
+
+static __inline __m128i
+_mm_mulhi_epu16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pmulhuw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+#define _mm_shufflehi_epi16(__A, __B) ((__m128i)__builtin_ia32_pshufhw ((__v8hi)__A, __B))
+#define _mm_shufflelo_epi16(__A, __B) ((__m128i)__builtin_ia32_pshuflw ((__v8hi)__A, __B))
+#define _mm_shuffle_epi32(__A, __B) ((__m128i)__builtin_ia32_pshufd ((__v4si)__A, __B))
+
+static __inline void
+_mm_maskmoveu_si128 (__m128i __A, __m128i __B, char *__C)
+{
+ __builtin_ia32_maskmovdqu ((__v16qi)__A, (__v16qi)__B, __C);
+}
+
+static __inline __m128i
+_mm_avg_epu8 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pavgb128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+static __inline __m128i
+_mm_avg_epu16 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_pavgw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+static __inline __m128i
+_mm_sad_epu8 (__m128i __A, __m128i __B)
+{
+ return (__m128i)__builtin_ia32_psadbw128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+static __inline void
+_mm_stream_si32 (int *__A, int __B)
+{
+ __builtin_ia32_movnti (__A, __B);
+}
+
+static __inline void
+_mm_stream_si128 (__m128i *__A, __m128i __B)
+{
+ __builtin_ia32_movntdq ((__v2di *)__A, (__v2di)__B);
+}
+
+static __inline void
+_mm_stream_pd (double *__A, __m128d __B)
+{
+ __builtin_ia32_movntpd (__A, (__v2df)__B);
+}
+
+static __inline __m128i
+_mm_movpi64_epi64 (__m64 __A)
+{
+ return (__m128i)__builtin_ia32_movq2dq ((unsigned long long)__A);
+}
+
+static __inline void
+_mm_clflush (void const *__A)
+{
+ return __builtin_ia32_clflush (__A);
+}
+
+static __inline void
+_mm_lfence (void)
+{
+ __builtin_ia32_lfence ();
+}
+
+static __inline void
+_mm_mfence (void)
+{
+ __builtin_ia32_mfence ();
+}
+
+static __inline __m128i
+_mm_cvtsi32_si128 (int __A)
+{
+ return (__m128i) __builtin_ia32_loadd (&__A);
+}
+
+#ifdef __x86_64__
+static __inline __m128i
+_mm_cvtsi64x_si128 (long long __A)
+{
+ return (__m128i) __builtin_ia32_movq2dq (__A);
+}
+#endif
+
+static __inline int
+_mm_cvtsi128_si32 (__m128i __A)
+{
+ int __tmp;
+ __builtin_ia32_stored (&__tmp, (__v4si)__A);
+ return __tmp;
+}
+
+#ifdef __x86_64__
+static __inline long long
+_mm_cvtsi128_si64x (__m128i __A)
+{
+ return __builtin_ia32_movdq2q ((__v2di)__A);
+}
+#endif
+
+#endif /* __SSE2__ */
+
+#endif /* _EMMINTRIN_H_INCLUDED */
diff --git a/src/include/err.h b/src/include/err.h
new file mode 100644
index 0000000..a3c04cf
--- /dev/null
+++ b/src/include/err.h
@@ -0,0 +1,68 @@
+/*-
+ * Copyright (c) 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)err.h 8.1 (Berkeley) 6/2/93
+ * $FreeBSD: src/include/err.h,v 1.11 2002/08/21 16:19:55 mike Exp $
+ */
+
+#ifndef _ERR_H_
+#define _ERR_H_
+
+/*
+ * Don't use va_list in the err/warn prototypes. Va_list is typedef'd in two
+ * places ( and ), so if we include one
+ * of them here we may collide with the utility's includes. It's unreasonable
+ * for utilities to have to include one of them to include err.h, so we get
+ * __va_list from and use it.
+ */
+#include
+#include
+
+__BEGIN_DECLS
+void err(int, const char *, ...) __dead2 __printf0like(2, 3);
+void verr(int, const char *, __va_list) __dead2 __printf0like(2, 0);
+void errc(int, int, const char *, ...) __dead2 __printf0like(3, 4);
+void verrc(int, int, const char *, __va_list) __dead2
+ __printf0like(3, 0);
+void errx(int, const char *, ...) __dead2 __printf0like(2, 3);
+void verrx(int, const char *, __va_list) __dead2 __printf0like(2, 0);
+void warn(const char *, ...) __printf0like(1, 2);
+void vwarn(const char *, __va_list) __printf0like(1, 0);
+void warnc(int, const char *, ...) __printf0like(2, 3);
+void vwarnc(int, const char *, __va_list) __printf0like(2, 0);
+void warnx(const char *, ...) __printflike(1, 2);
+void vwarnx(const char *, __va_list) __printflike(1, 0);
+void err_set_file(void *);
+void err_set_exit(void (*)(int));
+__END_DECLS
+
+#endif /* !_ERR_H_ */
diff --git a/src/include/errno.h b/src/include/errno.h
new file mode 100644
index 0000000..d775e98
--- /dev/null
+++ b/src/include/errno.h
@@ -0,0 +1,182 @@
+/*
+ * Copyright (c) 1982, 1986, 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)errno.h 8.5 (Berkeley) 1/21/94
+ * $FreeBSD: src/sys/sys/errno.h,v 1.26 2004/04/07 04:19:49 imp Exp $
+ */
+
+#ifndef _SYS_ERRNO_H_
+#define _SYS_ERRNO_H_
+
+#ifndef _KERNEL
+#include
+__BEGIN_DECLS
+int * __error(void);
+__END_DECLS
+#define errno (* __error())
+#endif
+
+#define EPERM 1 /* Operation not permitted */
+#define ENOENT 2 /* No such file or directory */
+#define ESRCH 3 /* No such process */
+#define EINTR 4 /* Interrupted system call */
+#define EIO 5 /* Input/output error */
+#define ENXIO 6 /* Device not configured */
+#define E2BIG 7 /* Argument list too long */
+#define ENOEXEC 8 /* Exec format error */
+#define EBADF 9 /* Bad file descriptor */
+#define ECHILD 10 /* No child processes */
+#define EDEADLK 11 /* Resource deadlock avoided */
+ /* 11 was EAGAIN */
+#define ENOMEM 12 /* Cannot allocate memory */
+#define EACCES 13 /* Permission denied */
+#define EFAULT 14 /* Bad address */
+#ifndef _POSIX_SOURCE
+#define ENOTBLK 15 /* Block device required */
+#endif
+#define EBUSY 16 /* Device busy */
+#define EEXIST 17 /* File exists */
+#define EXDEV 18 /* Cross-device link */
+#define ENODEV 19 /* Operation not supported by device */
+#define ENOTDIR 20 /* Not a directory */
+#define EISDIR 21 /* Is a directory */
+#define EINVAL 22 /* Invalid argument */
+#define ENFILE 23 /* Too many open files in system */
+#define EMFILE 24 /* Too many open files */
+#define ENOTTY 25 /* Inappropriate ioctl for device */
+#ifndef _POSIX_SOURCE
+#define ETXTBSY 26 /* Text file busy */
+#endif
+#define EFBIG 27 /* File too large */
+#define ENOSPC 28 /* No space left on device */
+#define ESPIPE 29 /* Illegal seek */
+#define EROFS 30 /* Read-only filesystem */
+#define EMLINK 31 /* Too many links */
+#define EPIPE 32 /* Broken pipe */
+
+/* math software */
+#define EDOM 33 /* Numerical argument out of domain */
+#define ERANGE 34 /* Result too large */
+
+/* non-blocking and interrupt i/o */
+#define EAGAIN 35 /* Resource temporarily unavailable */
+#ifndef _POSIX_SOURCE
+#define EWOULDBLOCK EAGAIN /* Operation would block */
+#define EINPROGRESS 36 /* Operation now in progress */
+#define EALREADY 37 /* Operation already in progress */
+
+/* ipc/network software -- argument errors */
+#define ENOTSOCK 38 /* Socket operation on non-socket */
+#define EDESTADDRREQ 39 /* Destination address required */
+#define EMSGSIZE 40 /* Message too long */
+#define EPROTOTYPE 41 /* Protocol wrong type for socket */
+#define ENOPROTOOPT 42 /* Protocol not available */
+#define EPROTONOSUPPORT 43 /* Protocol not supported */
+#define ESOCKTNOSUPPORT 44 /* Socket type not supported */
+#define EOPNOTSUPP 45 /* Operation not supported */
+#define ENOTSUP EOPNOTSUPP /* Operation not supported */
+#define EPFNOSUPPORT 46 /* Protocol family not supported */
+#define EAFNOSUPPORT 47 /* Address family not supported by protocol family */
+#define EADDRINUSE 48 /* Address already in use */
+#define EADDRNOTAVAIL 49 /* Can't assign requested address */
+
+/* ipc/network software -- operational errors */
+#define ENETDOWN 50 /* Network is down */
+#define ENETUNREACH 51 /* Network is unreachable */
+#define ENETRESET 52 /* Network dropped connection on reset */
+#define ECONNABORTED 53 /* Software caused connection abort */
+#define ECONNRESET 54 /* Connection reset by peer */
+#define ENOBUFS 55 /* No buffer space available */
+#define EISCONN 56 /* Socket is already connected */
+#define ENOTCONN 57 /* Socket is not connected */
+#define ESHUTDOWN 58 /* Can't send after socket shutdown */
+#define ETOOMANYREFS 59 /* Too many references: can't splice */
+#define ETIMEDOUT 60 /* Operation timed out */
+#define ECONNREFUSED 61 /* Connection refused */
+
+#define ELOOP 62 /* Too many levels of symbolic links */
+#endif /* _POSIX_SOURCE */
+#define ENAMETOOLONG 63 /* File name too long */
+
+/* should be rearranged */
+#ifndef _POSIX_SOURCE
+#define EHOSTDOWN 64 /* Host is down */
+#define EHOSTUNREACH 65 /* No route to host */
+#endif /* _POSIX_SOURCE */
+#define ENOTEMPTY 66 /* Directory not empty */
+
+/* quotas & mush */
+#ifndef _POSIX_SOURCE
+#define EPROCLIM 67 /* Too many processes */
+#define EUSERS 68 /* Too many users */
+#define EDQUOT 69 /* Disc quota exceeded */
+
+/* Network File System */
+#define ESTALE 70 /* Stale NFS file handle */
+#define EREMOTE 71 /* Too many levels of remote in path */
+#define EBADRPC 72 /* RPC struct is bad */
+#define ERPCMISMATCH 73 /* RPC version wrong */
+#define EPROGUNAVAIL 74 /* RPC prog. not avail */
+#define EPROGMISMATCH 75 /* Program version wrong */
+#define EPROCUNAVAIL 76 /* Bad procedure for program */
+#endif /* _POSIX_SOURCE */
+
+#define ENOLCK 77 /* No locks available */
+#define ENOSYS 78 /* Function not implemented */
+
+#ifndef _POSIX_SOURCE
+#define EFTYPE 79 /* Inappropriate file type or format */
+#define EAUTH 80 /* Authentication error */
+#define ENEEDAUTH 81 /* Need authenticator */
+#define EIDRM 82 /* Identifier removed */
+#define ENOMSG 83 /* No message of desired type */
+#define EOVERFLOW 84 /* Value too large to be stored in data type */
+#define ECANCELED 85 /* Operation canceled */
+#define EILSEQ 86 /* Illegal byte sequence */
+#define ENOATTR 87 /* Attribute not found */
+
+#define EDOOFUS 88 /* Programming error */
+
+#define ELAST 88 /* Must be equal largest errno */
+
+#endif /* _POSIX_SOURCE */
+
+#ifdef _KERNEL
+/* pseudo-errors returned inside kernel to modify return to process */
+#define ERESTART (-1) /* restart syscall */
+#define EJUSTRETURN (-2) /* don't modify regs, just return */
+#define ENOIOCTL (-3) /* ioctl not handled by this layer */
+#define EDIRIOCTL (-4) /* do direct ioctl in GEOM */
+#endif
+
+#endif
diff --git a/src/include/eti.h b/src/include/eti.h
new file mode 100644
index 0000000..4561fa4
--- /dev/null
+++ b/src/include/eti.h
@@ -0,0 +1,52 @@
+/****************************************************************************
+ * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Juergen Pfeifer 1995,1997 *
+ ****************************************************************************/
+
+#ifndef NCURSES_ETI_H_incl
+#define NCURSES_ETI_H_incl 1
+
+#define E_OK (0)
+#define E_SYSTEM_ERROR (-1)
+#define E_BAD_ARGUMENT (-2)
+#define E_POSTED (-3)
+#define E_CONNECTED (-4)
+#define E_BAD_STATE (-5)
+#define E_NO_ROOM (-6)
+#define E_NOT_POSTED (-7)
+#define E_UNKNOWN_COMMAND (-8)
+#define E_NO_MATCH (-9)
+#define E_NOT_SELECTABLE (-10)
+#define E_NOT_CONNECTED (-11)
+#define E_REQUEST_DENIED (-12)
+#define E_INVALID_FIELD (-13)
+#define E_CURRENT (-14)
+
+#endif
diff --git a/src/include/fcntl.h b/src/include/fcntl.h
new file mode 100644
index 0000000..2fb656e
--- /dev/null
+++ b/src/include/fcntl.h
@@ -0,0 +1,229 @@
+/*-
+ * Copyright (c) 1983, 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)fcntl.h 8.3 (Berkeley) 1/21/94
+ * $FreeBSD: src/sys/sys/fcntl.h,v 1.16 2004/04/07 04:19:49 imp Exp $
+ */
+
+#ifndef _SYS_FCNTL_H_
+#define _SYS_FCNTL_H_
+
+/*
+ * This file includes the definitions for open and fcntl
+ * described by POSIX for ; it also includes
+ * related kernel definitions.
+ */
+
+#include
+#include
+
+#ifndef _MODE_T_DECLARED
+typedef __mode_t mode_t;
+#define _MODE_T_DECLARED
+#endif
+
+#ifndef _OFF_T_DECLARED
+typedef __off_t off_t;
+#define _OFF_T_DECLARED
+#endif
+
+#ifndef _PID_T_DECLARED
+typedef __pid_t pid_t;
+#define _PID_T_DECLARED
+#endif
+
+/*
+ * File status flags: these are used by open(2), fcntl(2).
+ * They are also used (indirectly) in the kernel file structure f_flags,
+ * which is a superset of the open/fcntl flags. Open flags and f_flags
+ * are inter-convertible using OFLAGS(fflags) and FFLAGS(oflags).
+ * Open/fcntl flags begin with O_; kernel-internal flags begin with F.
+ */
+/* open-only flags */
+#define O_RDONLY 0x0000 /* open for reading only */
+#define O_WRONLY 0x0001 /* open for writing only */
+#define O_RDWR 0x0002 /* open for reading and writing */
+#define O_ACCMODE 0x0003 /* mask for above modes */
+
+/*
+ * Kernel encoding of open mode; separate read and write bits that are
+ * independently testable: 1 greater than the above.
+ *
+ * XXX
+ * FREAD and FWRITE are excluded from the #ifdef _KERNEL so that TIOCFLUSH,
+ * which was documented to use FREAD/FWRITE, continues to work.
+ */
+#if __BSD_VISIBLE
+#define FREAD 0x0001
+#define FWRITE 0x0002
+#endif
+#define O_NONBLOCK 0x0004 /* no delay */
+#define O_APPEND 0x0008 /* set append mode */
+#if __BSD_VISIBLE
+#define O_SHLOCK 0x0010 /* open with shared file lock */
+#define O_EXLOCK 0x0020 /* open with exclusive file lock */
+#define O_ASYNC 0x0040 /* signal pgrp when data ready */
+#define O_FSYNC 0x0080 /* synchronous writes */
+#endif
+#define O_SYNC 0x0080 /* POSIX synonym for O_FSYNC */
+#if __BSD_VISIBLE
+#define O_NOFOLLOW 0x0100 /* don't follow symlinks */
+#endif
+#define O_CREAT 0x0200 /* create if nonexistent */
+#define O_TRUNC 0x0400 /* truncate to zero length */
+#define O_EXCL 0x0800 /* error if already exists */
+#ifdef _KERNEL
+#define FHASLOCK 0x4000 /* descriptor holds advisory lock */
+#endif
+
+/* Defined by POSIX 1003.1; BSD default, but must be distinct from O_RDONLY. */
+#define O_NOCTTY 0x8000 /* don't assign controlling terminal */
+
+#if __BSD_VISIBLE
+/* Attempt to bypass buffer cache */
+#define O_DIRECT 0x00010000
+#endif
+
+/*
+ * XXX missing O_DSYNC, O_RSYNC.
+ */
+
+#ifdef _KERNEL
+/* convert from open() flags to/from fflags; convert O_RD/WR to FREAD/FWRITE */
+#define FFLAGS(oflags) ((oflags) + 1)
+#define OFLAGS(fflags) ((fflags) - 1)
+
+/* bits to save after open */
+#define FMASK (FREAD|FWRITE|FAPPEND|FASYNC|FFSYNC|FNONBLOCK|O_DIRECT)
+/* bits settable by fcntl(F_SETFL, ...) */
+#define FCNTLFLAGS (FAPPEND|FASYNC|FFSYNC|FNONBLOCK|FPOSIXSHM|O_DIRECT)
+#endif
+
+/*
+ * The O_* flags used to have only F* names, which were used in the kernel
+ * and by fcntl. We retain the F* names for the kernel f_flag field
+ * and for backward compatibility for fcntl. These flags are deprecated.
+ */
+#if __BSD_VISIBLE
+#define FAPPEND O_APPEND /* kernel/compat */
+#define FASYNC O_ASYNC /* kernel/compat */
+#define FFSYNC O_FSYNC /* kernel */
+#define FNONBLOCK O_NONBLOCK /* kernel */
+#define FNDELAY O_NONBLOCK /* compat */
+#define O_NDELAY O_NONBLOCK /* compat */
+#endif
+
+/*
+ * We are out of bits in f_flag (which is a short). However,
+ * the flag bits not set in FMASK are only meaningful in the
+ * initial open syscall. Those bits can thus be given a
+ * different meaning for fcntl(2).
+ */
+#if __BSD_VISIBLE
+
+/*
+ * Set by shm_open(3) to get automatic MAP_ASYNC behavior
+ * for POSIX shared memory objects (which are otherwise
+ * implemented as plain files).
+ */
+#define FPOSIXSHM O_NOFOLLOW
+#endif
+
+/*
+ * Constants used for fcntl(2)
+ */
+
+/* command values */
+#define F_DUPFD 0 /* duplicate file descriptor */
+#define F_GETFD 1 /* get file descriptor flags */
+#define F_SETFD 2 /* set file descriptor flags */
+#define F_GETFL 3 /* get file status flags */
+#define F_SETFL 4 /* set file status flags */
+#if __BSD_VISIBLE || __XSI_VISIBLE || __POSIX_VISIBLE >= 200112
+#define F_GETOWN 5 /* get SIGIO/SIGURG proc/pgrp */
+#define F_SETOWN 6 /* set SIGIO/SIGURG proc/pgrp */
+#endif
+#define F_GETLK 7 /* get record locking information */
+#define F_SETLK 8 /* set record locking information */
+#define F_SETLKW 9 /* F_SETLK; wait if blocked */
+
+/* file descriptor flags (F_GETFD, F_SETFD) */
+#define FD_CLOEXEC 1 /* close-on-exec flag */
+
+/* record locking flags (F_GETLK, F_SETLK, F_SETLKW) */
+#define F_RDLCK 1 /* shared or read lock */
+#define F_UNLCK 2 /* unlock */
+#define F_WRLCK 3 /* exclusive or write lock */
+#ifdef _KERNEL
+#define F_WAIT 0x010 /* Wait until lock is granted */
+#define F_FLOCK 0x020 /* Use flock(2) semantics for lock */
+#define F_POSIX 0x040 /* Use POSIX semantics for lock */
+#endif
+
+/*
+ * Advisory file segment locking data type -
+ * information passed to system by user
+ */
+struct flock {
+ off_t l_start; /* starting offset */
+ off_t l_len; /* len = 0 means until end of file */
+ pid_t l_pid; /* lock owner */
+ short l_type; /* lock type: read/write, etc. */
+ short l_whence; /* type of l_start */
+};
+
+
+#if __BSD_VISIBLE
+/* lock operations for flock(2) */
+#define LOCK_SH 0x01 /* shared file lock */
+#define LOCK_EX 0x02 /* exclusive file lock */
+#define LOCK_NB 0x04 /* don't block when locking */
+#define LOCK_UN 0x08 /* unlock file */
+#endif
+
+/*
+ * XXX missing posix_fadvise() and posix_fallocate(), and POSIX_FADV_* macros.
+ */
+
+#ifndef _KERNEL
+__BEGIN_DECLS
+int open(const char *, int, ...);
+int creat(const char *, mode_t);
+int fcntl(int, int, ...);
+#if __BSD_VISIBLE
+int flock(int, int);
+#endif
+__END_DECLS
+#endif
+
+#endif /* !_SYS_FCNTL_H_ */
diff --git a/src/include/fetch.h b/src/include/fetch.h
new file mode 100644
index 0000000..17472e5
--- /dev/null
+++ b/src/include/fetch.h
@@ -0,0 +1,150 @@
+/*-
+ * Copyright (c) 1998 Dag-Erling Co�dan Sm�rgrav
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD: src/lib/libfetch/fetch.h,v 1.25 2002/07/22 16:11:39 des Exp $
+ */
+
+#ifndef _FETCH_H_INCLUDED
+#define _FETCH_H_INCLUDED
+
+#define _LIBFETCH_VER "libfetch/2.0"
+
+#define URL_SCHEMELEN 16
+#define URL_USERLEN 256
+#define URL_PWDLEN 256
+
+struct url {
+ char scheme[URL_SCHEMELEN+1];
+ char user[URL_USERLEN+1];
+ char pwd[URL_PWDLEN+1];
+ char host[MAXHOSTNAMELEN+1];
+ int port;
+ char *doc;
+ off_t offset;
+ size_t length;
+};
+
+struct url_stat {
+ off_t size;
+ time_t atime;
+ time_t mtime;
+};
+
+struct url_ent {
+ char name[PATH_MAX];
+ struct url_stat stat;
+};
+
+/* Recognized schemes */
+#define SCHEME_FTP "ftp"
+#define SCHEME_HTTP "http"
+#define SCHEME_HTTPS "https"
+#define SCHEME_FILE "file"
+
+/* Error codes */
+#define FETCH_ABORT 1
+#define FETCH_AUTH 2
+#define FETCH_DOWN 3
+#define FETCH_EXISTS 4
+#define FETCH_FULL 5
+#define FETCH_INFO 6
+#define FETCH_MEMORY 7
+#define FETCH_MOVED 8
+#define FETCH_NETWORK 9
+#define FETCH_OK 10
+#define FETCH_PROTO 11
+#define FETCH_RESOLV 12
+#define FETCH_SERVER 13
+#define FETCH_TEMP 14
+#define FETCH_TIMEOUT 15
+#define FETCH_UNAVAIL 16
+#define FETCH_UNKNOWN 17
+#define FETCH_URL 18
+#define FETCH_VERBOSE 19
+
+__BEGIN_DECLS
+
+/* FILE-specific functions */
+FILE *fetchXGetFile(struct url *, struct url_stat *, const char *);
+FILE *fetchGetFile(struct url *, const char *);
+FILE *fetchPutFile(struct url *, const char *);
+int fetchStatFile(struct url *, struct url_stat *, const char *);
+struct url_ent *fetchListFile(struct url *, const char *);
+
+/* HTTP-specific functions */
+FILE *fetchXGetHTTP(struct url *, struct url_stat *, const char *);
+FILE *fetchGetHTTP(struct url *, const char *);
+FILE *fetchPutHTTP(struct url *, const char *);
+int fetchStatHTTP(struct url *, struct url_stat *, const char *);
+struct url_ent *fetchListHTTP(struct url *, const char *);
+
+/* FTP-specific functions */
+FILE *fetchXGetFTP(struct url *, struct url_stat *, const char *);
+FILE *fetchGetFTP(struct url *, const char *);
+FILE *fetchPutFTP(struct url *, const char *);
+int fetchStatFTP(struct url *, struct url_stat *, const char *);
+struct url_ent *fetchListFTP(struct url *, const char *);
+
+/* Generic functions */
+FILE *fetchXGetURL(const char *, struct url_stat *, const char *);
+FILE *fetchGetURL(const char *, const char *);
+FILE *fetchPutURL(const char *, const char *);
+int fetchStatURL(const char *, struct url_stat *, const char *);
+struct url_ent *fetchListURL(const char *, const char *);
+FILE *fetchXGet(struct url *, struct url_stat *, const char *);
+FILE *fetchGet(struct url *, const char *);
+FILE *fetchPut(struct url *, const char *);
+int fetchStat(struct url *, struct url_stat *, const char *);
+struct url_ent *fetchList(struct url *, const char *);
+
+/* URL parsing */
+struct url *fetchMakeURL(const char *, const char *, int,
+ const char *, const char *, const char *);
+struct url *fetchParseURL(const char *);
+void fetchFreeURL(struct url *);
+
+__END_DECLS
+
+/* Authentication */
+typedef int (*auth_t)(struct url *);
+extern auth_t fetchAuthMethod;
+
+/* Last error code */
+extern int fetchLastErrCode;
+#define MAXERRSTRING 256
+extern char fetchLastErrString[MAXERRSTRING];
+
+/* I/O timeout */
+extern int fetchTimeout;
+
+/* Restart interrupted syscalls */
+extern int fetchRestartCalls;
+
+/* Extra verbosity */
+extern int fetchDebug;
+
+#endif
diff --git a/src/include/float.h b/src/include/float.h
new file mode 100644
index 0000000..7fd7e8d
--- /dev/null
+++ b/src/include/float.h
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 1989 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from: @(#)float.h 7.1 (Berkeley) 5/8/90
+ * $FreeBSD: src/sys/i386/include/float.h,v 1.12 2004/04/25 02:36:28 das Exp $
+ */
+
+#ifndef _MACHINE_FLOAT_H_
+#define _MACHINE_FLOAT_H_ 1
+
+#include
+
+#define FLT_RADIX 2 /* b */
+#define FLT_ROUNDS 1 /* FP addition rounds to nearest */
+#if __ISO_C_VISIBLE >= 1999
+#define FLT_EVAL_METHOD (-1) /* i387 semantics are...interesting */
+#define DECIMAL_DIG 21 /* max precision in decimal digits */
+#endif
+
+#define FLT_MANT_DIG 24 /* p */
+#define FLT_EPSILON 1.19209290E-07F /* b**(1-p) */
+#define FLT_DIG 6 /* floor((p-1)*log10(b))+(b == 10) */
+#define FLT_MIN_EXP (-125) /* emin */
+#define FLT_MIN 1.17549435E-38F /* b**(emin-1) */
+#define FLT_MIN_10_EXP (-37) /* ceil(log10(b**(emin-1))) */
+#define FLT_MAX_EXP 128 /* emax */
+#define FLT_MAX 3.40282347E+38F /* (1-b**(-p))*b**emax */
+#define FLT_MAX_10_EXP 38 /* floor(log10((1-b**(-p))*b**emax)) */
+
+#define DBL_MANT_DIG 53
+#define DBL_EPSILON 2.2204460492503131E-16
+#define DBL_DIG 15
+#define DBL_MIN_EXP (-1021)
+#define DBL_MIN 2.2250738585072014E-308
+#define DBL_MIN_10_EXP (-307)
+#define DBL_MAX_EXP 1024
+#define DBL_MAX 1.7976931348623157E+308
+#define DBL_MAX_10_EXP 308
+
+
+#define LDBL_MANT_DIG 64
+#define LDBL_EPSILON 1.0842021724855044340E-19L
+#define LDBL_DIG 18
+#define LDBL_MIN_EXP (-16381)
+#define LDBL_MIN 3.3621031431120935063E-4932L
+#define LDBL_MIN_10_EXP (-4931)
+#define LDBL_MAX_EXP 16384
+#define LDBL_MAX 1.1897314953572317650E+4932L
+#define LDBL_MAX_10_EXP 4932
+#endif /* _MACHINE_FLOAT_H_ */
diff --git a/src/include/floatingpoint.h b/src/include/floatingpoint.h
new file mode 100644
index 0000000..65cb4a3
--- /dev/null
+++ b/src/include/floatingpoint.h
@@ -0,0 +1,42 @@
+/*-
+ * Copyright (c) 1993 Andrew Moore, Talke Studio
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from: @(#) floatingpoint.h 1.0 (Berkeley) 9/23/93
+ * $FreeBSD: src/sys/i386/include/floatingpoint.h,v 1.13 2003/01/19 06:01:33 marcel Exp $
+ */
+
+#ifndef _FLOATINGPOINT_H_
+#define _FLOATINGPOINT_H_
+
+#include
+
+#endif /* !_FLOATINGPOINT_H_ */
diff --git a/src/include/fmtmsg.h b/src/include/fmtmsg.h
new file mode 100644
index 0000000..256cf33
--- /dev/null
+++ b/src/include/fmtmsg.h
@@ -0,0 +1,73 @@
+/*-
+ * Copyright (c) 2002 Mike Barcroft
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: src/include/fmtmsg.h,v 1.2 2002/08/05 16:37:05 mike Exp $
+ */
+
+#ifndef _FMTMSG_H_
+#define _FMTMSG_H_
+
+/* Source of condition is... */
+#define MM_HARD 0x0001 /* ...hardware. */
+#define MM_SOFT 0x0002 /* ...software. */
+#define MM_FIRM 0x0004 /* ...fireware. */
+
+/* Condition detected by... */
+#define MM_APPL 0x0010 /* ...application. */
+#define MM_UTIL 0x0020 /* ...utility. */
+#define MM_OPSYS 0x0040 /* ...operating system. */
+
+/* Display on... */
+#define MM_PRINT 0x0100 /* ...standard error. */
+#define MM_CONSOLE 0x0200 /* ...system console. */
+
+#define MM_RECOVER 0x1000 /* Recoverable error. */
+#define MM_NRECOV 0x2000 /* Non-recoverable error. */
+
+/* Severity levels. */
+#define MM_NOSEV 0 /* No severity level provided. */
+#define MM_HALT 1 /* Error causing application to halt. */
+#define MM_ERROR 2 /* Non-fault fault. */
+#define MM_WARNING 3 /* Unusual non-error condition. */
+#define MM_INFO 4 /* Informative message. */
+
+/* Null options. */
+#define MM_NULLLBL (char *)0
+#define MM_NULLSEV 0
+#define MM_NULLMC 0L
+#define MM_NULLTXT (char *)0
+#define MM_NULLACT (char *)0
+#define MM_NULLTAG (char *)0
+
+/* Return values. */
+#define MM_OK 0 /* Success. */
+#define MM_NOMSG 1 /* Failed to output to stderr. */
+#define MM_NOCON 2 /* Failed to output to console. */
+#define MM_NOTOK 3 /* Failed to output anything. */
+
+int fmtmsg(long, const char *, int, const char *, const char *,
+ const char *);
+
+#endif /* !_FMTMSG_H_ */
diff --git a/src/include/fnmatch.h b/src/include/fnmatch.h
new file mode 100644
index 0000000..d1cc03a
--- /dev/null
+++ b/src/include/fnmatch.h
@@ -0,0 +1,63 @@
+/*-
+ * Copyright (c) 1992, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: src/include/fnmatch.h,v 1.15 2003/12/18 10:41:39 jkh Exp $
+ * @(#)fnmatch.h 8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _FNMATCH_H_
+#define _FNMATCH_H_
+
+#include
+
+#define FNM_NOMATCH 1 /* Match failed. */
+
+#define FNM_NOESCAPE 0x01 /* Disable backslash escaping. */
+#define FNM_PATHNAME 0x02 /* Slash must be matched by slash. */
+#define FNM_PERIOD 0x04 /* Period must be matched by period. */
+
+#if __XSI_VISIBLE
+#define FNM_NOSYS (-1) /* Reserved. */
+#endif
+
+#if __BSD_VISIBLE
+#define FNM_LEADING_DIR 0x08 /* Ignore / after Imatch. */
+#define FNM_CASEFOLD 0x10 /* Case insensitive search. */
+#define FNM_IGNORECASE FNM_CASEFOLD
+#define FNM_FILE_NAME FNM_PATHNAME
+#endif
+
+__BEGIN_DECLS
+int fnmatch(const char *, const char *, int);
+__END_DECLS
+
+#endif /* !_FNMATCH_H_ */
diff --git a/src/include/form.h b/src/include/form.h
new file mode 100644
index 0000000..140b25f
--- /dev/null
+++ b/src/include/form.h
@@ -0,0 +1,383 @@
+/****************************************************************************
+ * Copyright (c) 1998,2000 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Juergen Pfeifer 1995,1997 *
+ ****************************************************************************/
+
+#ifndef FORM_H
+#define FORM_H
+
+#include
+#include
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+typedef int Form_Options;
+typedef int Field_Options;
+
+ /**********
+ * _PAGE *
+ **********/
+
+typedef struct {
+ short pmin; /* index of first field on page */
+ short pmax; /* index of last field on page */
+ short smin; /* index of top leftmost field on page */
+ short smax; /* index of bottom rightmost field on page */
+} _PAGE;
+
+ /**********
+ * FIELD *
+ **********/
+
+typedef struct fieldnode {
+ unsigned short status; /* flags */
+ short rows; /* size in rows */
+ short cols; /* size in cols */
+ short frow; /* first row */
+ short fcol; /* first col */
+ int drows; /* dynamic rows */
+ int dcols; /* dynamic cols */
+ int maxgrow; /* maximum field growth */
+ int nrow; /* offscreen rows */
+ short nbuf; /* additional buffers */
+ short just; /* justification */
+ short page; /* page on form */
+ short index; /* into form -> field */
+ int pad; /* pad character */
+ chtype fore; /* foreground attribute */
+ chtype back; /* background attribute */
+ Field_Options opts; /* options */
+ struct fieldnode * snext; /* sorted order pointer */
+ struct fieldnode * sprev; /* sorted order pointer */
+ struct fieldnode * link; /* linked field chain */
+ struct formnode * form; /* containing form */
+ struct typenode * type; /* field type */
+ void * arg; /* argument for type */
+ char * buf; /* field buffers */
+ void * usrptr; /* user pointer */
+} FIELD;
+
+ /**************
+ * FIELDTYPE *
+ **************/
+
+typedef struct typenode {
+ unsigned short status; /* flags */
+ long ref; /* reference count */
+ struct typenode * left; /* ptr to operand for | */
+ struct typenode * right; /* ptr to operand for | */
+
+ void* (*makearg)(va_list *); /* make fieldtype arg */
+ void* (*copyarg)(const void *); /* copy fieldtype arg */
+ void (*freearg)(void *); /* free fieldtype arg */
+
+ bool (*fcheck)(FIELD *,const void *); /* field validation */
+ bool (*ccheck)(int,const void *); /* character validation */
+
+ bool (*next)(FIELD *,const void *); /* enumerate next value */
+ bool (*prev)(FIELD *,const void *); /* enumerate prev value */
+
+} FIELDTYPE;
+
+ /*********
+ * FORM *
+ *********/
+
+typedef struct formnode {
+ unsigned short status; /* flags */
+ short rows; /* size in rows */
+ short cols; /* size in cols */
+ int currow; /* current row in field window*/
+ int curcol; /* current col in field window*/
+ int toprow; /* in scrollable field window */
+ int begincol; /* in horiz. scrollable field */
+ short maxfield; /* number of fields */
+ short maxpage; /* number of pages */
+ short curpage; /* index into page */
+ Form_Options opts; /* options */
+ WINDOW * win; /* window */
+ WINDOW * sub; /* subwindow */
+ WINDOW * w; /* window for current field */
+ FIELD ** field; /* field [maxfield] */
+ FIELD * current; /* current field */
+ _PAGE * page; /* page [maxpage] */
+ void * usrptr; /* user pointer */
+
+ void (*forminit)(struct formnode *);
+ void (*formterm)(struct formnode *);
+ void (*fieldinit)(struct formnode *);
+ void (*fieldterm)(struct formnode *);
+
+} FORM;
+
+typedef void (*Form_Hook)(FORM *);
+
+ /***************************
+ * miscellaneous #defines *
+ ***************************/
+
+/* field justification */
+#define NO_JUSTIFICATION (0)
+#define JUSTIFY_LEFT (1)
+#define JUSTIFY_CENTER (2)
+#define JUSTIFY_RIGHT (3)
+
+/* field options */
+#define O_VISIBLE (0x0001)
+#define O_ACTIVE (0x0002)
+#define O_PUBLIC (0x0004)
+#define O_EDIT (0x0008)
+#define O_WRAP (0x0010)
+#define O_BLANK (0x0020)
+#define O_AUTOSKIP (0x0040)
+#define O_NULLOK (0x0080)
+#define O_PASSOK (0x0100)
+#define O_STATIC (0x0200)
+
+/* form options */
+#define O_NL_OVERLOAD (0x0001)
+#define O_BS_OVERLOAD (0x0002)
+
+/* form driver commands */
+#define REQ_NEXT_PAGE (KEY_MAX + 1) /* move to next page */
+#define REQ_PREV_PAGE (KEY_MAX + 2) /* move to previous page */
+#define REQ_FIRST_PAGE (KEY_MAX + 3) /* move to first page */
+#define REQ_LAST_PAGE (KEY_MAX + 4) /* move to last page */
+
+#define REQ_NEXT_FIELD (KEY_MAX + 5) /* move to next field */
+#define REQ_PREV_FIELD (KEY_MAX + 6) /* move to previous field */
+#define REQ_FIRST_FIELD (KEY_MAX + 7) /* move to first field */
+#define REQ_LAST_FIELD (KEY_MAX + 8) /* move to last field */
+#define REQ_SNEXT_FIELD (KEY_MAX + 9) /* move to sorted next field */
+#define REQ_SPREV_FIELD (KEY_MAX + 10) /* move to sorted prev field */
+#define REQ_SFIRST_FIELD (KEY_MAX + 11) /* move to sorted first field */
+#define REQ_SLAST_FIELD (KEY_MAX + 12) /* move to sorted last field */
+#define REQ_LEFT_FIELD (KEY_MAX + 13) /* move to left to field */
+#define REQ_RIGHT_FIELD (KEY_MAX + 14) /* move to right to field */
+#define REQ_UP_FIELD (KEY_MAX + 15) /* move to up to field */
+#define REQ_DOWN_FIELD (KEY_MAX + 16) /* move to down to field */
+
+#define REQ_NEXT_CHAR (KEY_MAX + 17) /* move to next char in field */
+#define REQ_PREV_CHAR (KEY_MAX + 18) /* move to prev char in field */
+#define REQ_NEXT_LINE (KEY_MAX + 19) /* move to next line in field */
+#define REQ_PREV_LINE (KEY_MAX + 20) /* move to prev line in field */
+#define REQ_NEXT_WORD (KEY_MAX + 21) /* move to next word in field */
+#define REQ_PREV_WORD (KEY_MAX + 22) /* move to prev word in field */
+#define REQ_BEG_FIELD (KEY_MAX + 23) /* move to first char in field */
+#define REQ_END_FIELD (KEY_MAX + 24) /* move after last char in fld */
+#define REQ_BEG_LINE (KEY_MAX + 25) /* move to beginning of line */
+#define REQ_END_LINE (KEY_MAX + 26) /* move after last char in line */
+#define REQ_LEFT_CHAR (KEY_MAX + 27) /* move left in field */
+#define REQ_RIGHT_CHAR (KEY_MAX + 28) /* move right in field */
+#define REQ_UP_CHAR (KEY_MAX + 29) /* move up in field */
+#define REQ_DOWN_CHAR (KEY_MAX + 30) /* move down in field */
+
+#define REQ_NEW_LINE (KEY_MAX + 31) /* insert/overlay new line */
+#define REQ_INS_CHAR (KEY_MAX + 32) /* insert blank char at cursor */
+#define REQ_INS_LINE (KEY_MAX + 33) /* insert blank line at cursor */
+#define REQ_DEL_CHAR (KEY_MAX + 34) /* delete char at cursor */
+#define REQ_DEL_PREV (KEY_MAX + 35) /* delete char before cursor */
+#define REQ_DEL_LINE (KEY_MAX + 36) /* delete line at cursor */
+#define REQ_DEL_WORD (KEY_MAX + 37) /* delete line at cursor */
+#define REQ_CLR_EOL (KEY_MAX + 38) /* clear to end of line */
+#define REQ_CLR_EOF (KEY_MAX + 39) /* clear to end of field */
+#define REQ_CLR_FIELD (KEY_MAX + 40) /* clear entire field */
+#define REQ_OVL_MODE (KEY_MAX + 41) /* begin overlay mode */
+#define REQ_INS_MODE (KEY_MAX + 42) /* begin insert mode */
+#define REQ_SCR_FLINE (KEY_MAX + 43) /* scroll field forward a line */
+#define REQ_SCR_BLINE (KEY_MAX + 44) /* scroll field backward a line */
+#define REQ_SCR_FPAGE (KEY_MAX + 45) /* scroll field forward a page */
+#define REQ_SCR_BPAGE (KEY_MAX + 46) /* scroll field backward a page */
+#define REQ_SCR_FHPAGE (KEY_MAX + 47) /* scroll field forward half page */
+#define REQ_SCR_BHPAGE (KEY_MAX + 48) /* scroll field backward half page */
+#define REQ_SCR_FCHAR (KEY_MAX + 49) /* horizontal scroll char */
+#define REQ_SCR_BCHAR (KEY_MAX + 50) /* horizontal scroll char */
+#define REQ_SCR_HFLINE (KEY_MAX + 51) /* horizontal scroll line */
+#define REQ_SCR_HBLINE (KEY_MAX + 52) /* horizontal scroll line */
+#define REQ_SCR_HFHALF (KEY_MAX + 53) /* horizontal scroll half line */
+#define REQ_SCR_HBHALF (KEY_MAX + 54) /* horizontal scroll half line */
+
+#define REQ_VALIDATION (KEY_MAX + 55) /* validate field */
+#define REQ_NEXT_CHOICE (KEY_MAX + 56) /* display next field choice */
+#define REQ_PREV_CHOICE (KEY_MAX + 57) /* display prev field choice */
+
+#define MIN_FORM_COMMAND (KEY_MAX + 1) /* used by form_driver */
+#define MAX_FORM_COMMAND (KEY_MAX + 57) /* used by form_driver */
+
+#if defined(MAX_COMMAND)
+# if (MAX_FORM_COMMAND > MAX_COMMAND)
+# error Something is wrong -- MAX_FORM_COMMAND is greater than MAX_COMMAND
+# elif (MAX_COMMAND != (KEY_MAX + 128))
+# error Something is wrong -- MAX_COMMAND is already inconsistently defined.
+# endif
+#else
+# define MAX_COMMAND (KEY_MAX + 128)
+#endif
+
+ /*************************
+ * standard field types *
+ *************************/
+extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ALPHA;
+extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ALNUM;
+extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ENUM;
+extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_INTEGER;
+extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_NUMERIC;
+extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_REGEXP;
+
+ /************************************
+ * built-in additional field types *
+ * They are not defined in SVr4 *
+ ************************************/
+extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_IPV4; /* Internet IP Version 4 address */
+
+ /***********************
+ * Default objects *
+ ***********************/
+extern NCURSES_EXPORT_VAR(FORM *) _nc_Default_Form;
+extern NCURSES_EXPORT_VAR(FIELD *) _nc_Default_Field;
+
+
+ /***********************
+ * FIELDTYPE routines *
+ ***********************/
+extern NCURSES_EXPORT(FIELDTYPE *) new_fieldtype (
+ bool (* const field_check)(FIELD *,const void *),
+ bool (* const char_check)(int,const void *)),
+ *link_fieldtype(FIELDTYPE *,FIELDTYPE *);
+
+extern NCURSES_EXPORT(int) free_fieldtype (FIELDTYPE *);
+extern NCURSES_EXPORT(int) set_fieldtype_arg (FIELDTYPE *,
+ void * (* const make_arg)(va_list *),
+ void * (* const copy_arg)(const void *),
+ void (* const free_arg)(void *));
+extern NCURSES_EXPORT(int) set_fieldtype_choice (FIELDTYPE *,
+ bool (* const next_choice)(FIELD *,const void *),
+ bool (* const prev_choice)(FIELD *,const void *));
+
+ /*******************
+ * FIELD routines *
+ *******************/
+extern NCURSES_EXPORT(FIELD *) new_field (int,int,int,int,int,int);
+extern NCURSES_EXPORT(FIELD *) dup_field (FIELD *,int,int);
+extern NCURSES_EXPORT(FIELD *) link_field (FIELD *,int,int);
+
+extern NCURSES_EXPORT(int) free_field (FIELD *);
+extern NCURSES_EXPORT(int) field_info (const FIELD *,int *,int *,int *,int *,int *,int *);
+extern NCURSES_EXPORT(int) dynamic_field_info (const FIELD *,int *,int *,int *);
+extern NCURSES_EXPORT(int) set_max_field ( FIELD *,int);
+extern NCURSES_EXPORT(int) move_field (FIELD *,int,int);
+extern NCURSES_EXPORT(int) set_field_type (FIELD *,FIELDTYPE *,...);
+extern NCURSES_EXPORT(int) set_new_page (FIELD *,bool);
+extern NCURSES_EXPORT(int) set_field_just (FIELD *,int);
+extern NCURSES_EXPORT(int) field_just (const FIELD *);
+extern NCURSES_EXPORT(int) set_field_fore (FIELD *,chtype);
+extern NCURSES_EXPORT(int) set_field_back (FIELD *,chtype);
+extern NCURSES_EXPORT(int) set_field_pad (FIELD *,int);
+extern NCURSES_EXPORT(int) field_pad (const FIELD *);
+extern NCURSES_EXPORT(int) set_field_buffer (FIELD *,int,const char *);
+extern NCURSES_EXPORT(int) set_field_status (FIELD *,bool);
+extern NCURSES_EXPORT(int) set_field_userptr (FIELD *, void *);
+extern NCURSES_EXPORT(int) set_field_opts (FIELD *,Field_Options);
+extern NCURSES_EXPORT(int) field_opts_on (FIELD *,Field_Options);
+extern NCURSES_EXPORT(int) field_opts_off (FIELD *,Field_Options);
+
+extern NCURSES_EXPORT(chtype) field_fore (const FIELD *);
+extern NCURSES_EXPORT(chtype) field_back (const FIELD *);
+
+extern NCURSES_EXPORT(bool) new_page (const FIELD *);
+extern NCURSES_EXPORT(bool) field_status (const FIELD *);
+
+extern NCURSES_EXPORT(void *) field_arg (const FIELD *);
+
+extern NCURSES_EXPORT(void *) field_userptr (const FIELD *);
+
+extern NCURSES_EXPORT(FIELDTYPE *) field_type (const FIELD *);
+
+extern NCURSES_EXPORT(char *) field_buffer (const FIELD *,int);
+
+extern NCURSES_EXPORT(Field_Options) field_opts (const FIELD *);
+
+ /******************
+ * FORM routines *
+ ******************/
+
+extern NCURSES_EXPORT(FORM *) new_form (FIELD **);
+
+extern NCURSES_EXPORT(FIELD **) form_fields (const FORM *);
+extern NCURSES_EXPORT(FIELD *) current_field (const FORM *);
+
+extern NCURSES_EXPORT(WINDOW *) form_win (const FORM *);
+extern NCURSES_EXPORT(WINDOW *) form_sub (const FORM *);
+
+extern NCURSES_EXPORT(Form_Hook) form_init (const FORM *);
+extern NCURSES_EXPORT(Form_Hook) form_term (const FORM *);
+extern NCURSES_EXPORT(Form_Hook) field_init (const FORM *);
+extern NCURSES_EXPORT(Form_Hook) field_term (const FORM *);
+
+extern NCURSES_EXPORT(int) free_form (FORM *);
+extern NCURSES_EXPORT(int) set_form_fields (FORM *,FIELD **);
+extern NCURSES_EXPORT(int) field_count (const FORM *);
+extern NCURSES_EXPORT(int) set_form_win (FORM *,WINDOW *);
+extern NCURSES_EXPORT(int) set_form_sub (FORM *,WINDOW *);
+extern NCURSES_EXPORT(int) set_current_field (FORM *,FIELD *);
+extern NCURSES_EXPORT(int) field_index (const FIELD *);
+extern NCURSES_EXPORT(int) set_form_page (FORM *,int);
+extern NCURSES_EXPORT(int) form_page (const FORM *);
+extern NCURSES_EXPORT(int) scale_form (const FORM *,int *,int *);
+extern NCURSES_EXPORT(int) set_form_init (FORM *,Form_Hook);
+extern NCURSES_EXPORT(int) set_form_term (FORM *,Form_Hook);
+extern NCURSES_EXPORT(int) set_field_init (FORM *,Form_Hook);
+extern NCURSES_EXPORT(int) set_field_term (FORM *,Form_Hook);
+extern NCURSES_EXPORT(int) post_form (FORM *);
+extern NCURSES_EXPORT(int) unpost_form (FORM *);
+extern NCURSES_EXPORT(int) pos_form_cursor (FORM *);
+extern NCURSES_EXPORT(int) form_driver (FORM *,int);
+extern NCURSES_EXPORT(int) set_form_userptr (FORM *,void *);
+extern NCURSES_EXPORT(int) set_form_opts (FORM *,Form_Options);
+extern NCURSES_EXPORT(int) form_opts_on (FORM *,Form_Options);
+extern NCURSES_EXPORT(int) form_opts_off (FORM *,Form_Options);
+extern NCURSES_EXPORT(int) form_request_by_name (const char *);
+
+extern NCURSES_EXPORT(const char *) form_request_name (int);
+
+extern NCURSES_EXPORT(void *) form_userptr (const FORM *);
+
+extern NCURSES_EXPORT(Form_Options) form_opts (const FORM *);
+
+extern NCURSES_EXPORT(bool) data_ahead (const FORM *);
+extern NCURSES_EXPORT(bool) data_behind (const FORM *);
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* FORM_H */
diff --git a/src/include/fpmath.h b/src/include/fpmath.h
new file mode 100644
index 0000000..f52a6bd
--- /dev/null
+++ b/src/include/fpmath.h
@@ -0,0 +1,66 @@
+/*-
+ * Copyright (c) 2003 Mike Barcroft
+ * Copyright (c) 2002 David Schultz
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: src/lib/libc/include/fpmath.h,v 1.2 2004/01/18 08:05:21 das Exp $
+ */
+
+#include
+#include "_fpmath.h"
+
+union IEEEf2bits {
+ float f;
+ struct {
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+ unsigned int man :23;
+ unsigned int exp :8;
+ unsigned int sign :1;
+#else /* _BIG_ENDIAN */
+ unsigned int sign :1;
+ unsigned int exp :8;
+ unsigned int man :23;
+#endif
+ } bits;
+};
+
+#define DBL_MANH_SIZE 20
+#define DBL_MANL_SIZE 32
+
+union IEEEd2bits {
+ double d;
+ struct {
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+ unsigned int manl :32;
+ unsigned int manh :20;
+ unsigned int exp :11;
+ unsigned int sign :1;
+#else /* _BIG_ENDIAN */
+ unsigned int sign :1;
+ unsigned int exp :11;
+ unsigned int manh :20;
+ unsigned int manl :32;
+#endif
+ } bits;
+};
diff --git a/src/include/fstab.h b/src/include/fstab.h
new file mode 100644
index 0000000..22d807c
--- /dev/null
+++ b/src/include/fstab.h
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)fstab.h 8.1 (Berkeley) 6/2/93
+ * $FreeBSD: src/include/fstab.h,v 1.4 2003/04/07 12:54:59 mdodd Exp $
+ */
+
+#ifndef _FSTAB_H_
+#define _FSTAB_H_
+
+/*
+ * File system table, see fstab(5).
+ *
+ * Used by dump, mount, umount, swapon, fsck, df, ...
+ *
+ * For ufs fs_spec field is the block special name. Programs that want to
+ * use the character special name must create that name by prepending a 'r'
+ * after the right most slash. Quota files are always named "quotas", so
+ * if type is "rq", then use concatenation of fs_file and "quotas" to locate
+ * quota file.
+ */
+#define _PATH_FSTAB "/etc/fstab"
+#define FSTAB "/etc/fstab" /* deprecated */
+
+#define FSTAB_RW "rw" /* read/write device */
+#define FSTAB_RQ "rq" /* read/write with quotas */
+#define FSTAB_RO "ro" /* read-only device */
+#define FSTAB_SW "sw" /* swap device */
+#define FSTAB_XX "xx" /* ignore totally */
+
+struct fstab {
+ char *fs_spec; /* block special device name */
+ char *fs_file; /* file system path prefix */
+ char *fs_vfstype; /* File system type, ufs, nfs */
+ char *fs_mntops; /* Mount options ala -o */
+ char *fs_type; /* FSTAB_* from fs_mntops */
+ int fs_freq; /* dump frequency, in days */
+ int fs_passno; /* pass number on parallel fsck */
+};
+
+#include
+
+__BEGIN_DECLS
+struct fstab *getfsent(void);
+struct fstab *getfsspec(const char *);
+struct fstab *getfsfile(const char *);
+int setfsent(void);
+void endfsent(void);
+void setfstab(const char *);
+const char *getfstab(void);
+__END_DECLS
+
+#endif /* !_FSTAB_H_ */
diff --git a/src/include/ftpio.h b/src/include/ftpio.h
new file mode 100644
index 0000000..5799d6a
--- /dev/null
+++ b/src/include/ftpio.h
@@ -0,0 +1,71 @@
+#ifndef _FTP_H_INCLUDE
+#define _FTP_H_INCLUDE
+
+#include
+#include
+#include
+#include
+
+/*
+ * ----------------------------------------------------------------------------
+ * "THE BEER-WARE LICENSE" (Revision 42):
+ * wrote this file. As long as you retain this notice you
+ * can do whatever you want with this stuff. If we meet some day, and you think
+ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
+ * ----------------------------------------------------------------------------
+ *
+ * Major Changelog:
+ *
+ * Jordan K. Hubbard
+ * 17 Jan 1996
+ *
+ * Turned inside out. Now returns xfers as new file ids, not as a special
+ * `state' of FTP_t
+ *
+ * $FreeBSD: src/lib/libftpio/ftpio.h,v 1.17 2002/03/25 13:49:48 phk Exp $
+ */
+
+/* Internal housekeeping data structure for FTP sessions */
+typedef struct {
+ enum { init, isopen, quit } con_state;
+ int fd_ctrl;
+ int addrtype;
+ char *host;
+ char *file;
+ int error;
+ int is_binary;
+ int is_passive;
+ int is_verbose;
+} *FTP_t;
+
+/* Structure we use to match FTP error codes with readable strings */
+struct ftperr {
+ const int num;
+ const char *string;
+};
+
+__BEGIN_DECLS
+extern struct ftperr ftpErrList[];
+extern int const ftpErrListLength;
+
+/* Exported routines - deal only with FILE* type */
+extern FILE *ftpLogin(char *host, char *user, char *passwd, int port, int verbose, int *retcode);
+extern int ftpChdir(FILE *fp, char *dir);
+extern int ftpErrno(FILE *fp);
+extern off_t ftpGetSize(FILE *fp, char *file);
+extern FILE *ftpGet(FILE *fp, char *file, off_t *seekto);
+extern FILE *ftpPut(FILE *fp, char *file);
+extern int ftpAscii(FILE *fp);
+extern int ftpBinary(FILE *fp);
+extern int ftpPassive(FILE *fp, int status);
+extern void ftpVerbose(FILE *fp, int status);
+extern FILE *ftpGetURL(char *url, char *user, char *passwd, int *retcode);
+extern FILE *ftpPutURL(char *url, char *user, char *passwd, int *retcode);
+extern time_t ftpGetModtime(FILE *fp, char *s);
+extern const char *ftpErrString(int error);
+extern FILE *ftpLoginAf(char *host, int af, char *user, char *passwd, int port, int verbose, int *retcode);
+extern FILE *ftpGetURLAf(char *url, int af, char *user, char *passwd, int *retcode);
+extern FILE *ftpPutURLAf(char *url, int af, char *user, char *passwd, int *retcode);
+__END_DECLS
+
+#endif /* _FTP_H_INCLUDE */
diff --git a/src/include/fts.h b/src/include/fts.h
new file mode 100644
index 0000000..f44d4c1
--- /dev/null
+++ b/src/include/fts.h
@@ -0,0 +1,137 @@
+/*
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)fts.h 8.3 (Berkeley) 8/14/94
+ * $FreeBSD: src/include/fts.h,v 1.10 2004/05/12 21:38:39 peadar Exp $
+ */
+
+#ifndef _FTS_H_
+#define _FTS_H_
+
+typedef struct {
+ struct _ftsent *fts_cur; /* current node */
+ struct _ftsent *fts_child; /* linked list of children */
+ struct _ftsent **fts_array; /* sort array */
+ dev_t fts_dev; /* starting device # */
+ char *fts_path; /* path for this descent */
+ int fts_rfd; /* fd for root */
+ int fts_pathlen; /* sizeof(path) */
+ int fts_nitems; /* elements in the sort array */
+ int (*fts_compar) /* compare function */
+ (const struct _ftsent * const *, const struct _ftsent * const *);
+
+#define FTS_COMFOLLOW 0x001 /* follow command line symlinks */
+#define FTS_LOGICAL 0x002 /* logical walk */
+#define FTS_NOCHDIR 0x004 /* don't change directories */
+#define FTS_NOSTAT 0x008 /* don't get stat info */
+#define FTS_PHYSICAL 0x010 /* physical walk */
+#define FTS_SEEDOT 0x020 /* return dot and dot-dot */
+#define FTS_XDEV 0x040 /* don't cross devices */
+#define FTS_WHITEOUT 0x080 /* return whiteout information */
+#define FTS_OPTIONMASK 0x0ff /* valid user option mask */
+
+#define FTS_NAMEONLY 0x100 /* (private) child names only */
+#define FTS_STOP 0x200 /* (private) unrecoverable error */
+ int fts_options; /* fts_open options, global flags */
+ void *fts_clientptr; /* thunk for sort function */
+} FTS;
+
+typedef struct _ftsent {
+ struct _ftsent *fts_cycle; /* cycle node */
+ struct _ftsent *fts_parent; /* parent directory */
+ struct _ftsent *fts_link; /* next file in directory */
+ long fts_number; /* local numeric value */
+ void *fts_pointer; /* local address value */
+ char *fts_accpath; /* access path */
+ char *fts_path; /* root path */
+ int fts_errno; /* errno for this node */
+ int fts_symfd; /* fd for symlink */
+ u_short fts_pathlen; /* strlen(fts_path) */
+ u_short fts_namelen; /* strlen(fts_name) */
+
+ ino_t fts_ino; /* inode */
+ dev_t fts_dev; /* device */
+ nlink_t fts_nlink; /* link count */
+
+#define FTS_ROOTPARENTLEVEL -1
+#define FTS_ROOTLEVEL 0
+ short fts_level; /* depth (-1 to N) */
+
+#define FTS_D 1 /* preorder directory */
+#define FTS_DC 2 /* directory that causes cycles */
+#define FTS_DEFAULT 3 /* none of the above */
+#define FTS_DNR 4 /* unreadable directory */
+#define FTS_DOT 5 /* dot or dot-dot */
+#define FTS_DP 6 /* postorder directory */
+#define FTS_ERR 7 /* error; errno is set */
+#define FTS_F 8 /* regular file */
+#define FTS_INIT 9 /* initialized only */
+#define FTS_NS 10 /* stat(2) failed */
+#define FTS_NSOK 11 /* no stat(2) requested */
+#define FTS_SL 12 /* symbolic link */
+#define FTS_SLNONE 13 /* symbolic link without target */
+#define FTS_W 14 /* whiteout object */
+ u_short fts_info; /* user flags for FTSENT structure */
+
+#define FTS_DONTCHDIR 0x01 /* don't chdir .. to the parent */
+#define FTS_SYMFOLLOW 0x02 /* followed a symlink to get here */
+#define FTS_ISW 0x04 /* this is a whiteout object */
+ u_short fts_flags; /* private flags for FTSENT structure */
+
+#define FTS_AGAIN 1 /* read node again */
+#define FTS_FOLLOW 2 /* follow symbolic link */
+#define FTS_NOINSTR 3 /* no instructions */
+#define FTS_SKIP 4 /* discard node */
+ u_short fts_instr; /* fts_set() instructions */
+
+ struct stat *fts_statp; /* stat(2) information */
+ char *fts_name; /* file name */
+ FTS *fts_fts; /* back pointer to main FTS */
+} FTSENT;
+
+#include
+
+__BEGIN_DECLS
+FTSENT *fts_children(FTS *, int);
+int fts_close(FTS *);
+void *fts_get_clientptr(FTS *);
+#define fts_get_clientptr(fts) ((fts)->fts_clientptr)
+FTS *fts_get_stream(FTSENT *);
+#define fts_get_stream(ftsent) ((ftsent)->fts_fts)
+FTS *fts_open(char * const *, int,
+ int (*)(const FTSENT * const *, const FTSENT * const *));
+FTSENT *fts_read(FTS *);
+int fts_set(FTS *, FTSENT *, int);
+void fts_set_clientptr(FTS *, void *);
+__END_DECLS
+
+#endif /* !_FTS_H_ */
diff --git a/src/include/g2c.h b/src/include/g2c.h
new file mode 100644
index 0000000..71e021d
--- /dev/null
+++ b/src/include/g2c.h
@@ -0,0 +1,236 @@
+/* g2c.h -- g77 version of f2c (Standard Fortran to C header file) */
+
+/* This file is generated by the g77 libg2c configuration process from a
+ file named g2c.hin. This process sets up the appropriate types,
+ defines the appropriate macros, and so on. The resulting g2c.h file
+ is used to build g77's copy of libf2c, named libg2c, and also can
+ be used when compiling C code produced by f2c to link the resulting
+ object file(s) with those produced by the same version of g77 that
+ produced this file, allowing inter-operability of f2c-compiled and
+ g77-compiled code. */
+
+/** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed."
+
+ - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */
+
+#ifndef F2C_INCLUDE
+#define F2C_INCLUDE
+
+/* F2C_INTEGER will normally be `int' but would be `long' on 16-bit systems */
+/* we assume short, float are OK */
+typedef int /* long int */ integer;
+typedef unsigned long int /* long */ uinteger;
+typedef char *address;
+typedef short int shortint;
+typedef float real;
+typedef double doublereal;
+typedef struct { real r, i; } complex;
+typedef struct { doublereal r, i; } doublecomplex;
+typedef int /* long int */ logical;
+typedef short int shortlogical;
+typedef char logical1;
+typedef char integer1;
+typedef long long int /* long long */ longint; /* system-dependent */
+typedef unsigned long long int /* long long */ ulongint; /* system-dependent */
+#define qbit_clear(a,b) ((a) & ~((ulongint)1 << (b)))
+#define qbit_set(a,b) ((a) | ((ulongint)1 << (b)))
+
+#define TRUE_ (1)
+#define FALSE_ (0)
+
+/* Extern is for use with -E */
+#ifndef Extern
+#define Extern extern
+#endif
+
+/* I/O stuff */
+
+#ifdef f2c_i2
+#error "f2c_i2 will not work with g77!!!!"
+/* for -i2 */
+typedef short flag;
+typedef short ftnlen;
+typedef short ftnint;
+#else
+typedef int /* long int */ flag;
+typedef int /* long int */ ftnlen;
+typedef int /* long int */ ftnint;
+#endif
+
+/*external read, write*/
+typedef struct
+{ flag cierr;
+ ftnint ciunit;
+ flag ciend;
+ char *cifmt;
+ ftnint cirec;
+} cilist;
+
+/*internal read, write*/
+typedef struct
+{ flag icierr;
+ char *iciunit;
+ flag iciend;
+ char *icifmt;
+ ftnint icirlen;
+ ftnint icirnum;
+} icilist;
+
+/*open*/
+typedef struct
+{ flag oerr;
+ ftnint ounit;
+ char *ofnm;
+ ftnlen ofnmlen;
+ char *osta;
+ char *oacc;
+ char *ofm;
+ ftnint orl;
+ char *oblnk;
+} olist;
+
+/*close*/
+typedef struct
+{ flag cerr;
+ ftnint cunit;
+ char *csta;
+} cllist;
+
+/*rewind, backspace, endfile*/
+typedef struct
+{ flag aerr;
+ ftnint aunit;
+} alist;
+
+/* inquire */
+typedef struct
+{ flag inerr;
+ ftnint inunit;
+ char *infile;
+ ftnlen infilen;
+ ftnint *inex; /*parameters in standard's order*/
+ ftnint *inopen;
+ ftnint *innum;
+ ftnint *innamed;
+ char *inname;
+ ftnlen innamlen;
+ char *inacc;
+ ftnlen inacclen;
+ char *inseq;
+ ftnlen inseqlen;
+ char *indir;
+ ftnlen indirlen;
+ char *infmt;
+ ftnlen infmtlen;
+ char *inform;
+ ftnint informlen;
+ char *inunf;
+ ftnlen inunflen;
+ ftnint *inrecl;
+ ftnint *innrec;
+ char *inblank;
+ ftnlen inblanklen;
+} inlist;
+
+#define VOID void
+
+union Multitype { /* for multiple entry points */
+ integer1 g;
+ shortint h;
+ integer i;
+ /* longint j; */
+ real r;
+ doublereal d;
+ complex c;
+ doublecomplex z;
+ };
+
+typedef union Multitype Multitype;
+
+/*typedef long int Long;*/ /* No longer used; formerly in Namelist */
+
+struct Vardesc { /* for Namelist */
+ char *name;
+ char *addr;
+ ftnlen *dims;
+ int type;
+ };
+typedef struct Vardesc Vardesc;
+
+struct Namelist {
+ char *name;
+ Vardesc **vars;
+ int nvars;
+ };
+typedef struct Namelist Namelist;
+
+#define abs(x) ((x) >= 0 ? (x) : -(x))
+#define dabs(x) (doublereal)abs(x)
+#define min(a,b) ((a) <= (b) ? (a) : (b))
+#define max(a,b) ((a) >= (b) ? (a) : (b))
+#define dmin(a,b) (doublereal)min(a,b)
+#define dmax(a,b) (doublereal)max(a,b)
+#define bit_test(a,b) ((a) >> (b) & 1)
+#define bit_clear(a,b) ((a) & ~((uinteger)1 << (b)))
+#define bit_set(a,b) ((a) | ((uinteger)1 << (b)))
+
+/* procedure parameter types for -A and -C++ */
+
+#define F2C_proc_par_types 1
+#ifdef __cplusplus
+typedef int /* Unknown procedure type */ (*U_fp)(...);
+typedef shortint (*J_fp)(...);
+typedef integer (*I_fp)(...);
+typedef real (*R_fp)(...);
+typedef doublereal (*D_fp)(...), (*E_fp)(...);
+typedef /* Complex */ VOID (*C_fp)(...);
+typedef /* Double Complex */ VOID (*Z_fp)(...);
+typedef logical (*L_fp)(...);
+typedef shortlogical (*K_fp)(...);
+typedef /* Character */ VOID (*H_fp)(...);
+typedef /* Subroutine */ int (*S_fp)(...);
+#else
+typedef int /* Unknown procedure type */ (*U_fp)();
+typedef shortint (*J_fp)();
+typedef integer (*I_fp)();
+typedef real (*R_fp)();
+typedef doublereal (*D_fp)(), (*E_fp)();
+typedef /* Complex */ VOID (*C_fp)();
+typedef /* Double Complex */ VOID (*Z_fp)();
+typedef logical (*L_fp)();
+typedef shortlogical (*K_fp)();
+typedef /* Character */ VOID (*H_fp)();
+typedef /* Subroutine */ int (*S_fp)();
+#endif
+/* E_fp is for real functions when -R is not specified */
+typedef VOID C_f; /* complex function */
+typedef VOID H_f; /* character function */
+typedef VOID Z_f; /* double complex function */
+typedef doublereal E_f; /* real function with -R not specified */
+
+/* undef any lower-case symbols that your C compiler predefines, e.g.: */
+
+#ifndef Skip_f2c_Undefs
+/* (No such symbols should be defined in a strict ANSI C compiler.
+ We can avoid trouble with f2c-translated code by using
+ gcc -ansi [-traditional].) */
+#undef cray
+#undef gcos
+#undef mc68010
+#undef mc68020
+#undef mips
+#undef pdp11
+#undef sgi
+#undef sparc
+#undef sun
+#undef sun2
+#undef sun3
+#undef sun4
+#undef u370
+#undef u3b
+#undef u3b2
+#undef u3b5
+#undef unix
+#undef vax
+#endif
+#endif
diff --git a/src/include/getopt.h b/src/include/getopt.h
new file mode 100644
index 0000000..ddacd89
--- /dev/null
+++ b/src/include/getopt.h
@@ -0,0 +1,85 @@
+/* $NetBSD: getopt.h,v 1.4 2000/07/07 10:43:54 ad Exp $ */
+/* $FreeBSD: src/include/getopt.h,v 1.6 2004/02/24 08:09:20 ache Exp $ */
+
+/*-
+ * Copyright (c) 2000 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Dieter Baron and Thomas Klausner.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _GETOPT_H_
+#define _GETOPT_H_
+
+#include
+
+/*
+ * GNU-like getopt_long()/getopt_long_only() with 4.4BSD optreset extension.
+ * getopt() is declared here too for GNU programs.
+ */
+#define no_argument 0
+#define required_argument 1
+#define optional_argument 2
+
+struct option {
+ /* name of long option */
+ const char *name;
+ /*
+ * one of no_argument, required_argument, and optional_argument:
+ * whether option takes an argument
+ */
+ int has_arg;
+ /* if not NULL, set *flag to val when option found */
+ int *flag;
+ /* if flag not NULL, value to set *flag to; else return value */
+ int val;
+};
+
+__BEGIN_DECLS
+int getopt_long(int, char * const *, const char *,
+ const struct option *, int *);
+int getopt_long_only(int, char * const *, const char *,
+ const struct option *, int *);
+#ifndef _GETOPT_DECLARED
+#define _GETOPT_DECLARED
+int getopt(int, char * const [], const char *);
+
+extern char *optarg; /* getopt(3) external variables */
+extern int optind, opterr, optopt;
+#endif
+#ifndef _OPTRESET_DECLARED
+#define _OPTRESET_DECLARED
+extern int optreset; /* getopt(3) external variable */
+#endif
+__END_DECLS
+
+#endif /* !_GETOPT_H_ */
diff --git a/src/include/glob.h b/src/include/glob.h
new file mode 100644
index 0000000..8a8d2aa
--- /dev/null
+++ b/src/include/glob.h
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Guido van Rossum.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)glob.h 8.1 (Berkeley) 6/2/93
+ * $FreeBSD: src/include/glob.h,v 1.7 2002/07/17 04:58:09 mikeh Exp $
+ */
+
+#ifndef _GLOB_H_
+#define _GLOB_H_
+
+#include
+
+struct stat;
+typedef struct {
+ int gl_pathc; /* Count of total paths so far. */
+ int gl_matchc; /* Count of paths matching pattern. */
+ int gl_offs; /* Reserved at beginning of gl_pathv. */
+ int gl_flags; /* Copy of flags parameter to glob. */
+ char **gl_pathv; /* List of paths matching pattern. */
+ /* Copy of errfunc parameter to glob. */
+ int (*gl_errfunc)(const char *, int);
+
+ /*
+ * Alternate filesystem access methods for glob; replacement
+ * versions of closedir(3), readdir(3), opendir(3), stat(2)
+ * and lstat(2).
+ */
+ void (*gl_closedir)(void *);
+ struct dirent *(*gl_readdir)(void *);
+ void *(*gl_opendir)(const char *);
+ int (*gl_lstat)(const char *, struct stat *);
+ int (*gl_stat)(const char *, struct stat *);
+} glob_t;
+
+#if __POSIX_VISIBLE >= 199209
+/* Believed to have been introduced in 1003.2-1992 */
+#define GLOB_APPEND 0x0001 /* Append to output from previous call. */
+#define GLOB_DOOFFS 0x0002 /* Use gl_offs. */
+#define GLOB_ERR 0x0004 /* Return on error. */
+#define GLOB_MARK 0x0008 /* Append / to matching directories. */
+#define GLOB_NOCHECK 0x0010 /* Return pattern itself if nothing matches. */
+#define GLOB_NOSORT 0x0020 /* Don't sort. */
+#define GLOB_NOESCAPE 0x2000 /* Disable backslash escaping. */
+
+/* Error values returned by glob(3) */
+#define GLOB_NOSPACE (-1) /* Malloc call failed. */
+#define GLOB_ABORTED (-2) /* Unignored error. */
+#define GLOB_NOMATCH (-3) /* No match and GLOB_NOCHECK was not set. */
+#define GLOB_NOSYS (-4) /* Obsolete: source comptability only. */
+#endif /* __POSIX_VISIBLE >= 199209 */
+
+#if __BSD_VISIBLE
+#define GLOB_ALTDIRFUNC 0x0040 /* Use alternately specified directory funcs. */
+#define GLOB_BRACE 0x0080 /* Expand braces ala csh. */
+#define GLOB_MAGCHAR 0x0100 /* Pattern had globbing characters. */
+#define GLOB_NOMAGIC 0x0200 /* GLOB_NOCHECK without magic chars (csh). */
+#define GLOB_QUOTE 0x0400 /* Quote special chars with \. */
+#define GLOB_TILDE 0x0800 /* Expand tilde names from the passwd file. */
+#define GLOB_LIMIT 0x1000 /* limit number of returned paths */
+
+/* source compatibility, these are the old names */
+#define GLOB_MAXPATH GLOB_LIMIT
+#define GLOB_ABEND GLOB_ABORTED
+#endif /* __BSD_VISIBLE */
+
+__BEGIN_DECLS
+int glob(const char *, int, int (*)(const char *, int), glob_t *);
+void globfree(glob_t *);
+__END_DECLS
+
+#endif /* !_GLOB_H_ */
diff --git a/src/include/gnuregex.h b/src/include/gnuregex.h
new file mode 100644
index 0000000..6767df4
--- /dev/null
+++ b/src/include/gnuregex.h
@@ -0,0 +1,33 @@
+/*-
+ * Copyright (c) 2004 David E. O'Brien
+ * Copyright (c) 2004 Andrey A. Chernov
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: src/gnu/lib/libregex/gnuregex.h,v 1.3 2004/02/25 10:56:54 ache Exp $
+ */
+
+#ifdef __GNUC__
+#warning "Use -I/usr/include/gnu and instead of "
+#endif
+#include
diff --git a/src/include/grp.h b/src/include/grp.h
new file mode 100644
index 0000000..55a57a7
--- /dev/null
+++ b/src/include/grp.h
@@ -0,0 +1,91 @@
+/*-
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)grp.h 8.2 (Berkeley) 1/21/94
+ * $FreeBSD: src/include/grp.h,v 1.18 2003/04/17 14:15:25 nectar Exp $
+ */
+
+#ifndef _GRP_H_
+#define _GRP_H_
+
+#include
+#include
+
+#define _PATH_GROUP "/etc/group"
+
+#ifndef _GID_T_DECLARED
+typedef __gid_t gid_t;
+#define _GID_T_DECLARED
+#endif
+
+#ifndef _SIZE_T_DECLARED
+typedef __size_t size_t;
+#define _SIZE_T_DECLARED
+#endif
+
+struct group {
+ char *gr_name; /* group name */
+ char *gr_passwd; /* group password */
+ gid_t gr_gid; /* group id */
+ char **gr_mem; /* group members */
+};
+
+__BEGIN_DECLS
+#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
+void endgrent(void);
+struct group *getgrent(void);
+#endif
+struct group *getgrgid(gid_t);
+struct group *getgrnam(const char *);
+#if __BSD_VISIBLE
+const char *group_from_gid(gid_t, int);
+#endif
+#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
+/* XXX IEEE Std 1003.1, 2003 specifies `void setgrent(void)' */
+int setgrent(void);
+int getgrgid_r(gid_t, struct group *, char *, size_t,
+ struct group **);
+int getgrnam_r(const char *, struct group *, char *, size_t,
+ struct group **);
+#endif
+#if __BSD_VISIBLE
+int getgrent_r(struct group *, char *, size_t, struct group **);
+int setgroupent(int);
+#endif
+__END_DECLS
+
+#endif /* !_GRP_H_ */
diff --git a/src/include/gssapi.h b/src/include/gssapi.h
new file mode 100644
index 0000000..4935651
--- /dev/null
+++ b/src/include/gssapi.h
@@ -0,0 +1,788 @@
+/*
+ * Copyright (c) 1997 - 2003 Kungliga Tekniska H�gskolan
+ * (Royal Institute of Technology, Stockholm, Sweden).
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of the Institute nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/* $Id$ */
+
+#ifndef GSSAPI_H_
+#define GSSAPI_H_
+
+/*
+ * First, include stddef.h to get size_t defined.
+ */
+#include
+
+#include
+
+/*
+ * Now define the three implementation-dependent types.
+ */
+
+typedef u_int32_t OM_uint32;
+
+typedef u_int32_t gss_uint32;
+
+/*
+ * This is to avoid having to include
+ */
+
+struct krb5_auth_context_data;
+
+struct Principal;
+
+/* typedef void *gss_name_t; */
+
+typedef struct Principal *gss_name_t;
+
+typedef struct gss_ctx_id_t_desc_struct {
+ struct krb5_auth_context_data *auth_context;
+ gss_name_t source, target;
+ OM_uint32 flags;
+ enum { LOCAL = 1, OPEN = 2,
+ COMPAT_OLD_DES3 = 4, COMPAT_OLD_DES3_SELECTED = 8 } more_flags;
+ struct krb5_ticket *ticket;
+ time_t lifetime;
+} gss_ctx_id_t_desc;
+
+typedef gss_ctx_id_t_desc *gss_ctx_id_t;
+
+typedef struct gss_OID_desc_struct {
+ OM_uint32 length;
+ void *elements;
+} gss_OID_desc, *gss_OID;
+
+typedef struct gss_OID_set_desc_struct {
+ size_t count;
+ gss_OID elements;
+} gss_OID_set_desc, *gss_OID_set;
+
+struct krb5_keytab_data;
+
+struct krb5_ccache_data;
+
+typedef int gss_cred_usage_t;
+
+typedef struct gss_cred_id_t_desc_struct {
+ gss_name_t principal;
+ struct krb5_keytab_data *keytab;
+ OM_uint32 lifetime;
+ gss_cred_usage_t usage;
+ gss_OID_set mechanisms;
+ struct krb5_ccache_data *ccache;
+} gss_cred_id_t_desc;
+
+typedef gss_cred_id_t_desc *gss_cred_id_t;
+
+typedef struct gss_buffer_desc_struct {
+ size_t length;
+ void *value;
+} gss_buffer_desc, *gss_buffer_t;
+
+typedef struct gss_channel_bindings_struct {
+ OM_uint32 initiator_addrtype;
+ gss_buffer_desc initiator_address;
+ OM_uint32 acceptor_addrtype;
+ gss_buffer_desc acceptor_address;
+ gss_buffer_desc application_data;
+} *gss_channel_bindings_t;
+
+/*
+ * For now, define a QOP-type as an OM_uint32
+ */
+typedef OM_uint32 gss_qop_t;
+
+/*
+ * Flag bits for context-level services.
+ */
+#define GSS_C_DELEG_FLAG 1
+#define GSS_C_MUTUAL_FLAG 2
+#define GSS_C_REPLAY_FLAG 4
+#define GSS_C_SEQUENCE_FLAG 8
+#define GSS_C_CONF_FLAG 16
+#define GSS_C_INTEG_FLAG 32
+#define GSS_C_ANON_FLAG 64
+#define GSS_C_PROT_READY_FLAG 128
+#define GSS_C_TRANS_FLAG 256
+
+/*
+ * Credential usage options
+ */
+#define GSS_C_BOTH 0
+#define GSS_C_INITIATE 1
+#define GSS_C_ACCEPT 2
+
+/*
+ * Status code types for gss_display_status
+ */
+#define GSS_C_GSS_CODE 1
+#define GSS_C_MECH_CODE 2
+
+/*
+ * The constant definitions for channel-bindings address families
+ */
+#define GSS_C_AF_UNSPEC 0
+#define GSS_C_AF_LOCAL 1
+#define GSS_C_AF_INET 2
+#define GSS_C_AF_IMPLINK 3
+#define GSS_C_AF_PUP 4
+#define GSS_C_AF_CHAOS 5
+#define GSS_C_AF_NS 6
+#define GSS_C_AF_NBS 7
+#define GSS_C_AF_ECMA 8
+#define GSS_C_AF_DATAKIT 9
+#define GSS_C_AF_CCITT 10
+#define GSS_C_AF_SNA 11
+#define GSS_C_AF_DECnet 12
+#define GSS_C_AF_DLI 13
+#define GSS_C_AF_LAT 14
+#define GSS_C_AF_HYLINK 15
+#define GSS_C_AF_APPLETALK 16
+#define GSS_C_AF_BSC 17
+#define GSS_C_AF_DSS 18
+#define GSS_C_AF_OSI 19
+#define GSS_C_AF_X25 21
+#define GSS_C_AF_INET6 24
+
+#define GSS_C_AF_NULLADDR 255
+
+/*
+ * Various Null values
+ */
+#define GSS_C_NO_NAME ((gss_name_t) 0)
+#define GSS_C_NO_BUFFER ((gss_buffer_t) 0)
+#define GSS_C_NO_OID ((gss_OID) 0)
+#define GSS_C_NO_OID_SET ((gss_OID_set) 0)
+#define GSS_C_NO_CONTEXT ((gss_ctx_id_t) 0)
+#define GSS_C_NO_CREDENTIAL ((gss_cred_id_t) 0)
+#define GSS_C_NO_CHANNEL_BINDINGS ((gss_channel_bindings_t) 0)
+#define GSS_C_EMPTY_BUFFER {0, NULL}
+
+/*
+ * Some alternate names for a couple of the above
+ * values. These are defined for V1 compatibility.
+ */
+#define GSS_C_NULL_OID GSS_C_NO_OID
+#define GSS_C_NULL_OID_SET GSS_C_NO_OID_SET
+
+/*
+ * Define the default Quality of Protection for per-message
+ * services. Note that an implementation that offers multiple
+ * levels of QOP may define GSS_C_QOP_DEFAULT to be either zero
+ * (as done here) to mean "default protection", or to a specific
+ * explicit QOP value. However, a value of 0 should always be
+ * interpreted by a GSSAPI implementation as a request for the
+ * default protection level.
+ */
+#define GSS_C_QOP_DEFAULT 0
+
+#define GSS_KRB5_CONF_C_QOP_DES 0x0100
+#define GSS_KRB5_CONF_C_QOP_DES3_KD 0x0200
+
+/*
+ * Expiration time of 2^32-1 seconds means infinite lifetime for a
+ * credential or security context
+ */
+#define GSS_C_INDEFINITE 0xfffffffful
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * The implementation must reserve static storage for a
+ * gss_OID_desc object containing the value
+ * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
+ * "\x01\x02\x01\x01"},
+ * corresponding to an object-identifier value of
+ * {iso(1) member-body(2) United States(840) mit(113554)
+ * infosys(1) gssapi(2) generic(1) user_name(1)}. The constant
+ * GSS_C_NT_USER_NAME should be initialized to point
+ * to that gss_OID_desc.
+ */
+extern gss_OID GSS_C_NT_USER_NAME;
+
+/*
+ * The implementation must reserve static storage for a
+ * gss_OID_desc object containing the value
+ * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
+ * "\x01\x02\x01\x02"},
+ * corresponding to an object-identifier value of
+ * {iso(1) member-body(2) United States(840) mit(113554)
+ * infosys(1) gssapi(2) generic(1) machine_uid_name(2)}.
+ * The constant GSS_C_NT_MACHINE_UID_NAME should be
+ * initialized to point to that gss_OID_desc.
+ */
+extern gss_OID GSS_C_NT_MACHINE_UID_NAME;
+
+/*
+ * The implementation must reserve static storage for a
+ * gss_OID_desc object containing the value
+ * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
+ * "\x01\x02\x01\x03"},
+ * corresponding to an object-identifier value of
+ * {iso(1) member-body(2) United States(840) mit(113554)
+ * infosys(1) gssapi(2) generic(1) string_uid_name(3)}.
+ * The constant GSS_C_NT_STRING_UID_NAME should be
+ * initialized to point to that gss_OID_desc.
+ */
+extern gss_OID GSS_C_NT_STRING_UID_NAME;
+
+/*
+ * The implementation must reserve static storage for a
+ * gss_OID_desc object containing the value
+ * {6, (void *)"\x2b\x06\x01\x05\x06\x02"},
+ * corresponding to an object-identifier value of
+ * {iso(1) org(3) dod(6) internet(1) security(5)
+ * nametypes(6) gss-host-based-services(2)). The constant
+ * GSS_C_NT_HOSTBASED_SERVICE_X should be initialized to point
+ * to that gss_OID_desc. This is a deprecated OID value, and
+ * implementations wishing to support hostbased-service names
+ * should instead use the GSS_C_NT_HOSTBASED_SERVICE OID,
+ * defined below, to identify such names;
+ * GSS_C_NT_HOSTBASED_SERVICE_X should be accepted a synonym
+ * for GSS_C_NT_HOSTBASED_SERVICE when presented as an input
+ * parameter, but should not be emitted by GSS-API
+ * implementations
+ */
+extern gss_OID GSS_C_NT_HOSTBASED_SERVICE_X;
+
+/*
+ * The implementation must reserve static storage for a
+ * gss_OID_desc object containing the value
+ * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
+ * "\x01\x02\x01\x04"}, corresponding to an
+ * object-identifier value of {iso(1) member-body(2)
+ * Unites States(840) mit(113554) infosys(1) gssapi(2)
+ * generic(1) service_name(4)}. The constant
+ * GSS_C_NT_HOSTBASED_SERVICE should be initialized
+ * to point to that gss_OID_desc.
+ */
+extern gss_OID GSS_C_NT_HOSTBASED_SERVICE;
+
+/*
+ * The implementation must reserve static storage for a
+ * gss_OID_desc object containing the value
+ * {6, (void *)"\x2b\x06\01\x05\x06\x03"},
+ * corresponding to an object identifier value of
+ * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
+ * 6(nametypes), 3(gss-anonymous-name)}. The constant
+ * and GSS_C_NT_ANONYMOUS should be initialized to point
+ * to that gss_OID_desc.
+ */
+extern gss_OID GSS_C_NT_ANONYMOUS;
+
+/*
+ * The implementation must reserve static storage for a
+ * gss_OID_desc object containing the value
+ * {6, (void *)"\x2b\x06\x01\x05\x06\x04"},
+ * corresponding to an object-identifier value of
+ * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
+ * 6(nametypes), 4(gss-api-exported-name)}. The constant
+ * GSS_C_NT_EXPORT_NAME should be initialized to point
+ * to that gss_OID_desc.
+ */
+extern gss_OID GSS_C_NT_EXPORT_NAME;
+
+/*
+ * This if for kerberos5 names.
+ */
+
+extern gss_OID GSS_KRB5_NT_PRINCIPAL_NAME;
+extern gss_OID GSS_KRB5_NT_USER_NAME;
+extern gss_OID GSS_KRB5_NT_MACHINE_UID_NAME;
+extern gss_OID GSS_KRB5_NT_STRING_UID_NAME;
+
+extern gss_OID GSS_KRB5_MECHANISM;
+
+/* for compatibility with MIT api */
+
+#define gss_mech_krb5 GSS_KRB5_MECHANISM
+
+/* Major status codes */
+
+#define GSS_S_COMPLETE 0
+
+/*
+ * Some "helper" definitions to make the status code macros obvious.
+ */
+#define GSS_C_CALLING_ERROR_OFFSET 24
+#define GSS_C_ROUTINE_ERROR_OFFSET 16
+#define GSS_C_SUPPLEMENTARY_OFFSET 0
+#define GSS_C_CALLING_ERROR_MASK 0377ul
+#define GSS_C_ROUTINE_ERROR_MASK 0377ul
+#define GSS_C_SUPPLEMENTARY_MASK 0177777ul
+
+/*
+ * The macros that test status codes for error conditions.
+ * Note that the GSS_ERROR() macro has changed slightly from
+ * the V1 GSSAPI so that it now evaluates its argument
+ * only once.
+ */
+#define GSS_CALLING_ERROR(x) \
+ (x & (GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET))
+#define GSS_ROUTINE_ERROR(x) \
+ (x & (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET))
+#define GSS_SUPPLEMENTARY_INFO(x) \
+ (x & (GSS_C_SUPPLEMENTARY_MASK << GSS_C_SUPPLEMENTARY_OFFSET))
+#define GSS_ERROR(x) \
+ (x & ((GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET) | \
+ (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET)))
+
+/*
+ * Now the actual status code definitions
+ */
+
+/*
+ * Calling errors:
+ */
+#define GSS_S_CALL_INACCESSIBLE_READ \
+ (1ul << GSS_C_CALLING_ERROR_OFFSET)
+#define GSS_S_CALL_INACCESSIBLE_WRITE \
+ (2ul << GSS_C_CALLING_ERROR_OFFSET)
+#define GSS_S_CALL_BAD_STRUCTURE \
+ (3ul << GSS_C_CALLING_ERROR_OFFSET)
+
+/*
+ * Routine errors:
+ */
+#define GSS_S_BAD_MECH (1ul << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_BAD_NAME (2ul << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_BAD_NAMETYPE (3ul << GSS_C_ROUTINE_ERROR_OFFSET)
+
+#define GSS_S_BAD_BINDINGS (4ul << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_BAD_STATUS (5ul << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_BAD_SIG (6ul << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_BAD_MIC GSS_S_BAD_SIG
+#define GSS_S_NO_CRED (7ul << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_NO_CONTEXT (8ul << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_DEFECTIVE_TOKEN (9ul << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_DEFECTIVE_CREDENTIAL (10ul << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_CREDENTIALS_EXPIRED (11ul << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_CONTEXT_EXPIRED (12ul << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_FAILURE (13ul << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_BAD_QOP (14ul << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_UNAUTHORIZED (15ul << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_UNAVAILABLE (16ul << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_DUPLICATE_ELEMENT (17ul << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_NAME_NOT_MN (18ul << GSS_C_ROUTINE_ERROR_OFFSET)
+
+/*
+ * Supplementary info bits:
+ */
+#define GSS_S_CONTINUE_NEEDED (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 0))
+#define GSS_S_DUPLICATE_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 1))
+#define GSS_S_OLD_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 2))
+#define GSS_S_UNSEQ_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 3))
+#define GSS_S_GAP_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 4))
+
+/*
+ * From RFC1964:
+ *
+ * 4.1.1. Non-Kerberos-specific codes
+ */
+
+#define GSS_KRB5_S_G_BAD_SERVICE_NAME 1
+ /* "No @ in SERVICE-NAME name string" */
+#define GSS_KRB5_S_G_BAD_STRING_UID 2
+ /* "STRING-UID-NAME contains nondigits" */
+#define GSS_KRB5_S_G_NOUSER 3
+ /* "UID does not resolve to username" */
+#define GSS_KRB5_S_G_VALIDATE_FAILED 4
+ /* "Validation error" */
+#define GSS_KRB5_S_G_BUFFER_ALLOC 5
+ /* "Couldn't allocate gss_buffer_t data" */
+#define GSS_KRB5_S_G_BAD_MSG_CTX 6
+ /* "Message context invalid" */
+#define GSS_KRB5_S_G_WRONG_SIZE 7
+ /* "Buffer is the wrong size" */
+#define GSS_KRB5_S_G_BAD_USAGE 8
+ /* "Credential usage type is unknown" */
+#define GSS_KRB5_S_G_UNKNOWN_QOP 9
+ /* "Unknown quality of protection specified" */
+
+ /*
+ * 4.1.2. Kerberos-specific-codes
+ */
+
+#define GSS_KRB5_S_KG_CCACHE_NOMATCH 10
+ /* "Principal in credential cache does not match desired name" */
+#define GSS_KRB5_S_KG_KEYTAB_NOMATCH 11
+ /* "No principal in keytab matches desired name" */
+#define GSS_KRB5_S_KG_TGT_MISSING 12
+ /* "Credential cache has no TGT" */
+#define GSS_KRB5_S_KG_NO_SUBKEY 13
+ /* "Authenticator has no subkey" */
+#define GSS_KRB5_S_KG_CONTEXT_ESTABLISHED 14
+ /* "Context is already fully established" */
+#define GSS_KRB5_S_KG_BAD_SIGN_TYPE 15
+ /* "Unknown signature type in token" */
+#define GSS_KRB5_S_KG_BAD_LENGTH 16
+ /* "Invalid field length in token" */
+#define GSS_KRB5_S_KG_CTX_INCOMPLETE 17
+ /* "Attempt to use incomplete security context" */
+
+/*
+ * Finally, function prototypes for the GSS-API routines.
+ */
+
+OM_uint32 gss_acquire_cred
+ (OM_uint32 * /*minor_status*/,
+ const gss_name_t /*desired_name*/,
+ OM_uint32 /*time_req*/,
+ const gss_OID_set /*desired_mechs*/,
+ gss_cred_usage_t /*cred_usage*/,
+ gss_cred_id_t * /*output_cred_handle*/,
+ gss_OID_set * /*actual_mechs*/,
+ OM_uint32 * /*time_rec*/
+ );
+
+OM_uint32 gss_release_cred
+ (OM_uint32 * /*minor_status*/,
+ gss_cred_id_t * /*cred_handle*/
+ );
+
+OM_uint32 gss_init_sec_context
+ (OM_uint32 * /*minor_status*/,
+ const gss_cred_id_t /*initiator_cred_handle*/,
+ gss_ctx_id_t * /*context_handle*/,
+ const gss_name_t /*target_name*/,
+ const gss_OID /*mech_type*/,
+ OM_uint32 /*req_flags*/,
+ OM_uint32 /*time_req*/,
+ const gss_channel_bindings_t /*input_chan_bindings*/,
+ const gss_buffer_t /*input_token*/,
+ gss_OID * /*actual_mech_type*/,
+ gss_buffer_t /*output_token*/,
+ OM_uint32 * /*ret_flags*/,
+ OM_uint32 * /*time_rec*/
+ );
+
+OM_uint32 gss_accept_sec_context
+ (OM_uint32 * /*minor_status*/,
+ gss_ctx_id_t * /*context_handle*/,
+ const gss_cred_id_t /*acceptor_cred_handle*/,
+ const gss_buffer_t /*input_token_buffer*/,
+ const gss_channel_bindings_t /*input_chan_bindings*/,
+ gss_name_t * /*src_name*/,
+ gss_OID * /*mech_type*/,
+ gss_buffer_t /*output_token*/,
+ OM_uint32 * /*ret_flags*/,
+ OM_uint32 * /*time_rec*/,
+ gss_cred_id_t * /*delegated_cred_handle*/
+ );
+
+OM_uint32 gss_process_context_token
+ (OM_uint32 * /*minor_status*/,
+ const gss_ctx_id_t /*context_handle*/,
+ const gss_buffer_t /*token_buffer*/
+ );
+
+OM_uint32 gss_delete_sec_context
+ (OM_uint32 * /*minor_status*/,
+ gss_ctx_id_t * /*context_handle*/,
+ gss_buffer_t /*output_token*/
+ );
+
+OM_uint32 gss_context_time
+ (OM_uint32 * /*minor_status*/,
+ const gss_ctx_id_t /*context_handle*/,
+ OM_uint32 * /*time_rec*/
+ );
+
+OM_uint32 gss_get_mic
+ (OM_uint32 * /*minor_status*/,
+ const gss_ctx_id_t /*context_handle*/,
+ gss_qop_t /*qop_req*/,
+ const gss_buffer_t /*message_buffer*/,
+ gss_buffer_t /*message_token*/
+ );
+
+OM_uint32 gss_verify_mic
+ (OM_uint32 * /*minor_status*/,
+ const gss_ctx_id_t /*context_handle*/,
+ const gss_buffer_t /*message_buffer*/,
+ const gss_buffer_t /*token_buffer*/,
+ gss_qop_t * /*qop_state*/
+ );
+
+OM_uint32 gss_wrap
+ (OM_uint32 * /*minor_status*/,
+ const gss_ctx_id_t /*context_handle*/,
+ int /*conf_req_flag*/,
+ gss_qop_t /*qop_req*/,
+ const gss_buffer_t /*input_message_buffer*/,
+ int * /*conf_state*/,
+ gss_buffer_t /*output_message_buffer*/
+ );
+
+OM_uint32 gss_unwrap
+ (OM_uint32 * /*minor_status*/,
+ const gss_ctx_id_t /*context_handle*/,
+ const gss_buffer_t /*input_message_buffer*/,
+ gss_buffer_t /*output_message_buffer*/,
+ int * /*conf_state*/,
+ gss_qop_t * /*qop_state*/
+ );
+
+OM_uint32 gss_display_status
+ (OM_uint32 * /*minor_status*/,
+ OM_uint32 /*status_value*/,
+ int /*status_type*/,
+ const gss_OID /*mech_type*/,
+ OM_uint32 * /*message_context*/,
+ gss_buffer_t /*status_string*/
+ );
+
+OM_uint32 gss_indicate_mechs
+ (OM_uint32 * /*minor_status*/,
+ gss_OID_set * /*mech_set*/
+ );
+
+OM_uint32 gss_compare_name
+ (OM_uint32 * /*minor_status*/,
+ const gss_name_t /*name1*/,
+ const gss_name_t /*name2*/,
+ int * /*name_equal*/
+ );
+
+OM_uint32 gss_display_name
+ (OM_uint32 * /*minor_status*/,
+ const gss_name_t /*input_name*/,
+ gss_buffer_t /*output_name_buffer*/,
+ gss_OID * /*output_name_type*/
+ );
+
+OM_uint32 gss_import_name
+ (OM_uint32 * /*minor_status*/,
+ const gss_buffer_t /*input_name_buffer*/,
+ const gss_OID /*input_name_type*/,
+ gss_name_t * /*output_name*/
+ );
+
+OM_uint32 gss_export_name
+ (OM_uint32 * /*minor_status*/,
+ const gss_name_t /*input_name*/,
+ gss_buffer_t /*exported_name*/
+ );
+
+OM_uint32 gss_release_name
+ (OM_uint32 * /*minor_status*/,
+ gss_name_t * /*input_name*/
+ );
+
+OM_uint32 gss_release_buffer
+ (OM_uint32 * /*minor_status*/,
+ gss_buffer_t /*buffer*/
+ );
+
+OM_uint32 gss_release_oid_set
+ (OM_uint32 * /*minor_status*/,
+ gss_OID_set * /*set*/
+ );
+
+OM_uint32 gss_inquire_cred
+ (OM_uint32 * /*minor_status*/,
+ const gss_cred_id_t /*cred_handle*/,
+ gss_name_t * /*name*/,
+ OM_uint32 * /*lifetime*/,
+ gss_cred_usage_t * /*cred_usage*/,
+ gss_OID_set * /*mechanisms*/
+ );
+
+OM_uint32 gss_inquire_context (
+ OM_uint32 * /*minor_status*/,
+ const gss_ctx_id_t /*context_handle*/,
+ gss_name_t * /*src_name*/,
+ gss_name_t * /*targ_name*/,
+ OM_uint32 * /*lifetime_rec*/,
+ gss_OID * /*mech_type*/,
+ OM_uint32 * /*ctx_flags*/,
+ int * /*locally_initiated*/,
+ int * /*open_context*/
+ );
+
+OM_uint32 gss_wrap_size_limit (
+ OM_uint32 * /*minor_status*/,
+ const gss_ctx_id_t /*context_handle*/,
+ int /*conf_req_flag*/,
+ gss_qop_t /*qop_req*/,
+ OM_uint32 /*req_output_size*/,
+ OM_uint32 * /*max_input_size*/
+ );
+
+OM_uint32 gss_add_cred (
+ OM_uint32 * /*minor_status*/,
+ const gss_cred_id_t /*input_cred_handle*/,
+ const gss_name_t /*desired_name*/,
+ const gss_OID /*desired_mech*/,
+ gss_cred_usage_t /*cred_usage*/,
+ OM_uint32 /*initiator_time_req*/,
+ OM_uint32 /*acceptor_time_req*/,
+ gss_cred_id_t * /*output_cred_handle*/,
+ gss_OID_set * /*actual_mechs*/,
+ OM_uint32 * /*initiator_time_rec*/,
+ OM_uint32 * /*acceptor_time_rec*/
+ );
+
+OM_uint32 gss_inquire_cred_by_mech (
+ OM_uint32 * /*minor_status*/,
+ const gss_cred_id_t /*cred_handle*/,
+ const gss_OID /*mech_type*/,
+ gss_name_t * /*name*/,
+ OM_uint32 * /*initiator_lifetime*/,
+ OM_uint32 * /*acceptor_lifetime*/,
+ gss_cred_usage_t * /*cred_usage*/
+ );
+
+OM_uint32 gss_export_sec_context (
+ OM_uint32 * /*minor_status*/,
+ gss_ctx_id_t * /*context_handle*/,
+ gss_buffer_t /*interprocess_token*/
+ );
+
+OM_uint32 gss_import_sec_context (
+ OM_uint32 * /*minor_status*/,
+ const gss_buffer_t /*interprocess_token*/,
+ gss_ctx_id_t * /*context_handle*/
+ );
+
+OM_uint32 gss_create_empty_oid_set (
+ OM_uint32 * /*minor_status*/,
+ gss_OID_set * /*oid_set*/
+ );
+
+OM_uint32 gss_add_oid_set_member (
+ OM_uint32 * /*minor_status*/,
+ const gss_OID /*member_oid*/,
+ gss_OID_set * /*oid_set*/
+ );
+
+OM_uint32 gss_test_oid_set_member (
+ OM_uint32 * /*minor_status*/,
+ const gss_OID /*member*/,
+ const gss_OID_set /*set*/,
+ int * /*present*/
+ );
+
+OM_uint32 gss_inquire_names_for_mech (
+ OM_uint32 * /*minor_status*/,
+ const gss_OID /*mechanism*/,
+ gss_OID_set * /*name_types*/
+ );
+
+OM_uint32 gss_inquire_mechs_for_name (
+ OM_uint32 * /*minor_status*/,
+ const gss_name_t /*input_name*/,
+ gss_OID_set * /*mech_types*/
+ );
+
+OM_uint32 gss_canonicalize_name (
+ OM_uint32 * /*minor_status*/,
+ const gss_name_t /*input_name*/,
+ const gss_OID /*mech_type*/,
+ gss_name_t * /*output_name*/
+ );
+
+OM_uint32 gss_duplicate_name (
+ OM_uint32 * /*minor_status*/,
+ const gss_name_t /*src_name*/,
+ gss_name_t * /*dest_name*/
+ );
+
+/*
+ * The following routines are obsolete variants of gss_get_mic,
+ * gss_verify_mic, gss_wrap and gss_unwrap. They should be
+ * provided by GSSAPI V2 implementations for backwards
+ * compatibility with V1 applications. Distinct entrypoints
+ * (as opposed to #defines) should be provided, both to allow
+ * GSSAPI V1 applications to link against GSSAPI V2 implementations,
+ * and to retain the slight parameter type differences between the
+ * obsolete versions of these routines and their current forms.
+ */
+
+OM_uint32 gss_sign
+ (OM_uint32 * /*minor_status*/,
+ gss_ctx_id_t /*context_handle*/,
+ int /*qop_req*/,
+ gss_buffer_t /*message_buffer*/,
+ gss_buffer_t /*message_token*/
+ );
+
+OM_uint32 gss_verify
+ (OM_uint32 * /*minor_status*/,
+ gss_ctx_id_t /*context_handle*/,
+ gss_buffer_t /*message_buffer*/,
+ gss_buffer_t /*token_buffer*/,
+ int * /*qop_state*/
+ );
+
+OM_uint32 gss_seal
+ (OM_uint32 * /*minor_status*/,
+ gss_ctx_id_t /*context_handle*/,
+ int /*conf_req_flag*/,
+ int /*qop_req*/,
+ gss_buffer_t /*input_message_buffer*/,
+ int * /*conf_state*/,
+ gss_buffer_t /*output_message_buffer*/
+ );
+
+OM_uint32 gss_unseal
+ (OM_uint32 * /*minor_status*/,
+ gss_ctx_id_t /*context_handle*/,
+ gss_buffer_t /*input_message_buffer*/,
+ gss_buffer_t /*output_message_buffer*/,
+ int * /*conf_state*/,
+ int * /*qop_state*/
+ );
+
+/*
+ * kerberos mechanism specific functions
+ */
+
+OM_uint32 gsskrb5_register_acceptor_identity
+ (const char */*identity*/);
+
+OM_uint32 gss_krb5_copy_ccache
+ (OM_uint32 */*minor*/,
+ gss_cred_id_t /*cred*/,
+ struct krb5_ccache_data */*out*/);
+
+#define GSS_C_KRB5_COMPAT_DES3_MIC 1
+
+OM_uint32
+gss_krb5_compat_des3_mic(OM_uint32 *, gss_ctx_id_t, int);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GSSAPI_H_ */
diff --git a/src/include/hdb-private.h b/src/include/hdb-private.h
new file mode 100644
index 0000000..a47de70
--- /dev/null
+++ b/src/include/hdb-private.h
@@ -0,0 +1,27 @@
+/* This is a generated file */
+#ifndef __hdb_private_h__
+#define __hdb_private_h__
+
+#include
+
+krb5_error_code
+_hdb_fetch (
+ krb5_context /*context*/,
+ HDB */*db*/,
+ unsigned /*flags*/,
+ hdb_entry */*entry*/);
+
+krb5_error_code
+_hdb_remove (
+ krb5_context /*context*/,
+ HDB */*db*/,
+ hdb_entry */*entry*/);
+
+krb5_error_code
+_hdb_store (
+ krb5_context /*context*/,
+ HDB */*db*/,
+ unsigned /*flags*/,
+ hdb_entry */*entry*/);
+
+#endif /* __hdb_private_h__ */
diff --git a/src/include/hdb-protos.h b/src/include/hdb-protos.h
new file mode 100644
index 0000000..ce85fcb
--- /dev/null
+++ b/src/include/hdb-protos.h
@@ -0,0 +1,188 @@
+/* This is a generated file */
+#ifndef __hdb_protos_h__
+#define __hdb_protos_h__
+
+#include
+
+krb5_error_code
+hdb_add_master_key (
+ krb5_context /*context*/,
+ krb5_keyblock */*key*/,
+ hdb_master_key */*inout*/);
+
+krb5_error_code
+hdb_check_db_format (
+ krb5_context /*context*/,
+ HDB */*db*/);
+
+krb5_error_code
+hdb_clear_master_key (
+ krb5_context /*context*/,
+ HDB */*db*/);
+
+krb5_error_code
+hdb_create (
+ krb5_context /*context*/,
+ HDB **/*db*/,
+ const char */*filename*/);
+
+krb5_error_code
+hdb_db_create (
+ krb5_context /*context*/,
+ HDB **/*db*/,
+ const char */*filename*/);
+
+krb5_error_code
+hdb_enctype2key (
+ krb5_context /*context*/,
+ hdb_entry */*e*/,
+ krb5_enctype /*enctype*/,
+ Key **/*key*/);
+
+krb5_error_code
+hdb_entry2string (
+ krb5_context /*context*/,
+ hdb_entry */*ent*/,
+ char **/*str*/);
+
+int
+hdb_entry2value (
+ krb5_context /*context*/,
+ hdb_entry */*ent*/,
+ krb5_data */*value*/);
+
+krb5_error_code
+hdb_foreach (
+ krb5_context /*context*/,
+ HDB */*db*/,
+ unsigned /*flags*/,
+ hdb_foreach_func_t /*func*/,
+ void */*data*/);
+
+void
+hdb_free_entry (
+ krb5_context /*context*/,
+ hdb_entry */*ent*/);
+
+void
+hdb_free_key (Key */*key*/);
+
+void
+hdb_free_master_key (
+ krb5_context /*context*/,
+ hdb_master_key /*mkey*/);
+
+krb5_error_code
+hdb_init_db (
+ krb5_context /*context*/,
+ HDB */*db*/);
+
+int
+hdb_key2principal (
+ krb5_context /*context*/,
+ krb5_data */*key*/,
+ krb5_principal /*p*/);
+
+krb5_error_code
+hdb_ldap_create (
+ krb5_context /*context*/,
+ HDB ** /*db*/,
+ const char */*arg*/);
+
+krb5_error_code
+hdb_lock (
+ int /*fd*/,
+ int /*operation*/);
+
+krb5_error_code
+hdb_ndbm_create (
+ krb5_context /*context*/,
+ HDB **/*db*/,
+ const char */*filename*/);
+
+krb5_error_code
+hdb_next_enctype2key (
+ krb5_context /*context*/,
+ const hdb_entry */*e*/,
+ krb5_enctype /*enctype*/,
+ Key **/*key*/);
+
+int
+hdb_principal2key (
+ krb5_context /*context*/,
+ krb5_principal /*p*/,
+ krb5_data */*key*/);
+
+krb5_error_code
+hdb_print_entry (
+ krb5_context /*context*/,
+ HDB */*db*/,
+ hdb_entry */*entry*/,
+ void */*data*/);
+
+krb5_error_code
+hdb_process_master_key (
+ krb5_context /*context*/,
+ int /*kvno*/,
+ krb5_keyblock */*key*/,
+ krb5_enctype /*etype*/,
+ hdb_master_key */*mkey*/);
+
+krb5_error_code
+hdb_read_master_key (
+ krb5_context /*context*/,
+ const char */*filename*/,
+ hdb_master_key */*mkey*/);
+
+krb5_error_code
+hdb_seal_keys (
+ krb5_context /*context*/,
+ HDB */*db*/,
+ hdb_entry */*ent*/);
+
+krb5_error_code
+hdb_seal_keys_mkey (
+ krb5_context /*context*/,
+ hdb_entry */*ent*/,
+ hdb_master_key /*mkey*/);
+
+krb5_error_code
+hdb_set_master_key (
+ krb5_context /*context*/,
+ HDB */*db*/,
+ krb5_keyblock */*key*/);
+
+krb5_error_code
+hdb_set_master_keyfile (
+ krb5_context /*context*/,
+ HDB */*db*/,
+ const char */*keyfile*/);
+
+krb5_error_code
+hdb_unlock (int /*fd*/);
+
+krb5_error_code
+hdb_unseal_keys (
+ krb5_context /*context*/,
+ HDB */*db*/,
+ hdb_entry */*ent*/);
+
+krb5_error_code
+hdb_unseal_keys_mkey (
+ krb5_context /*context*/,
+ hdb_entry */*ent*/,
+ hdb_master_key /*mkey*/);
+
+int
+hdb_value2entry (
+ krb5_context /*context*/,
+ krb5_data */*value*/,
+ hdb_entry */*ent*/);
+
+krb5_error_code
+hdb_write_master_key (
+ krb5_context /*context*/,
+ const char */*filename*/,
+ hdb_master_key /*mkey*/);
+
+#endif /* __hdb_protos_h__ */
diff --git a/src/include/hdb.h b/src/include/hdb.h
new file mode 100644
index 0000000..ed836fa
--- /dev/null
+++ b/src/include/hdb.h
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 1997 - 2000 Kungliga Tekniska H�gskolan
+ * (Royal Institute of Technology, Stockholm, Sweden).
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of the Institute nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/* $Id$ */
+
+#ifndef __HDB_H__
+#define __HDB_H__
+
+#include
+
+#include
+
+enum hdb_lockop{ HDB_RLOCK, HDB_WLOCK };
+
+/* flags for various functions */
+#define HDB_F_DECRYPT 1 /* decrypt keys */
+#define HDB_F_REPLACE 2 /* replace entry */
+
+/* key usage for master key */
+#define HDB_KU_MKEY 0x484442
+
+typedef struct hdb_master_key_data *hdb_master_key;
+
+typedef struct HDB{
+ void *db;
+ void *dbc;
+ char *name;
+ int master_key_set;
+ hdb_master_key master_key;
+ int openp;
+
+ krb5_error_code (*open)(krb5_context, struct HDB*, int, mode_t);
+ krb5_error_code (*close)(krb5_context, struct HDB*);
+ krb5_error_code (*fetch)(krb5_context, struct HDB*, unsigned, hdb_entry*);
+ krb5_error_code (*store)(krb5_context, struct HDB*, unsigned, hdb_entry*);
+ krb5_error_code (*remove)(krb5_context, struct HDB*, hdb_entry*);
+ krb5_error_code (*firstkey)(krb5_context, struct HDB*,
+ unsigned, hdb_entry*);
+ krb5_error_code (*nextkey)(krb5_context, struct HDB*,
+ unsigned, hdb_entry*);
+ krb5_error_code (*lock)(krb5_context, struct HDB*, int operation);
+ krb5_error_code (*unlock)(krb5_context, struct HDB*);
+ krb5_error_code (*rename)(krb5_context, struct HDB*, const char*);
+ krb5_error_code (*_get)(krb5_context, struct HDB*, krb5_data, krb5_data*);
+ krb5_error_code (*_put)(krb5_context, struct HDB*, int,
+ krb5_data, krb5_data);
+ krb5_error_code (*_del)(krb5_context, struct HDB*, krb5_data);
+ krb5_error_code (*destroy)(krb5_context, struct HDB*);
+}HDB;
+
+#define HDB_DB_DIR "/var/heimdal"
+#define HDB_DEFAULT_DB HDB_DB_DIR "/heimdal"
+#define HDB_DB_FORMAT_ENTRY "hdb/db-format"
+
+typedef krb5_error_code (*hdb_foreach_func_t)(krb5_context, HDB*,
+ hdb_entry*, void*);
+extern krb5_kt_ops hdb_kt_ops;
+
+#include
+
+#endif /* __HDB_H__ */
diff --git a/src/include/hdb_asn1.h b/src/include/hdb_asn1.h
new file mode 100644
index 0000000..37e13d0
--- /dev/null
+++ b/src/include/hdb_asn1.h
@@ -0,0 +1,222 @@
+/* Generated from /usr/src/kerberos5/lib/libhdb/../../../crypto/heimdal/lib/hdb/hdb.asn1 */
+/* Do not edit */
+
+#ifndef __hdb_asn1_h__
+#define __hdb_asn1_h__
+
+#include
+#include
+
+#ifndef __asn1_common_definitions__
+#define __asn1_common_definitions__
+
+typedef struct octet_string {
+ size_t length;
+ void *data;
+} octet_string;
+
+typedef char *general_string;
+
+typedef struct oid {
+ size_t length;
+ unsigned *components;
+} oid;
+
+#define ASN1_MALLOC_ENCODE(T, B, BL, S, L, R) \
+ do { \
+ (BL) = length_##T((S)); \
+ (B) = malloc((BL)); \
+ if((B) == NULL) { \
+ (R) = ENOMEM; \
+ } else { \
+ (R) = encode_##T(((unsigned char*)(B)) + (BL) - 1, (BL), \
+ (S), (L)); \
+ if((R) != 0) { \
+ free((B)); \
+ (B) = NULL; \
+ } \
+ } \
+ } while (0)
+
+#endif
+
+enum { HDB_DB_FORMAT = 2 };
+
+enum { hdb_pw_salt = 3 };
+
+enum { hdb_afs3_salt = 10 };
+
+/*
+Salt ::= SEQUENCE {
+ type[0] INTEGER,
+ salt[1] OCTET STRING
+}
+*/
+
+typedef struct Salt {
+ int type;
+ octet_string salt;
+} Salt;
+
+int encode_Salt(unsigned char *, size_t, const Salt *, size_t *);
+int decode_Salt(const unsigned char *, size_t, Salt *, size_t *);
+void free_Salt (Salt *);
+size_t length_Salt(const Salt *);
+int copy_Salt (const Salt *, Salt *);
+
+
+/*
+Key ::= SEQUENCE {
+ mkvno[0] INTEGER OPTIONAL,
+ key[1] EncryptionKey,
+ salt[2] Salt OPTIONAL
+}
+*/
+
+typedef struct Key {
+ int *mkvno;
+ EncryptionKey key;
+ Salt *salt;
+} Key;
+
+int encode_Key(unsigned char *, size_t, const Key *, size_t *);
+int decode_Key(const unsigned char *, size_t, Key *, size_t *);
+void free_Key (Key *);
+size_t length_Key(const Key *);
+int copy_Key (const Key *, Key *);
+
+
+/*
+Event ::= SEQUENCE {
+ time[0] KerberosTime,
+ principal[1] Principal OPTIONAL
+}
+*/
+
+typedef struct Event {
+ KerberosTime time;
+ Principal *principal;
+} Event;
+
+int encode_Event(unsigned char *, size_t, const Event *, size_t *);
+int decode_Event(const unsigned char *, size_t, Event *, size_t *);
+void free_Event (Event *);
+size_t length_Event(const Event *);
+int copy_Event (const Event *, Event *);
+
+
+/*
+HDBFlags ::= BIT STRING {
+ initial(0),
+ forwardable(1),
+ proxiable(2),
+ renewable(3),
+ postdate(4),
+ server(5),
+ client(6),
+ invalid(7),
+ require-preauth(8),
+ change-pw(9),
+ require-hwauth(10),
+ ok-as-delegate(11),
+ user-to-user(12),
+ immutable(13)
+}
+*/
+
+typedef struct HDBFlags {
+ unsigned int initial:1;
+ unsigned int forwardable:1;
+ unsigned int proxiable:1;
+ unsigned int renewable:1;
+ unsigned int postdate:1;
+ unsigned int server:1;
+ unsigned int client:1;
+ unsigned int invalid:1;
+ unsigned int require_preauth:1;
+ unsigned int change_pw:1;
+ unsigned int require_hwauth:1;
+ unsigned int ok_as_delegate:1;
+ unsigned int user_to_user:1;
+ unsigned int immutable:1;
+} HDBFlags;
+
+
+int encode_HDBFlags(unsigned char *, size_t, const HDBFlags *, size_t *);
+int decode_HDBFlags(const unsigned char *, size_t, HDBFlags *, size_t *);
+void free_HDBFlags (HDBFlags *);
+size_t length_HDBFlags(const HDBFlags *);
+int copy_HDBFlags (const HDBFlags *, HDBFlags *);
+unsigned HDBFlags2int(HDBFlags);
+HDBFlags int2HDBFlags(unsigned);
+extern struct units HDBFlags_units[];
+
+/*
+GENERATION ::= SEQUENCE {
+ time[0] KerberosTime,
+ usec[1] INTEGER,
+ gen[2] INTEGER
+}
+*/
+
+typedef struct GENERATION {
+ KerberosTime time;
+ int usec;
+ int gen;
+} GENERATION;
+
+int encode_GENERATION(unsigned char *, size_t, const GENERATION *, size_t *);
+int decode_GENERATION(const unsigned char *, size_t, GENERATION *, size_t *);
+void free_GENERATION (GENERATION *);
+size_t length_GENERATION(const GENERATION *);
+int copy_GENERATION (const GENERATION *, GENERATION *);
+
+
+/*
+hdb_entry ::= SEQUENCE {
+ principal[0] Principal OPTIONAL,
+ kvno[1] INTEGER,
+ keys[2] SEQUENCE OF Key,
+ created-by[3] Event,
+ modified-by[4] Event OPTIONAL,
+ valid-start[5] KerberosTime OPTIONAL,
+ valid-end[6] KerberosTime OPTIONAL,
+ pw-end[7] KerberosTime OPTIONAL,
+ max-life[8] INTEGER OPTIONAL,
+ max-renew[9] INTEGER OPTIONAL,
+ flags[10] HDBFlags,
+ etypes[11] SEQUENCE OF INTEGER OPTIONAL,
+ generation[12] GENERATION OPTIONAL
+}
+*/
+
+typedef struct hdb_entry {
+ Principal *principal;
+ int kvno;
+ struct {
+ unsigned int len;
+ Key *val;
+ } keys;
+ Event created_by;
+ Event *modified_by;
+ KerberosTime *valid_start;
+ KerberosTime *valid_end;
+ KerberosTime *pw_end;
+ int *max_life;
+ int *max_renew;
+ HDBFlags flags;
+ struct {
+ unsigned int len;
+ int *val;
+ } *etypes;
+ GENERATION *generation;
+} hdb_entry;
+
+int encode_hdb_entry(unsigned char *, size_t, const hdb_entry *, size_t *);
+int decode_hdb_entry(const unsigned char *, size_t, hdb_entry *, size_t *);
+void free_hdb_entry (hdb_entry *);
+size_t length_hdb_entry(const hdb_entry *);
+int copy_hdb_entry (const hdb_entry *, hdb_entry *);
+
+
+#endif /* __hdb_asn1_h__ */
diff --git a/src/include/hdb_err.h b/src/include/hdb_err.h
new file mode 100644
index 0000000..2304404
--- /dev/null
+++ b/src/include/hdb_err.h
@@ -0,0 +1,31 @@
+/* Generated from /usr/src/kerberos5/lib/libhdb/../../../crypto/heimdal/lib/hdb/hdb_err.et */
+/* $Id$ */
+
+#ifndef __hdb_err_h__
+#define __hdb_err_h__
+
+struct et_list;
+
+void initialize_hdb_error_table_r(struct et_list **);
+
+void initialize_hdb_error_table(void);
+#define init_hdb_err_tbl initialize_hdb_error_table
+
+typedef enum hdb_error_number{
+ HDB_ERR_UK_SERROR = 36150273,
+ HDB_ERR_UK_RERROR = 36150274,
+ HDB_ERR_NOENTRY = 36150275,
+ HDB_ERR_DB_INUSE = 36150276,
+ HDB_ERR_DB_CHANGED = 36150277,
+ HDB_ERR_RECURSIVELOCK = 36150278,
+ HDB_ERR_NOTLOCKED = 36150279,
+ HDB_ERR_BADLOCKMODE = 36150280,
+ HDB_ERR_CANT_LOCK_DB = 36150281,
+ HDB_ERR_EXISTS = 36150282,
+ HDB_ERR_BADVERSION = 36150283,
+ HDB_ERR_NO_MKEY = 36150284
+} hdb_error_number;
+
+#define ERROR_TABLE_BASE_hdb 36150272
+
+#endif /* __hdb_err_h__ */
diff --git a/src/include/heim_err.h b/src/include/heim_err.h
new file mode 100644
index 0000000..ad57e61
--- /dev/null
+++ b/src/include/heim_err.h
@@ -0,0 +1,39 @@
+/* Generated from /usr/src/kerberos5/lib/libkrb5/../../../crypto/heimdal/lib/krb5/heim_err.et */
+/* $Id$ */
+
+#ifndef __heim_err_h__
+#define __heim_err_h__
+
+struct et_list;
+
+void initialize_heim_error_table_r(struct et_list **);
+
+void initialize_heim_error_table(void);
+#define init_heim_err_tbl initialize_heim_error_table
+
+typedef enum heim_error_number{
+ HEIM_ERR_LOG_PARSE = -1980176640,
+ HEIM_ERR_V4_PRINC_NO_CONV = -1980176639,
+ HEIM_ERR_SALTTYPE_NOSUPP = -1980176638,
+ HEIM_ERR_NOHOST = -1980176637,
+ HEIM_ERR_OPNOTSUPP = -1980176636,
+ HEIM_ERR_EOF = -1980176635,
+ HEIM_ERR_BAD_MKEY = -1980176634,
+ HEIM_ERR_SERVICE_NOMATCH = -1980176633,
+ HEIM_EAI_UNKNOWN = -1980176512,
+ HEIM_EAI_ADDRFAMILY = -1980176511,
+ HEIM_EAI_AGAIN = -1980176510,
+ HEIM_EAI_BADFLAGS = -1980176509,
+ HEIM_EAI_FAIL = -1980176508,
+ HEIM_EAI_FAMILY = -1980176507,
+ HEIM_EAI_MEMORY = -1980176506,
+ HEIM_EAI_NODATA = -1980176505,
+ HEIM_EAI_NONAME = -1980176504,
+ HEIM_EAI_SERVICE = -1980176503,
+ HEIM_EAI_SOCKTYPE = -1980176502,
+ HEIM_EAI_SYSTEM = -1980176501
+} heim_error_number;
+
+#define ERROR_TABLE_BASE_heim -1980176640
+
+#endif /* __heim_err_h__ */
diff --git a/src/include/hesiod.h b/src/include/hesiod.h
new file mode 100644
index 0000000..c7dbeee
--- /dev/null
+++ b/src/include/hesiod.h
@@ -0,0 +1,98 @@
+/* $NetBSD: hesiod.h,v 1.3 1999/01/24 23:53:18 lukem Exp $ */
+/* $FreeBSD: src/include/hesiod.h,v 1.2 2002/03/23 17:24:53 imp Exp $ */
+
+
+/*-
+ * Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Copyright (c) 1996 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+#ifndef _HESIOD_H_
+#define _HESIOD_H_
+
+ /* Application-visible indication that we have the new interfaces */
+
+#define HESIOD_INTERFACES
+
+ /* Configuration information. */
+
+#ifndef _PATH_HESIOD_CONF /* Configuration file. */
+#define _PATH_HESIOD_CONF "/etc/hesiod.conf"
+#endif
+
+#define DEF_RHS "" /* Defaults if HESIOD_CONF */
+#define DEF_LHS "" /* file is not present. */
+
+ /* Error codes (for backwards compatibility) */
+
+#define HES_ER_UNINIT -1 /* uninitialized */
+#define HES_ER_OK 0 /* no error */
+#define HES_ER_NOTFOUND 1 /* Hesiod name not found by server */
+#define HES_ER_CONFIG 2 /* local problem (no config file?) */
+#define HES_ER_NET 3 /* network problem */
+
+ /* Declaration of routines */
+
+#include
+
+__BEGIN_DECLS
+int hesiod_init(void **);
+char **hesiod_resolve(void *, const char *, const char *);
+void hesiod_free_list(void *, char **);
+char *hesiod_to_bind(void *, const char *, const char *);
+void hesiod_end(void *);
+
+ /* backwards compatibility */
+int hes_init(void);
+char *hes_to_bind(const char *, const char *);
+char **hes_resolve(const char *, const char *);
+int hes_error(void);
+void hes_free(char **);
+__END_DECLS
+
+#endif /* ! _HESIOD_H_ */
diff --git a/src/include/histedit.h b/src/include/histedit.h
new file mode 100644
index 0000000..a7373ef
--- /dev/null
+++ b/src/include/histedit.h
@@ -0,0 +1,201 @@
+/*-
+ * Copyright (c) 1992, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Christos Zoulas of Cornell University.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)histedit.h 8.2 (Berkeley) 1/3/94
+ * $NetBSD: histedit.h,v 1.15 2000/02/28 17:41:05 chopps Exp $
+ * $FreeBSD: src/include/histedit.h,v 1.9 2003/07/14 16:31:20 imp Exp $
+ */
+
+/*
+ * histedit.h: Line editor and history interface.
+ */
+#ifndef _HISTEDIT_H_
+#define _HISTEDIT_H_
+
+#include
+#include