Commit Diff


commit - 66ed321edf44a9465d011a3e54d60a6c32fc166f
commit + 1a0954abb80f92cd9940a21f11dd8f3a84518579
blob - dc738f14ffac7ab90eea6050bac2fcd858e2b409
blob + 139e6bf5e283c20399283a072a6e328db0596aba
--- include/bin.h
+++ include/bin.h
@@ -4,6 +4,8 @@
 extern "C" { 
 #endif
 
+AUTOLIB(bin)
+
 /*
 #pragma	lib	"libbin.a"
 #pragma	src	"/sys/src/libbin"
blob - bd5290116bfa0de6a067104b4dc3aef288c015b4
blob + 2c2b9566faf523e40ff1cc901e170b16611abd80
--- include/bio.h
+++ include/bio.h
@@ -4,6 +4,8 @@
 extern "C" { 
 #endif
 
+AUTOLIB(bio)
+
 #include <sys/types.h>	/* for off_t */
 #include <fcntl.h>	/* for O_RDONLY, O_WRONLY */
 
blob - ae8003d748b7df8e119a7459bc7b9baa2ce62488
blob + 92ed14779f4976fc530884ee6afe4c93d7967784
--- include/complete.h
+++ include/complete.h
@@ -1,3 +1,10 @@
+#ifndef _COMPLETE_H_
+#define _COMPLETE_H_ 1
+#if defined(__cplusplus)
+extern "C" { 
+#endif
+
+AUTOLIB(complete)
 /*
 #pragma	lib	"libcomplete.a"
 #pragma src "/sys/src/libcomplete"
@@ -16,3 +23,8 @@ struct Completion{
 
 Completion* complete(char *dir, char *s);
 void freecompletion(Completion*);
+
+#if defined(__cplusplus)
+}
+#endif
+#endif
blob - a887866e567d50827c27d71a4cba4310ca1aafb5
blob + 7e1d35a2d80cb7f7f0938ba8bbce82944bf2c238
--- include/disk.h
+++ include/disk.h
@@ -1,6 +1,13 @@
-#pragma src "/sys/src/libdisk"
-#pragma lib "libdisk.a"
+#ifndef _DISK_H_
+#define _DISK_H_ 1
+#if defined(__cplusplus)
+extern "C" { 
+#endif
 
+
+AUTOLIB(disk)
+
+#if 0
 /* SCSI interface */
 typedef struct Scsi Scsi;
 struct Scsi {
@@ -58,8 +65,14 @@ enum {
 	Gdisk,
 	Gguess,
 };
+#endif
 
 /* proto file parsing */
 typedef void Protoenum(char *new, char *old, Dir *d, void *a);
 typedef void Protowarn(char *msg, void *a);
 int rdproto(char*, char*, Protoenum*, Protowarn*, void*);
+
+#if defined(__cplusplus)
+}
+#endif
+#endif
blob - 4898e3149c3b9da195c0c185c6dfd1cee0371126
blob + af58b31cdabc9bef6dd89935b274c2aa82721822
--- include/draw.h
+++ include/draw.h
@@ -3,6 +3,8 @@
 #if defined(__cplusplus)
 extern "C" { 
 #endif
+
+AUTOLIB(draw)
 
 typedef struct	Cachefont Cachefont;
 typedef struct	Cacheinfo Cacheinfo;
@@ -338,7 +340,7 @@ extern int	writeimage(int, Image*, int);
 extern Image*	namedimage(Display*, char*);
 extern int	nameimage(Image*, char*, int);
 extern Image* allocimagemix(Display*, u32int, u32int);
-extern int	drawsetlabel(Display*, char*);
+extern int	drawsetlabel(char*);
 
 /*
  * Colors
blob - bbd0b3d75a3c33c205d1be0bc5402dedd12916e3
blob + 8fcc173c577a858d92ae649c7b5da56e0fa281a5
--- include/flate.h
+++ include/flate.h
@@ -3,6 +3,8 @@
 #if defined(__cplusplus)
 extern "C" { 
 #endif
+
+AUTOLIB(flate)
 /*
 #pragma	lib	"libflate.a"
 #pragma	src	"/sys/src/libflate"
blob - 47d808ca4b4081d0f5dc9951eb1c55258279de0e
blob + a3291a70bf64dc10bf31e141c78bab4dd0c12013
--- include/frame.h
+++ include/frame.h
@@ -4,6 +4,8 @@
 extern "C" { 
 #endif
 
+AUTOLIB(frame)
+
 typedef struct Frbox Frbox;
 typedef struct Frame Frame;
 
blob - 384427091b538e0832f96ee31998a4d1a03bfeda (mode 644)
blob + /dev/null
--- include/fs.h
+++ /dev/null
@@ -1,42 +0,0 @@
-#ifndef _FS_H_
-#define _FS_H_ 1
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Simple user-level 9P client.
- */
-
-typedef struct Fsys Fsys;
-typedef struct Fid Fid;
-
-Fsys *fsinit(int);
-Fsys *fsmount(int, char*);
-
-int fsversion(Fsys*, int, char*, int);
-Fid *fsauth(Fsys*, char*);
-Fid *fsattach(Fsys*, Fid*, char*, char*);
-Fid *fsopen(Fsys*, char*, int);
-int fsopenfd(Fsys*, char*, int);
-long fsread(Fid*, void*, long);
-long fsreadn(Fid*, void*, long);
-long fswrite(Fid*, void*, long);
-void fsclose(Fid*);
-void fsunmount(Fsys*);
-int fsrpc(Fsys*, Fcall*, Fcall*, void**);
-Fid *fswalk(Fid*, char*);
-struct Dir;	/* in case there's no lib9.h */
-long fsdirread(Fid*, struct Dir**);
-long fsdirreadall(Fid*, struct Dir**);
-struct Dir *fsdirstat(Fsys*, char*);
-struct Dir *fsdirfstat(Fid*);
-int fsdirwstat(Fsys*, char*, struct Dir*);
-int fsdirfwstat(Fid*, struct Dir*);
-Fid *fsroot(Fsys*);
-Fsys *nsmount(char*, char*);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
blob - 0bcf3b5c8fd371aa81bcd8f94c7c367d2b71470b
blob + 1d5dd6b2d7e6223b357be323a729098c5e2f93bf
--- include/html.h
+++ include/html.h
@@ -4,6 +4,7 @@
 extern "C" {
 #endif
 
+AUTOLIB(html)
 /*
  #pragma lib "libhtml.a"
  #pragma src "/sys/src/libhtml"
blob - 7f3325197e0859fe0822d915b61712fc8c5a5cef
blob + e968d5e251f274b72b16076696b0fc157cf67ab8
--- include/httpd.h
+++ include/httpd.h
@@ -3,6 +3,8 @@
 #if defined(__cplusplus)
 extern "C" { 
 #endif
+
+AUTOLIB(httpd)
 /*
 #pragma	lib	"libhttpd.a"
 #pragma	src	"/sys/src/libhttpd"
blob - 36b36351ab144a50e3de43c56a061ec452b90411
blob + b6843e7062ff2365672ab8ec3331d9c3791019be
--- include/ip.h
+++ include/ip.h
@@ -4,6 +4,7 @@
 extern "C" { 
 #endif
 
+AUTOLIB(ip)
 /*
 #pragma	src	"/sys/src/libip"
 #pragma	lib	"libip.a"
blob - 1a560b6fc51ada418265a76d3e16e9849e18d66d
blob + ad782b44505c98fe0e0ecfbcdf19d1c50521abe7
--- include/libString.h
+++ include/libString.h
@@ -1,7 +1,14 @@
+#ifndef _LIBSTRING_H_
+#define _LIBSTRING_H_ 1
+#if defined(__cplusplus)
+extern "C" { 
+#endif
+
 /*
 #pragma	src	"/sys/src/libString"
 #pragma	lib	"libString.a"
 */
+AUTOLIB(String)
 
 /* extensible Strings */
 typedef struct String {
@@ -44,3 +51,7 @@ extern char	*s_rdinstack(Sinstack*, String*);
 extern Sinstack	*s_allocinstack(char*);
 extern void	s_freeinstack(Sinstack*);
 #endif /* BGETC */
+#if defined(__cplusplus)
+}
+#endif
+#endif
blob - e598a7809fb2913ba505dad5e0cd7ecc3aa6a840
blob + 008a283db5f235ddf4676868f6394488f2f75106
--- include/libsec.h
+++ include/libsec.h
@@ -7,6 +7,8 @@ extern "C" { 
 #pragma	lib	"libsec.a"
 #pragma	src	"/sys/src/libsec"
 */
+
+AUTOLIB(sec)
 
 #ifndef _MPINT
 typedef struct mpint mpint;
blob - 23089e44455a7ef253292310cb5798191be13f73
blob + 0f1a5ae500728e4bbb70719b23a11d4c7e3cdc8d
--- include/mach.h
+++ include/mach.h
@@ -1,3 +1,11 @@
+#ifndef _MACH_H_
+#define _MACH_H_ 1
+#if defined(__cplusplus)
+extern "C" { 
+#endif
+
+AUTOLIB(mach)
+
 /*
  * Architecture-dependent application data.
  * 
@@ -351,8 +359,6 @@ struct Regdesc
 	uint		format;		/* print format: 'x', 'X', 'f', 'z', 'Z' */
 };
 
-Regdesc*	regdesc(char*);
-
 enum
 {
 	/* machine types */
@@ -498,7 +504,7 @@ Fhdr*	findhdr(char*);
 
 Symbol*	flookupsym(Fhdr*, char*);
 Symbol*	ffindsym(Fhdr*, Loc, uint);
-Symbol*	addsym(Fhdr*, Symbol*);
+Symbol*	_addsym(Fhdr*, Symbol*);
 
 /*
  * Stack frame walking.
@@ -525,3 +531,7 @@ struct ps_prochandle
 };
 
 extern int machdebug;
+#if defined(__cplusplus)
+}
+#endif
+#endif
blob - 427544df02f7660f229194dde747c41eff09b816
blob + 153fd03b6ed26dee505b8b3fb012e726c115d8dd
--- include/mp.h
+++ include/mp.h
@@ -4,6 +4,8 @@
 extern "C" {
 #endif
 
+AUTOLIB(mp)
+
 /*
 #pragma	src	"/sys/src/libmp"
 #pragma	lib	"libmp.a"
blob - b8d242c800c721acda452649feb52aab1292279d
blob + 01d1779c0eb4692c4484f137a72f48cfed42b259
--- include/mux.h
+++ include/mux.h
@@ -1,3 +1,11 @@
+#ifndef _MUX_H_
+#define _MUX_H_ 1
+#if defined(__cplusplus)
+extern "C" { 
+#endif
+
+AUTOLIB(mux)
+
 typedef struct Mux Mux;
 typedef struct Muxrpc Muxrpc;
 typedef struct Muxqueue Muxqueue;
@@ -52,3 +60,7 @@ void *_muxqrecv(Muxqueue*);
 void _muxqhangup(Muxqueue*);
 void *_muxnbqrecv(Muxqueue*);
 
+#if defined(__cplusplus)
+}
+#endif
+#endif
blob - b241712b24dd65751df8c28744bbf9d8cf5ef603
blob + 9e1c01b173f8dc2d1472821c262b4700d216e95a
--- include/regexp9.h
+++ include/regexp9.h
@@ -4,6 +4,8 @@
 extern "C" { 
 #endif
 
+AUTOLIB(regexp9)
+
 #include <utf.h>
 
 typedef struct Resub		Resub;
blob - bbcbba54f55adf5cd56d589ce7bcfeda76e67e7d
blob + 23c4a5292582e06b6701264312b98525426a7577
--- include/thread.h
+++ include/thread.h
@@ -4,6 +4,8 @@
 extern "C" { 
 #endif
 
+AUTOLIB(thread)
+
 /*
  * basic procs and threads
  */
@@ -23,8 +25,9 @@ _Thread	*_threadwakeup(Rendez*);
 
 /*
  * daemonize
- */
+ *
 void	threaddaemonize(void);
+ */
 
 /*
  * clumsy linker hack
blob - ba936960df8aa33bca06b05a25f6f7ae70a2b34d
blob + d062a9db41d12a3104c7d98ae2c0141322da9ad1
--- include/u.h
+++ include/u.h
@@ -111,6 +111,11 @@ typedef short s16int;
 #undef _NEEDUINT
 #undef _NEEDULONG
 
+/*
+ * Funny-named symbols to tip off 9l to autolink.
+ */
+#define AUTOLIB(x)	static int __p9l_autolib_ ## x = 1;
+
 #if defined(__cplusplus)
 }
 #endif
blob - 889f86d313de1bfb173cc1687609db7c469ef0f4
blob + 7b14c1aed63bac7b754bf4b2d08e98b39f616d37
--- include/venti.h
+++ include/venti.h
@@ -3,6 +3,9 @@
 #ifdef __cplusplus
 extern "C" { 
 #endif
+
+AUTOLIB(venti)
+
 /* XXX should be own library? */
 /*
  * Packets