tools/adflib: build only host variant which is used by Sam440 target
[AROS.git] / workbench / network / stacks / AROSTCP / bsdsocket / sys / systm.h
blob1a776eec8c724ae04d76bcd9fe1cce411be008fc
1 /*
2 * Copyright (C) 1993 AmiTCP/IP Group, <amitcp-group@hut.fi>
3 * Helsinki University of Technology, Finland.
4 * All rights reserved.
5 * Copyright (C) 2005 Neil Cafferkey
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
19 * MA 02111-1307, USA.
23 /*-
24 * Copyright (c) 1982, 1988, 1991 The Regents of the University of California.
25 * All rights reserved.
27 * Redistribution and use in source and binary forms, with or without
28 * modification, are permitted provided that the following conditions
29 * are met:
30 * 1. Redistributions of source code must retain the above copyright
31 * notice, this list of conditions and the following disclaimer.
32 * 2. Redistributions in binary form must reproduce the above copyright
33 * notice, this list of conditions and the following disclaimer in the
34 * documentation and/or other materials provided with the distribution.
35 * 3. All advertising materials mentioning features or use of this software
36 * must display the following acknowledgement:
37 * This product includes software developed by the University of
38 * California, Berkeley and its contributors.
39 * 4. Neither the name of the University nor the names of its contributors
40 * may be used to endorse or promote products derived from this software
41 * without specific prior written permission.
43 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
44 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
45 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
46 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
47 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
48 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
49 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
50 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
51 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
52 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
53 * SUCH DAMAGE.
55 * @(#)systm.h 7.17 (Berkeley) 5/25/91
58 #ifndef SYS_SYSTM_H
59 #define SYS_SYSTM_H
61 #ifndef SYS_TYPES_H
62 #include <sys/types.h>
63 #endif
65 #ifndef SYS_CDEFS_H
66 #include <sys/cdefs.h> /* for the inlines */
67 #endif
69 #include <stdarg.h>
71 #ifdef __AROS__
72 #include <aros/debug.h>
73 #endif
75 #include <dos/rdargs.h>
78 * queue node definition for _insque and _remque. _insque and _remque expect
79 * to find this structure from the start of every node they handle.
82 struct queue_node {
83 struct queue_node *next;
84 struct queue_node *prev;
87 /* casts to keep lint happy */
88 #define insque(q,p) _insque((struct queue_node *)q,(struct queue_node *)p)
90 static inline void
91 _insque(register struct queue_node *node, register struct queue_node *pred)
93 node->next = pred->next;
94 node->prev = pred;
95 (pred->next)->prev = node;
96 pred->next = node;
99 #define remque(q) _remque((struct queue_node *)q)
101 static inline struct queue_node *
102 _remque(register struct queue_node *node)
104 (node->next)->prev = node->prev;
105 (node->prev)->next = node->next;
106 return(node);
110 * General function declarations.
113 void cs_putchar(unsigned char, struct CSource *);
114 void panic(const char *, ...);
115 #ifdef __AROS__
116 #define __log(A, B, C...) \
117 bug("[AROSTCP] "), bug(B , ## C), bug("\n")
118 #define log(A, B, C...) __log(A, B , ## C)
119 #else
120 void __log(unsigned long, const char *, ...);
121 #endif
122 int vlog(unsigned long, const char *, const char *, va_list);
123 int printf(const char *, ...);
124 int sprintf(char * buf, const char * fmt, ...);
125 int csprintf(struct CSource* buf, const char * fmt, ...);
126 int vsprintf(char * buf, const char * fmt, va_list);
127 int vcsprintf(struct CSource* buf, const char * fmt, va_list);
128 char * csprintn(u_long n, int base, char *buf, int buflen);
129 int ultoa(unsigned long ul, char *buffer);
130 int ltoa(long l, char *buffer);
132 #define itoa(i,buffer) ltoa((long)i,buffer)
134 #ifndef AMIGA_SUBR_H
135 #include <kern/amiga_subr.h>
136 #endif
138 #endif /* !SYS_SYSTM_H */