diff options
author | rsc <devnull@localhost> | 2003-11-25 01:40:27 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2003-11-25 01:40:27 +0000 |
commit | f7012583e9a7594cbb5ebe8e974bb69061189262 (patch) | |
tree | 8eb3244abdd1eed893cad51ce12fccb0a9f7a1f7 /include | |
parent | dc13c29ed174fd15e0b025ca4fea8af71015067d (diff) | |
download | plan9port-f7012583e9a7594cbb5ebe8e974bb69061189262.tar.gz plan9port-f7012583e9a7594cbb5ebe8e974bb69061189262.tar.bz2 plan9port-f7012583e9a7594cbb5ebe8e974bb69061189262.zip |
Add the #goo to allow use in C++.
Silence a few more warnings.
Strip down the mkfiles more.
Fix bug in X11 mouse handling, note groups.
Diffstat (limited to 'include')
-rw-r--r-- | include/bin.h | 11 | ||||
-rw-r--r-- | include/bio.h | 10 | ||||
-rw-r--r-- | include/cursor.h | 11 | ||||
-rw-r--r-- | include/draw.h | 11 | ||||
-rw-r--r-- | include/event.h | 11 | ||||
-rw-r--r-- | include/fcall.h | 9 | ||||
-rw-r--r-- | include/flate.h | 9 | ||||
-rw-r--r-- | include/fmt.h | 14 | ||||
-rw-r--r-- | include/frame.h | 10 | ||||
-rw-r--r-- | include/httpd.h | 10 | ||||
-rw-r--r-- | include/ip.h | 9 | ||||
-rw-r--r-- | include/keyboard.h | 10 | ||||
-rw-r--r-- | include/lib9.h | 8 | ||||
-rw-r--r-- | include/libsec.h | 10 | ||||
-rw-r--r-- | include/memdraw.h | 10 | ||||
-rw-r--r-- | include/memlayer.h | 12 | ||||
-rw-r--r-- | include/mouse.h | 11 | ||||
-rw-r--r-- | include/plumb.h | 10 | ||||
-rw-r--r-- | include/regexp9.h | 10 | ||||
-rw-r--r-- | include/thread.h | 10 | ||||
-rw-r--r-- | include/utf.h | 10 | ||||
-rw-r--r-- | include/venti.h | 9 |
22 files changed, 206 insertions, 19 deletions
diff --git a/include/bin.h b/include/bin.h index 6b9f2bd4..dc738f14 100644 --- a/include/bin.h +++ b/include/bin.h @@ -1,3 +1,9 @@ +#ifndef _BIN_H_ +#define _BIN_H_ 1 +#if defined(__cplusplus) +extern "C" { +#endif + /* #pragma lib "libbin.a" #pragma src "/sys/src/libbin" @@ -11,3 +17,8 @@ typedef struct Bin Bin; void *binalloc(Bin **, ulong size, int zero); void *bingrow(Bin **, void *op, ulong osize, ulong size, int zero); void binfree(Bin **); + +#if defined(__cplusplus) +} +#endif +#endif diff --git a/include/bio.h b/include/bio.h index 600f0948..473389a7 100644 --- a/include/bio.h +++ b/include/bio.h @@ -1,5 +1,8 @@ -#ifndef _BIOH_ -#define _BIOH_ 1 +#ifndef _BIO_H_ +#define _BIO_H_ 1 +#if defined(__cplusplus) +extern "C" { +#endif #include <sys/types.h> /* for off_t */ #include <fcntl.h> /* for O_RDONLY, O_WRONLY */ @@ -78,4 +81,7 @@ char* Brdstr(Biobuf*, int, int); long Bgetrune(Biobuf*); int Bputrune(Biobuf*, long); +#if defined(__cplusplus) +} +#endif #endif diff --git a/include/cursor.h b/include/cursor.h index 105cd0ef..d53baf81 100644 --- a/include/cursor.h +++ b/include/cursor.h @@ -1,3 +1,9 @@ +#ifndef _CURSOR_H_ +#define _CURSOR_H_ 1 +#if defined(__cplusplus) +extern "C" { +#endif + typedef struct Cursor Cursor; struct Cursor { @@ -5,3 +11,8 @@ struct Cursor uchar clr[2*16]; uchar set[2*16]; }; + +#if defined(__cplusplus) +} +#endif +#endif diff --git a/include/draw.h b/include/draw.h index 029f0aed..54a566ac 100644 --- a/include/draw.h +++ b/include/draw.h @@ -1,3 +1,9 @@ +#ifndef _DRAW_H_ +#define _DRAW_H_ 1 +#if defined(__cplusplus) +extern "C" { +#endif + typedef struct Cachefont Cachefont; typedef struct Cacheinfo Cacheinfo; typedef struct Cachesubf Cachesubf; @@ -531,3 +537,8 @@ void drawtopwindow(void); int _drawmsgread(Display*, void*, int); int _drawmsgwrite(Display*, void*, int); int _latin1(Rune*, int); + +#if defined(__cplusplus) +} +#endif +#endif diff --git a/include/event.h b/include/event.h index e74183d4..56c1b1c3 100644 --- a/include/event.h +++ b/include/event.h @@ -1,3 +1,9 @@ +#ifndef _EVENT_H_ +#define _EVENT_H_ 1 +#if defined(__cplusplus) +extern "C" { +#endif + typedef struct Event Event; typedef struct Menu Menu; @@ -61,3 +67,8 @@ extern Rectangle egetrect(int, Mouse*); extern void edrawgetrect(Rectangle, int); extern int ereadmouse(Mouse*); extern int eatomouse(Mouse*, char*, int); + +#if defined(__cplusplus) +} +#endif +#endif diff --git a/include/fcall.h b/include/fcall.h index 93f46d4c..20ffe386 100644 --- a/include/fcall.h +++ b/include/fcall.h @@ -1,3 +1,8 @@ +#ifndef _FCALL_H_ +#define _FCALL_H_ 1 +#if defined(__cplusplus) +extern "C" { +#endif /* #pragma src "/sys/src/libc/9sys" #pragma lib "libc.a" @@ -118,3 +123,7 @@ int read9pmsg(int, void*, uint); #pragma varargck type "M" ulong #pragma varargck type "D" Dir* */ +#if defined(__cplusplus) +} +#endif +#endif diff --git a/include/flate.h b/include/flate.h index 79c888c2..bbd0b3d7 100644 --- a/include/flate.h +++ b/include/flate.h @@ -1,3 +1,8 @@ +#ifndef _FLATE_H_ +#define _FLATE_H_ 1 +#if defined(__cplusplus) +extern "C" { +#endif /* #pragma lib "libflate.a" #pragma src "/sys/src/libflate" @@ -39,3 +44,7 @@ ulong *mkcrctab(ulong); ulong blockcrc(ulong *tab, ulong crc, void *buf, int n); ulong adler32(ulong adler, void *buf, int n); +#if defined(__cplusplus) +} +#endif +#endif diff --git a/include/fmt.h b/include/fmt.h index c913e14a..befea2e3 100644 --- a/include/fmt.h +++ b/include/fmt.h @@ -1,3 +1,8 @@ +#ifndef _FMT_H_ +#define _FMT_H_ 1 +#if defined(__cplusplus) +extern "C" { +#endif /* * The authors of this software are Rob Pike and Ken Thompson. @@ -13,14 +18,8 @@ * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. */ -#ifndef _FMTH_ -#define _FMTH_ 1 - #include <stdarg.h> - -#ifndef _UTFH_ #include <utf.h> -#endif typedef struct Fmt Fmt; struct Fmt{ @@ -97,4 +96,7 @@ extern int fmtstrcpy(Fmt*, char*); extern double fmtstrtod(const char *, char **); extern double fmtcharstod(int(*)(void*), void*); +#if defined(__cplusplus) +} +#endif #endif diff --git a/include/frame.h b/include/frame.h index 9b8194b7..47d808ca 100644 --- a/include/frame.h +++ b/include/frame.h @@ -1,3 +1,9 @@ +#ifndef _FRAME_H_ +#define _FRAME_H_ 1 +#if defined(__cplusplus) +extern "C" { +#endif + typedef struct Frbox Frbox; typedef struct Frame Frame; @@ -83,3 +89,7 @@ void frinittick(Frame*); #define NRUNE(b) ((b)->nrune<0? 1 : (b)->nrune) #define NBYTE(b) strlen((char*)(b)->ptr) +#if defined(__cplusplus) +} +#endif +#endif diff --git a/include/httpd.h b/include/httpd.h index d75c5801..03b48adc 100644 --- a/include/httpd.h +++ b/include/httpd.h @@ -1,3 +1,8 @@ +#ifndef _HTTPD_H_ +#define _HTTPD_H_ 1 +#if defined(__cplusplus) +extern "C" { +#endif /* #pragma lib "libhttpd.a" #pragma src "/sys/src/libhttpd" @@ -278,3 +283,8 @@ int hxferenc(Hio*, int); #pragma varargck type "U" char* #pragma varargck type "H" char* */ + +#if defined(__cplusplus) +} +#endif +#endif diff --git a/include/ip.h b/include/ip.h index af82c993..6fbf3946 100644 --- a/include/ip.h +++ b/include/ip.h @@ -1,3 +1,8 @@ +#ifndef _IP_H_ +#define _IP_H_ 1 +#if defined(__cplusplus) +extern "C" { +#endif /* #pragma src "/sys/src/libip" #pragma lib "libip.a" @@ -121,3 +126,7 @@ extern uchar IPallbits[IPaddrlen]; #define CLASS(p) ((*(uchar*)(p))>>6) +#if defined(__cplusplus) +} +#endif +#endif diff --git a/include/keyboard.h b/include/keyboard.h index a6d99bf6..588600a7 100644 --- a/include/keyboard.h +++ b/include/keyboard.h @@ -1,3 +1,8 @@ +#ifndef _KEYBOARD_H_ +#define _KEYBOARD_H_ 1 +#if defined(__cplusplus) +extern "C" { +#endif typedef struct Keyboardctl Keyboardctl; struct Keyboardctl @@ -34,3 +39,8 @@ enum { Kshift= KF|0x16, Kctl= KF|0x17, }; + +#if defined(__cplusplus) +} +#endif +#endif diff --git a/include/lib9.h b/include/lib9.h index 8f15ce6e..21490e65 100644 --- a/include/lib9.h +++ b/include/lib9.h @@ -3,9 +3,8 @@ * fit into libutf or into libfmt, but is still missing from traditional * Unix C libraries. */ -#ifndef _LIB9H_ -#define _LIB9H_ 1 - +#ifndef _LIB9_H_ +#define _LIB9_H_ 1 #if defined(__cplusplus) extern "C" { #endif @@ -861,5 +860,4 @@ extern void __fixargv0(void); #if defined(__cplusplus) } #endif - -#endif /* _LIB9H_ */ +#endif /* _LIB9_H_ */ diff --git a/include/libsec.h b/include/libsec.h index 17b2b651..e65b7f97 100644 --- a/include/libsec.h +++ b/include/libsec.h @@ -1,3 +1,8 @@ +#ifndef _LIBSEC_H_ +#define _LIBSEC_H_ 1 +#if defined(__cplusplus) +extern "C" { +#endif /* #pragma lib "libsec.a" #pragma src "/sys/src/libsec" @@ -338,3 +343,8 @@ extern int okThumbprint(uchar *sha1, Thumbprint *ok); // readcert.c extern uchar *readcert(char *filename, int *pcertlen); + +#if defined(__cplusplus) +} +#endif +#endif diff --git a/include/memdraw.h b/include/memdraw.h index 2d4f54f5..93f34a0a 100644 --- a/include/memdraw.h +++ b/include/memdraw.h @@ -1,3 +1,8 @@ +#ifndef _MEMDRAW_H_ +#define _MEMDRAW_H_ 1 +#if defined(__cplusplus) +extern "C" { +#endif typedef struct Memimage Memimage; typedef struct Memdata Memdata; typedef struct Memsubfont Memsubfont; @@ -208,3 +213,8 @@ extern Memdrawparam* _memimagedrawsetup(Memimage*, Point, int); extern void _memimagedraw(Memdrawparam*); extern void _drawreplacescreenimage(Memimage*); + +#if defined(__cplusplus) +} +#endif +#endif diff --git a/include/memlayer.h b/include/memlayer.h index 36d87767..f0b01d05 100644 --- a/include/memlayer.h +++ b/include/memlayer.h @@ -1,3 +1,9 @@ +#ifndef _MEMLAYER_H_ +#define _MEMLAYER_H_ 1 +#if defined(__cplusplus) +extern "C" { +#endif + typedef struct Memscreen Memscreen; typedef void (*Refreshfn)(Memimage*, Rectangle, void*); @@ -46,3 +52,9 @@ void memlexpose(Memimage*, Rectangle); void _memlsetclear(Memscreen*); int memlorigin(Memimage*, Point, Point); void memlnorefresh(Memimage*, Rectangle, void*); + + +#if defined(__cplusplus) +} +#endif +#endif diff --git a/include/mouse.h b/include/mouse.h index f0a0f697..2c190b23 100644 --- a/include/mouse.h +++ b/include/mouse.h @@ -1,3 +1,8 @@ +#ifndef _MOUSE_H_ +#define _MOUSE_H_ 1 +#if defined(__cplusplus) +extern "C" { +#endif typedef struct Menu Menu; typedef struct Mousectl Mousectl; @@ -42,3 +47,9 @@ extern void setcursor(Mousectl*, struct Cursor*); extern void drawgetrect(Rectangle, int); extern Rectangle getrect(int, Mousectl*); extern int menuhit(int, Mousectl*, Menu*, Screen*); + + +#if defined(__cplusplus) +} +#endif +#endif diff --git a/include/plumb.h b/include/plumb.h index e0b1132f..4a315467 100644 --- a/include/plumb.h +++ b/include/plumb.h @@ -1,3 +1,8 @@ +#ifndef _LIBPLUMB_H_ +#define _LIBPLUMB_H_ 1 +#if defined(__cplusplus) +extern "C" { +#endif /* #pragma lib "libplumb.a" #pragma src "/sys/src/libplumb" @@ -48,3 +53,8 @@ void plumbfree(Plumbmsg*); char* plumblookup(Plumbattr*, char*); int plumbopen(char*, int); int eplumb(int, char*); + +#if defined(__cplusplus) +} +#endif +#endif diff --git a/include/regexp9.h b/include/regexp9.h index 745a6d77..382d246f 100644 --- a/include/regexp9.h +++ b/include/regexp9.h @@ -1,6 +1,9 @@ -#ifndef _REGEXP9H_ +#ifndef _REGEXP9_H_ +#define _REGEXP9_H_ 1 +#if defined(__cplusplus) +extern "C" { +#endif -#define _REGEXP9H_ 1 #include <utf.h> typedef struct Resub Resub; @@ -83,4 +86,7 @@ extern void rregsub9(Rune*, Rune*, Resub*, int); #define rregsub rregsub9 #endif +#if defined(__cplusplus) +} +#endif #endif diff --git a/include/thread.h b/include/thread.h index 10aac284..9c5d2d09 100644 --- a/include/thread.h +++ b/include/thread.h @@ -1,5 +1,8 @@ -#ifndef _THREADH_ -#define _THREADH_ 1 +#ifndef _THREAD_H_ +#define _THREAD_H_ 1 +#if defined(__cplusplus) +extern "C" { +#endif /* avoid conflicts with socket library */ #undef send @@ -129,4 +132,7 @@ int iosleep(Ioproc*, long); long iocall(Ioproc*, long (*)(va_list*), ...); void ioret(Ioproc*, int); +#if defined(__cplusplus) +} +#endif #endif /* _THREADH_ */ diff --git a/include/utf.h b/include/utf.h index 623bfda9..11b016d7 100644 --- a/include/utf.h +++ b/include/utf.h @@ -1,5 +1,8 @@ -#ifndef _UTFH_ -#define _UTFH_ 1 +#ifndef _UTF_H_ +#define _UTF_H_ 1 +#if defined(__cplusplus) +extern "C" { +#endif typedef unsigned short Rune; /* 16 bits */ @@ -48,4 +51,7 @@ extern int isspacerune(Rune); extern int istitlerune(Rune); extern int isupperrune(Rune); +#if defined(__cplusplus) +} +#endif #endif diff --git a/include/venti.h b/include/venti.h index 5f8ef0a8..a828101a 100644 --- a/include/venti.h +++ b/include/venti.h @@ -1,3 +1,8 @@ +#ifndef _VENTI_H_ +#define _VENTI_H_ 1 +#if defined(__cplusplus) +extern "C" { +#endif /* XXX should be own library? */ /* * Packets @@ -413,3 +418,7 @@ int vtfilelock(VtFile*, int); int vtfilelock2(VtFile*, VtFile*, int); int vtfileflushbefore(VtFile*, u64int); +#if defined(__cplusplus) +} +#endif +#endif |