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.
This commit is contained in:
rsc 2003-11-25 01:40:27 +00:00
parent dc13c29ed1
commit f7012583e9
41 changed files with 300 additions and 163 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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_ */

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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_ */

View file

@ -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

View file

@ -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