libc: introduce "jehanne_" namespace
With this commit all functions declared in libc.h have been renamed with the "jehanne_" prefix. This is done for several reason: - it removes conflicts during symbol resolution when linking standard C libraries like newlib or musl - it allows programs depending on a standard C library to directly link to a library depending on our non standard libc (eg libsec). To ease transiction two files are provided: - sys/include/lib9.h that can be included instead of <libc.h> to use the old names (via a simple set of macros) - sys/src/lib/c/lib9.c that can be compiled with a program where the macro provided by lib9.h are too dumb (see for example rc or grep). In the kernel port/lib.h has been modified accordingly and some of the functions it directly provides has been renamed too (eg malloc in qmalloc.c and print in devcons.c).
This commit is contained in:
parent
d38f7bb488
commit
e70feee4a3
@ -16,7 +16,7 @@
|
|||||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
/* Test rune assignment: should not produce any warning
|
/* Test rune assignment: should not produce any warning
|
||||||
* see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67132
|
* see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67132
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
/* Test alarm(2):
|
/* Test alarm(2):
|
||||||
* - alarms replace each other (the last one wins)
|
* - alarms replace each other (the last one wins)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The whole regression test I am after here is to call qa/kern/args with
|
* The whole regression test I am after here is to call qa/kern/args with
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
int verbose = 1;
|
int verbose = 1;
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
void
|
void
|
||||||
main(void)
|
main(void)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
void
|
void
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
#define DPRECSTR "0.0000004000000000125"
|
#define DPRECSTR "0.0000004000000000125"
|
||||||
#define DPREC 0.0000004000000000125
|
#define DPREC 0.0000004000000000125
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
void
|
void
|
||||||
main(void)
|
main(void)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
#define DEEPS ".5*2^-1073"
|
#define DEEPS ".5*2^-1073"
|
||||||
#define DENEPS "-.5*2^-1073"
|
#define DENEPS "-.5*2^-1073"
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
void
|
void
|
||||||
main(void)
|
main(void)
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
void
|
void
|
||||||
main(void)
|
main(void)
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
void
|
void
|
||||||
main(void)
|
main(void)
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <ip.h>
|
#include <ip.h>
|
||||||
|
|
||||||
/* from the kernel. Sorry. */
|
/* from the kernel. Sorry. */
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
#define GiB 1024*1024*1024
|
#define GiB 1024*1024*1024
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
#define MSGTPL "Hello from %d!"
|
#define MSGTPL "Hello from %d!"
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
#define MSGTPL "Hello from %d!"
|
#define MSGTPL "Hello from %d!"
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
#define INT 2
|
#define INT 2
|
||||||
#define FLOAT 2.5
|
#define FLOAT 2.5
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#define RET 0xc3
|
#define RET 0xc3
|
||||||
|
|
||||||
int success;
|
int success;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#define RET 0xc3
|
#define RET 0xc3
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
int verbose = 0;
|
int verbose = 0;
|
||||||
void
|
void
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
int nring = 32;
|
int nring = 32;
|
||||||
int niter = 1024;
|
int niter = 1024;
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
int verbose = 0;
|
int verbose = 0;
|
||||||
int procNoteReceived;
|
int procNoteReceived;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
void
|
void
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
/* verify that the scheduler give each process a chance to run
|
/* verify that the scheduler give each process a chance to run
|
||||||
* with a single cpu (x86) this test do not pass on plan9/9front
|
* with a single cpu (x86) this test do not pass on plan9/9front
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
int verbose = 1;
|
int verbose = 1;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
void
|
void
|
||||||
main(void)
|
main(void)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
// Change-Id: I1cfd642d29a3955499b3507f56f0449d1710700e
|
// Change-Id: I1cfd642d29a3955499b3507f56f0449d1710700e
|
||||||
// sys/src/nxm/port/devcons.c:
|
// sys/src/nxm/port/devcons.c:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
int32_t nprocs = 32;
|
int32_t nprocs = 32;
|
||||||
int32_t nloops = 10000;
|
int32_t nloops = 10000;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// -- complete
|
// -- complete
|
||||||
// Since we're going to improve waserror
|
// Since we're going to improve waserror
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
void
|
void
|
||||||
main(void)
|
main(void)
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
int verbose = 1;
|
int verbose = 1;
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
void
|
void
|
||||||
main(void)
|
main(void)
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
#define BUFSZ (32*1024)
|
#define BUFSZ (32*1024)
|
||||||
void
|
void
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
int dim = 6;
|
int dim = 6;
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
QLock rl;
|
QLock rl;
|
||||||
Rendez rStart;
|
Rendez rStart;
|
||||||
@ -85,7 +85,7 @@ main(void)
|
|||||||
resInWaiter = 0xff;
|
resInWaiter = 0xff;
|
||||||
|
|
||||||
spawnWaiter(&l);
|
spawnWaiter(&l);
|
||||||
lock(&l);
|
jehanne_lock(&l);
|
||||||
|
|
||||||
alarm(20000); /* global timeout, FAIL if reached */
|
alarm(20000); /* global timeout, FAIL if reached */
|
||||||
if (!atnotify(failOnTimeout, 1)){
|
if (!atnotify(failOnTimeout, 1)){
|
||||||
@ -112,7 +112,7 @@ main(void)
|
|||||||
rwakeupall(&rStart);
|
rwakeupall(&rStart);
|
||||||
qunlock(&rl);
|
qunlock(&rl);
|
||||||
sleep(1200);
|
sleep(1200);
|
||||||
unlock(&l);
|
jehanne_unlock(&l);
|
||||||
|
|
||||||
qlock(&rl);
|
qlock(&rl);
|
||||||
while(elapsedInWaiter == 0)
|
while(elapsedInWaiter == 0)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
Njmps = 10000
|
Njmps = 10000
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
extern void **_privates;
|
extern void **_privates;
|
||||||
extern int _nprivates;
|
extern int _nprivates;
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
int spin;
|
int spin;
|
||||||
int ok[2];
|
int ok[2];
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
/* verify that qlockt returns 0 on timeout */
|
/* verify that qlockt returns 0 on timeout */
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
/* verify that lockt returns 1 if the lock is released and
|
/* verify that lockt returns 1 if the lock is released and
|
||||||
* it can take it
|
* it can take it
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
/* verify that qlockt returns 0 even on tight timeouts */
|
/* verify that qlockt returns 0 even on tight timeouts */
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
/* verify that rlockt returns 0 on timeout */
|
/* verify that rlockt returns 0 on timeout */
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
/* verify that rlockt returns 1 if the lock is released and
|
/* verify that rlockt returns 1 if the lock is released and
|
||||||
* it can take it
|
* it can take it
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
/* verify that rlockt returns 0 even on tight timeouts */
|
/* verify that rlockt returns 0 even on tight timeouts */
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
/* verify that rsleept returns 0 on timeout */
|
/* verify that rsleept returns 0 on timeout */
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
/* verify that lockt returns 1 if the lock is released and
|
/* verify that lockt returns 1 if the lock is released and
|
||||||
* it can take it
|
* it can take it
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
/* verify that rsleept returns 0 on timeout */
|
/* verify that rsleept returns 0 on timeout */
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
/* verify that rwakeup returns 0 on Rendez that has already been awaken */
|
/* verify that rwakeup returns 0 on Rendez that has already been awaken */
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
/* Test sleep(2):
|
/* Test sleep(2):
|
||||||
* - sleep cannot be interrupted
|
* - sleep cannot be interrupted
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
sqrtC returns the square root of its floating
|
sqrtC returns the square root of its floating
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
void
|
void
|
||||||
main(void)
|
main(void)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
void
|
void
|
||||||
testvseprint(char *buf, int n, char *fmt, ...)
|
testvseprint(char *buf, int n, char *fmt, ...)
|
||||||
{
|
{
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
/* verify that wlockt returns 0 on timeout */
|
/* verify that wlockt returns 0 on timeout */
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
/* verify that wlockt returns 1 if the lock is released and
|
/* verify that wlockt returns 1 if the lock is released and
|
||||||
* it can take it
|
* it can take it
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
/* verify that wlockt returns 0 even on tight timeouts */
|
/* verify that wlockt returns 0 even on tight timeouts */
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
|
|
||||||
enum
|
enum
|
||||||
|
@ -147,6 +147,7 @@ extern unsigned int convS2M(Fcall*, uint8_t*, uint);
|
|||||||
extern unsigned int sizeS2M(Fcall*);
|
extern unsigned int sizeS2M(Fcall*);
|
||||||
extern int statcheck(uint8_t *abuf, uint nbuf);
|
extern int statcheck(uint8_t *abuf, uint nbuf);
|
||||||
|
|
||||||
|
extern int dirfmt(Fmt *fmt);
|
||||||
extern int fcallfmt(Fmt*);
|
extern int fcallfmt(Fmt*);
|
||||||
extern int read9pmsg(int, void*, uint);
|
extern int read9pmsg(int, void*, uint);
|
||||||
|
|
||||||
|
@ -0,0 +1,215 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of Jehanne.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2016 Giacomo Tesio <giacomo@tesio.it>
|
||||||
|
*
|
||||||
|
* Jehanne 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, version 2 of the License.
|
||||||
|
*
|
||||||
|
* Jehanne 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 Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#ifndef _POSIX_ERRORS
|
||||||
|
#define _POSIX_ERRORS
|
||||||
|
|
||||||
|
typedef enum PosixError
|
||||||
|
{
|
||||||
|
PosixE2BIG = 2, /* Argument list too long. */
|
||||||
|
PosixEACCES, /* Permission denied. */
|
||||||
|
PosixEADDRINUSE, /* Address in use. */
|
||||||
|
PosixEADDRNOTAVAIL, /* Address not available. */
|
||||||
|
PosixEAFNOSUPPORT, /* Address family not supported. */
|
||||||
|
PosixEAGAIN, /* Resource unavailable, try again (may be the same value as [EWOULDBLOCK]). */
|
||||||
|
PosixEALREADY, /* Connection already in progress. */
|
||||||
|
PosixEBADF, /* Bad file descriptor. */
|
||||||
|
PosixEBADMSG, /* Bad message. */
|
||||||
|
PosixEBUSY, /* Device or resource busy. */
|
||||||
|
PosixECANCELED, /* Operation canceled. */
|
||||||
|
PosixECHILD, /* No child processes. */
|
||||||
|
PosixECONNABORTED, /* Connection aborted. */
|
||||||
|
PosixECONNREFUSED, /* Connection refused. */
|
||||||
|
PosixECONNRESET, /* Connection reset. */
|
||||||
|
PosixEDEADLK, /* Resource deadlock would occur. */
|
||||||
|
PosixEDESTADDRREQ, /* Destination address required. */
|
||||||
|
PosixEDOM, /* Mathematics argument out of domain of function. */
|
||||||
|
PosixEDQUOT, /* Reserved. */
|
||||||
|
PosixEEXIST, /* File exists. */
|
||||||
|
PosixEFAULT, /* Bad address. */
|
||||||
|
PosixEFBIG, /* File too large. */
|
||||||
|
PosixEHOSTUNREACH, /* Host is unreachable. */
|
||||||
|
PosixEIDRM, /* Identifier removed. */
|
||||||
|
PosixEILSEQ, /* Illegal byte sequence. */
|
||||||
|
PosixEINPROGRESS, /* Operation in progress. */
|
||||||
|
PosixEINTR, /* Interrupted function. */
|
||||||
|
PosixEINVAL, /* Invalid argument. */
|
||||||
|
PosixEIO, /* I/O error. */
|
||||||
|
PosixEISCONN, /* Socket is connected. */
|
||||||
|
PosixEISDIR, /* Idirectory. */
|
||||||
|
PosixELOOP, /* Too many levels of symbolic links. */
|
||||||
|
PosixEMFILE, /* File descriptor value too large. */
|
||||||
|
PosixEMLINK, /* Too many links. */
|
||||||
|
PosixEMSGSIZE, /* Message too large. */
|
||||||
|
PosixEMULTIHOP, /* Reserved. */
|
||||||
|
PosixENAMETOOLONG, /* Filename too long. */
|
||||||
|
PosixENETDOWN, /* Network is down. */
|
||||||
|
PosixENETRESET, /* Connection aborted by network. */
|
||||||
|
PosixENETUNREACH, /* Network unreachable. */
|
||||||
|
PosixENFILE, /* Too many files open in system. */
|
||||||
|
PosixENOBUFS, /* No buffer space available. */
|
||||||
|
PosixENODATA, /* No message is available on the STREAM head read queue. */
|
||||||
|
PosixENODEV, /* No such device. */
|
||||||
|
PosixENOENT, /* No such file or directory. */
|
||||||
|
PosixENOEXEC, /* Executable file format error. */
|
||||||
|
PosixENOLCK, /* No locks available. */
|
||||||
|
PosixENOLINK, /* Reserved. */
|
||||||
|
PosixENOMEM, /* Not enough space. */
|
||||||
|
PosixENOMSG, /* No message of the desired type. */
|
||||||
|
PosixENOPROTOOPT, /* Protocol not available. */
|
||||||
|
PosixENOSPC, /* No space left on device. */
|
||||||
|
PosixENOSR, /* No STREAM resources. */
|
||||||
|
PosixENOSTR, /* Not a STREAM. */
|
||||||
|
PosixENOSYS, /* Functionality not supported. */
|
||||||
|
PosixENOTCONN, /* The socket is not connected. */
|
||||||
|
PosixENOTDIR, /* Not a directory osymbolic link tdirectory. */
|
||||||
|
PosixENOTEMPTY, /* Directory not empty. */
|
||||||
|
PosixENOTRECOVERABLE, /* State not recoverable. */
|
||||||
|
PosixENOTSOCK, /* Not a socket. */
|
||||||
|
PosixENOTSUP, /* Not supported (may be the same value as [EOPNOTSUPP]). */
|
||||||
|
PosixENOTTY, /* Inappropriate I/O control operation. */
|
||||||
|
PosixENXIO, /* No such device or address. */
|
||||||
|
PosixEOPNOTSUPP, /* Operation not supported on socket (may be the same value as [ENOTSUP]). */
|
||||||
|
PosixEOVERFLOW, /* Value too large to be stored in data type. */
|
||||||
|
PosixEOWNERDEAD, /* Previous owner died. */
|
||||||
|
PosixEPERM, /* Operation not permitted. */
|
||||||
|
PosixEPIPE, /* Broken pipe. */
|
||||||
|
PosixEPROTO, /* Protocol error. */
|
||||||
|
PosixEPROTONOSUPPORT, /* Protocol not supported. */
|
||||||
|
PosixEPROTOTYPE, /* Protocol wrong type for socket. */
|
||||||
|
PosixERANGE, /* Result too large. */
|
||||||
|
PosixEROFS, /* Read-only file system. */
|
||||||
|
PosixESPIPE, /* Invalid seek. */
|
||||||
|
PosixESRCH, /* No such process. */
|
||||||
|
PosixESTALE, /* Reserved. */
|
||||||
|
PosixETIME, /* Stream ioctl() timeout. */
|
||||||
|
PosixETIMEDOUT, /* Connection timed out. */
|
||||||
|
PosixETXTBSY, /* Text file busy. */
|
||||||
|
PosixEWOULDBLOCK, /* Operation would block (may be the same value as [EAGAIN]). */
|
||||||
|
PosixEXDEV, /* Cross-device link. */
|
||||||
|
} PosixError;
|
||||||
|
|
||||||
|
#define ERRNO_FIRST PosixE2BIG /* Value of the first error constant */
|
||||||
|
#define ERRNO_LAST PosixEXDEV /* Value of the last error constant */
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _ERRNO_H
|
||||||
|
#define _ERRNO_H
|
||||||
|
|
||||||
|
extern int __errno();
|
||||||
|
#define errno __errno()
|
||||||
|
|
||||||
|
/* See The Open Group Base Specifications Issue 7
|
||||||
|
* IEEE Std 1003.1-2008, 2016 Edition got from
|
||||||
|
* http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/errno.h.html#tag_13_10
|
||||||
|
*
|
||||||
|
* NOTES:
|
||||||
|
* None of these errno will ever be set by the Jehanne kernel.
|
||||||
|
* It's possible however that a file server designed to mimic a Unix
|
||||||
|
* behaviour use them.
|
||||||
|
*
|
||||||
|
* The value 1 is reserved since -1 is the default return value of
|
||||||
|
* failing syscalls.
|
||||||
|
*
|
||||||
|
* The constant values are continuous, thus ERRNO_FIRST and ERRNO_LAST
|
||||||
|
* can be used to create a map from errors to descriptions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define E2BIG PosixE2BIG
|
||||||
|
#define EACCES PosixEACCES
|
||||||
|
#define EADDRINUSE PosixEADDRINUSE
|
||||||
|
#define EADDRNOTAVAIL PosixEADDRNOTAVAIL
|
||||||
|
#define EAFNOSUPPORT PosixEAFNOSUPPORT
|
||||||
|
#define EAGAIN PosixEAGAIN
|
||||||
|
#define EALREADY PosixEALREADY
|
||||||
|
#define EBADF PosixEBADF
|
||||||
|
#define EBADMSG PosixEBADMSG
|
||||||
|
#define EBUSY PosixEBUSY
|
||||||
|
#define ECANCELED PosixECANCELED
|
||||||
|
#define ECHILD PosixECHILD
|
||||||
|
#define ECONNABORTED PosixECONNABORTED
|
||||||
|
#define ECONNREFUSED PosixECONNREFUSED
|
||||||
|
#define ECONNRESET PosixECONNRESET
|
||||||
|
#define EDEADLK PosixEDEADLK
|
||||||
|
#define EDESTADDRREQ PosixEDESTADDRREQ
|
||||||
|
#define EDOM PosixEDOM
|
||||||
|
#define EDQUOT PosixEDQUOT
|
||||||
|
#define EEXIST PosixEEXIST
|
||||||
|
#define EFAULT PosixEFAULT
|
||||||
|
#define EFBIG PosixEFBIG
|
||||||
|
#define EHOSTUNREACH PosixEHOSTUNREACH
|
||||||
|
#define EIDRM PosixEIDRM
|
||||||
|
#define EILSEQ PosixEILSEQ
|
||||||
|
#define EINPROGRESS PosixEINPROGRESS
|
||||||
|
#define EINTR PosixEINTR
|
||||||
|
#define EINVAL PosixEINVAL
|
||||||
|
#define EIO PosixEIO
|
||||||
|
#define EISCONN PosixEISCONN
|
||||||
|
#define EISDIR PosixEISDIR
|
||||||
|
#define ELOOP PosixELOOP
|
||||||
|
#define EMFILE PosixEMFILE
|
||||||
|
#define EMLINK PosixEMLINK
|
||||||
|
#define EMSGSIZE PosixEMSGSIZE
|
||||||
|
#define EMULTIHOP PosixEMULTIHOP
|
||||||
|
#define ENAMETOOLONG PosixENAMETOOLONG
|
||||||
|
#define ENETDOWN PosixENETDOWN
|
||||||
|
#define ENETRESET PosixENETRESET
|
||||||
|
#define ENETUNREACH PosixENETUNREACH
|
||||||
|
#define ENFILE PosixENFILE
|
||||||
|
#define ENOBUFS PosixENOBUFS
|
||||||
|
#define ENODATA PosixENODATA
|
||||||
|
#define ENODEV PosixENODEV
|
||||||
|
#define ENOENT PosixENOENT
|
||||||
|
#define ENOEXEC PosixENOEXEC
|
||||||
|
#define ENOLCK PosixENOLCK
|
||||||
|
#define ENOLINK PosixENOLINK
|
||||||
|
#define ENOMEM PosixENOMEM
|
||||||
|
#define ENOMSG PosixENOMSG
|
||||||
|
#define ENOPROTOOPT PosixENOPROTOOPT
|
||||||
|
#define ENOSPC PosixENOSPC
|
||||||
|
#define ENOSR PosixENOSR
|
||||||
|
#define ENOSTR PosixENOSTR
|
||||||
|
#define ENOSYS PosixENOSYS
|
||||||
|
#define ENOTCONN PosixENOTCONN
|
||||||
|
#define ENOTDIR PosixENOTDIR
|
||||||
|
#define ENOTEMPTY PosixENOTEMPTY
|
||||||
|
#define ENOTRECOVERABLE PosixENOTRECOVERABLE
|
||||||
|
#define ENOTSOCK PosixENOTSOCK
|
||||||
|
#define ENOTSUP PosixENOTSUP
|
||||||
|
#define ENOTTY PosixENOTTY
|
||||||
|
#define ENXIO PosixENXIO
|
||||||
|
#define EOPNOTSUPP PosixEOPNOTSUPP
|
||||||
|
#define EOVERFLOW PosixEOVERFLOW
|
||||||
|
#define EOWNERDEAD PosixEOWNERDEAD
|
||||||
|
#define EPERM PosixEPERM
|
||||||
|
#define EPIPE PosixEPIPE
|
||||||
|
#define EPROTO PosixEPROTO
|
||||||
|
#define EPROTONOSUPPORT PosixEPROTONOSUPPORT
|
||||||
|
#define EPROTOTYPE PosixEPROTOTYPE
|
||||||
|
#define ERANGE PosixERANGE
|
||||||
|
#define EROFS PosixEROFS
|
||||||
|
#define ESPIPE PosixESPIPE
|
||||||
|
#define ESRCH PosixESRCH
|
||||||
|
#define ESTALE PosixESTALE
|
||||||
|
#define ETIME PosixETIME
|
||||||
|
#define ETIMEDOUT PosixETIMEDOUT
|
||||||
|
#define ETXTBSY PosixETXTBSY
|
||||||
|
#define EWOULDBLOCK PosixEWOULDBLOCK
|
||||||
|
#define EXDEV PosixEXDEV
|
||||||
|
|
||||||
|
#endif
|
@ -22,7 +22,7 @@
|
|||||||
#define EXIT_SUCCESS 0
|
#define EXIT_SUCCESS 0
|
||||||
#define EXIT_FAILURE 1 // POSIX
|
#define EXIT_FAILURE 1 // POSIX
|
||||||
|
|
||||||
#define __POSIX_EXIT_PREFIX "posix exit: "
|
#include <posix.h> // to get __POSIX_EXIT_PREFIX
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int quot;
|
int quot;
|
||||||
|
@ -192,8 +192,8 @@ uint16_t ptclbsum(uint8_t*, int);
|
|||||||
int v6tov4(uint8_t*, uint8_t*);
|
int v6tov4(uint8_t*, uint8_t*);
|
||||||
void v4tov6(uint8_t*, uint8_t*);
|
void v4tov6(uint8_t*, uint8_t*);
|
||||||
|
|
||||||
#define ipcmp(x, y) memcmp(x, y, IPaddrlen)
|
#define ipcmp(x, y) jehanne_memcmp(x, y, IPaddrlen)
|
||||||
#define ipmove(x, y) memmove(x, y, IPaddrlen)
|
#define ipmove(x, y) jehanne_memmove(x, y, IPaddrlen)
|
||||||
|
|
||||||
extern uint8_t IPv4bcast[IPaddrlen];
|
extern uint8_t IPv4bcast[IPaddrlen];
|
||||||
extern uint8_t IPv4bcastobs[IPaddrlen];
|
extern uint8_t IPv4bcastobs[IPaddrlen];
|
||||||
|
310
sys/include/lib9.h
Normal file
310
sys/include/lib9.h
Normal file
@ -0,0 +1,310 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of Jehanne.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2017 Giacomo Tesio <giacomo@tesio.it>
|
||||||
|
*
|
||||||
|
* Jehanne 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, version 2 of the License.
|
||||||
|
*
|
||||||
|
* Jehanne 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 Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* lib9.h provides macros to map Plan9's libc functions to Jehanne one */
|
||||||
|
|
||||||
|
#include <libc.h>
|
||||||
|
|
||||||
|
#define memccpy jehanne_memccpy
|
||||||
|
#define memset jehanne_memset
|
||||||
|
#define memcmp jehanne_memcmp
|
||||||
|
#define memcpy jehanne_memcpy
|
||||||
|
#define memmove jehanne_memmove
|
||||||
|
#define memchr jehanne_memchr
|
||||||
|
#define strcat jehanne_strcat
|
||||||
|
#define strchr jehanne_strchr
|
||||||
|
#define strcmp jehanne_strcmp
|
||||||
|
#define strcpy jehanne_strcpy
|
||||||
|
#define strecpy jehanne_strecpy
|
||||||
|
#define strdup jehanne_strdup
|
||||||
|
#define strncat jehanne_strncat
|
||||||
|
#define strncpy jehanne_strncpy
|
||||||
|
#define strncmp jehanne_strncmp
|
||||||
|
#define strpbrk jehanne_strpbrk
|
||||||
|
#define strrchr jehanne_strrchr
|
||||||
|
#define strtok jehanne_strtok
|
||||||
|
#define strlen jehanne_strlen
|
||||||
|
#define strspn jehanne_strspn
|
||||||
|
#define strcspn jehanne_strcspn
|
||||||
|
#define strstr jehanne_strstr
|
||||||
|
#define cistrncmp jehanne_cistrncmp
|
||||||
|
#define cistrcmp jehanne_cistrcmp
|
||||||
|
#define cistrstr jehanne_cistrstr
|
||||||
|
#define tokenize jehanne_tokenize
|
||||||
|
#define runetochar jehanne_runetochar
|
||||||
|
#define chartorune jehanne_chartorune
|
||||||
|
#define runelen jehanne_runelen
|
||||||
|
#define runenlen jehanne_runenlen
|
||||||
|
#define fullrune jehanne_fullrune
|
||||||
|
#define utflen jehanne_utflen
|
||||||
|
#define utfnlen jehanne_utfnlen
|
||||||
|
#define utfrune jehanne_utfrune
|
||||||
|
#define utfrrune jehanne_utfrrune
|
||||||
|
#define utfutf jehanne_utfutf
|
||||||
|
#define utfecpy jehanne_utfecpy
|
||||||
|
#define runestrcat jehanne_runestrcat
|
||||||
|
#define runestrchr jehanne_runestrchr
|
||||||
|
#define runestrcmp jehanne_runestrcmp
|
||||||
|
#define runestrcpy jehanne_runestrcpy
|
||||||
|
#define runestrncpy jehanne_runestrncpy
|
||||||
|
#define runestrecpy jehanne_runestrecpy
|
||||||
|
#define runestrdup jehanne_runestrdup
|
||||||
|
#define runestrncat jehanne_runestrncat
|
||||||
|
#define runestrncmp jehanne_runestrncmp
|
||||||
|
#define runestrrchr jehanne_runestrrchr
|
||||||
|
#define runestrlen jehanne_runestrlen
|
||||||
|
#define runestrstr jehanne_runestrstr
|
||||||
|
#define tolowerrune jehanne_tolowerrune
|
||||||
|
#define totitlerune jehanne_totitlerune
|
||||||
|
#define toupperrune jehanne_toupperrune
|
||||||
|
#define tobaserune jehanne_tobaserune
|
||||||
|
#define isalpharune jehanne_isalpharune
|
||||||
|
#define isbaserune jehanne_isbaserune
|
||||||
|
#define isdigitrune jehanne_isdigitrune
|
||||||
|
#define islowerrune jehanne_islowerrune
|
||||||
|
#define isspacerune jehanne_isspacerune
|
||||||
|
#define istitlerune jehanne_istitlerune
|
||||||
|
#define isupperrune jehanne_isupperrune
|
||||||
|
#define malloc jehanne_malloc
|
||||||
|
#define malloc jehanne_malloc
|
||||||
|
#define mallocz jehanne_mallocz
|
||||||
|
#define free jehanne_free
|
||||||
|
#define msize jehanne_msize
|
||||||
|
#define mallocalign jehanne_mallocalign
|
||||||
|
#define calloc jehanne_calloc
|
||||||
|
#define realloc jehanne_realloc
|
||||||
|
#define setmalloctag jehanne_setmalloctag
|
||||||
|
#define setrealloctag jehanne_setrealloctag
|
||||||
|
#define getmalloctag jehanne_getmalloctag
|
||||||
|
#define getrealloctag jehanne_getrealloctag
|
||||||
|
#define malloctopoolblock jehanne_malloctopoolblock
|
||||||
|
#define print jehanne_print
|
||||||
|
#define print jehanne_print
|
||||||
|
#define seprint jehanne_seprint
|
||||||
|
#define vseprint jehanne_vseprint
|
||||||
|
#define snprint jehanne_snprint
|
||||||
|
#define vsnprint jehanne_vsnprint
|
||||||
|
#define smprint jehanne_smprint
|
||||||
|
#define vsmprint jehanne_vsmprint
|
||||||
|
#define sprint jehanne_sprint
|
||||||
|
#define fprint jehanne_fprint
|
||||||
|
#define vfprint jehanne_vfprint
|
||||||
|
#define runesprint jehanne_runesprint
|
||||||
|
#define runesnprint jehanne_runesnprint
|
||||||
|
#define runevsnprint jehanne_runevsnprint
|
||||||
|
#define runeseprint jehanne_runeseprint
|
||||||
|
#define runevseprint jehanne_runevseprint
|
||||||
|
#define runesmprint jehanne_runesmprint
|
||||||
|
#define runevsmprint jehanne_runevsmprint
|
||||||
|
#define fmtfdinit jehanne_fmtfdinit
|
||||||
|
#define fmtfdflush jehanne_fmtfdflush
|
||||||
|
#define fmtstrinit jehanne_fmtstrinit
|
||||||
|
#define fmtstrflush jehanne_fmtstrflush
|
||||||
|
#define runefmtstrinit jehanne_runefmtstrinit
|
||||||
|
#define runefmtstrflush jehanne_runefmtstrflush
|
||||||
|
#define fmtinstall jehanne_fmtinstall
|
||||||
|
#define dofmt jehanne_dofmt
|
||||||
|
#define dorfmt jehanne_dorfmt
|
||||||
|
#define fmtprint jehanne_fmtprint
|
||||||
|
#define fmtvprint jehanne_fmtvprint
|
||||||
|
#define fmtrune jehanne_fmtrune
|
||||||
|
#define fmtstrcpy jehanne_fmtstrcpy
|
||||||
|
#define fmtrunestrcpy jehanne_fmtrunestrcpy
|
||||||
|
#define errfmt jehanne_errfmt
|
||||||
|
#define unquotestrdup jehanne_unquotestrdup
|
||||||
|
#define unquoterunestrdup jehanne_unquoterunestrdup
|
||||||
|
#define quotestrdup jehanne_quotestrdup
|
||||||
|
#define quoterunestrdup jehanne_quoterunestrdup
|
||||||
|
#define quotestrfmt jehanne_quotestrfmt
|
||||||
|
#define quoterunestrfmt jehanne_quoterunestrfmt
|
||||||
|
#define quotefmtinstall jehanne_quotefmtinstall
|
||||||
|
#define needsrcquote jehanne_needsrcquote
|
||||||
|
#define srand jehanne_srand
|
||||||
|
#define rand jehanne_rand
|
||||||
|
#define nrand jehanne_nrand
|
||||||
|
#define lrand jehanne_lrand
|
||||||
|
#define lnrand jehanne_lnrand
|
||||||
|
#define frand jehanne_frand
|
||||||
|
#define truerand jehanne_truerand
|
||||||
|
#define ntruerand jehanne_ntruerand
|
||||||
|
#define getfcr jehanne_getfcr
|
||||||
|
#define setfsr jehanne_setfsr
|
||||||
|
#define setfcr jehanne_setfcr
|
||||||
|
#define NaN jehanne_NaN
|
||||||
|
#define Inf jehanne_Inf
|
||||||
|
#define isNaN jehanne_isNaN
|
||||||
|
#define isInf jehanne_isInf
|
||||||
|
#define umuldiv jehanne_umuldiv
|
||||||
|
#define muldiv jehanne_muldiv
|
||||||
|
#define pow jehanne_pow
|
||||||
|
#define atan2 jehanne_atan2
|
||||||
|
#define fabs jehanne_fabs
|
||||||
|
#define atan jehanne_atan
|
||||||
|
#define log jehanne_log
|
||||||
|
#define log10 jehanne_log10
|
||||||
|
#define exp jehanne_exp
|
||||||
|
#define floor jehanne_floor
|
||||||
|
#define ceil jehanne_ceil
|
||||||
|
#define hypot jehanne_hypot
|
||||||
|
#define sin jehanne_sin
|
||||||
|
#define cos jehanne_cos
|
||||||
|
#define tan jehanne_tan
|
||||||
|
#define asin jehanne_asin
|
||||||
|
#define acos jehanne_acos
|
||||||
|
#define sinh jehanne_sinh
|
||||||
|
#define cosh jehanne_cosh
|
||||||
|
#define tanh jehanne_tanh
|
||||||
|
#define sqrt jehanne_sqrt
|
||||||
|
#define fmod jehanne_fmod
|
||||||
|
#define gmtime jehanne_gmtime
|
||||||
|
#define localtime jehanne_localtime
|
||||||
|
#define asctime jehanne_asctime
|
||||||
|
#define ctime jehanne_ctime
|
||||||
|
#define cputime jehanne_cputime
|
||||||
|
#define times jehanne_times
|
||||||
|
#define tm2sec jehanne_tm2sec
|
||||||
|
#define nsec jehanne_nsec
|
||||||
|
#define _assert jehanne__assert
|
||||||
|
#define abs jehanne_abs
|
||||||
|
#define atexit jehanne_atexit
|
||||||
|
#define atexitdont jehanne_atexitdont
|
||||||
|
#define atnotify jehanne_atnotify
|
||||||
|
#define atof jehanne_atof
|
||||||
|
#define atoi jehanne_atoi
|
||||||
|
#define atol jehanne_atol
|
||||||
|
#define atoll jehanne_atoll
|
||||||
|
#define charstod jehanne_charstod
|
||||||
|
#define chdir jehanne_chdir
|
||||||
|
#define cleanname jehanne_cleanname
|
||||||
|
#define dec64 jehanne_dec64
|
||||||
|
#define enc64 jehanne_enc64
|
||||||
|
#define dec32 jehanne_dec32
|
||||||
|
#define enc32 jehanne_enc32
|
||||||
|
#define dec16 jehanne_dec16
|
||||||
|
#define enc16 jehanne_enc16
|
||||||
|
#define encodefmt jehanne_encodefmt
|
||||||
|
#define exits jehanne_exits
|
||||||
|
#define frexp jehanne_frexp
|
||||||
|
#define getcallerpc jehanne_getcallerpc
|
||||||
|
#define getenv jehanne_getenv
|
||||||
|
#define getfields jehanne_getfields
|
||||||
|
#define gettokens jehanne_gettokens
|
||||||
|
#define getuser jehanne_getuser
|
||||||
|
#define getwd jehanne_getwd
|
||||||
|
#define iounit jehanne_iounit
|
||||||
|
#define labs jehanne_labs
|
||||||
|
#define ldexp jehanne_ldexp
|
||||||
|
#define longjmp jehanne_longjmp
|
||||||
|
#define mktemp jehanne_mktemp
|
||||||
|
#define modf jehanne_modf
|
||||||
|
#define notejmp jehanne_notejmp
|
||||||
|
#define nsec jehanne_nsec
|
||||||
|
#define dup jehanne_dup
|
||||||
|
#define ocreate jehanne_ocreate
|
||||||
|
#define perror jehanne_perror
|
||||||
|
#define pipe jehanne_pipe
|
||||||
|
#define postnote jehanne_postnote
|
||||||
|
#define pow10 jehanne_pow10
|
||||||
|
#define putenv jehanne_putenv
|
||||||
|
#define qsort jehanne_qsort
|
||||||
|
#define bsearch jehanne_bsearch
|
||||||
|
#define setjmp jehanne_setjmp
|
||||||
|
#define strtod jehanne_strtod
|
||||||
|
#define strtol jehanne_strtol
|
||||||
|
#define strtoul jehanne_strtoul
|
||||||
|
#define strtoll jehanne_strtoll
|
||||||
|
#define strtoull jehanne_strtoull
|
||||||
|
#define sysfatal jehanne_sysfatal
|
||||||
|
#define syslog jehanne_syslog
|
||||||
|
#define time jehanne_time
|
||||||
|
#define tolower jehanne_tolower
|
||||||
|
#define toupper jehanne_toupper
|
||||||
|
#define ainc jehanne_ainc
|
||||||
|
#define adec jehanne_adec
|
||||||
|
#define _tas jehanne__tas
|
||||||
|
#define lock jehanne_lock
|
||||||
|
#define lockt jehanne_lockt
|
||||||
|
#define unlock jehanne_unlock
|
||||||
|
#define canlock jehanne_canlock
|
||||||
|
#define lock; jehanne_lock;
|
||||||
|
#define qlock jehanne_qlock
|
||||||
|
#define qlockt jehanne_qlockt
|
||||||
|
#define qunlock jehanne_qunlock
|
||||||
|
#define canqlock jehanne_canqlock
|
||||||
|
#define _qlockinit jehanne__qlockinit
|
||||||
|
#define lock; jehanne_lock;
|
||||||
|
#define rlock jehanne_rlock
|
||||||
|
#define rlockt jehanne_rlockt
|
||||||
|
#define runlock jehanne_runlock
|
||||||
|
#define canrlock jehanne_canrlock
|
||||||
|
#define wlock jehanne_wlock
|
||||||
|
#define wlockt jehanne_wlockt
|
||||||
|
#define wunlock jehanne_wunlock
|
||||||
|
#define canwlock jehanne_canwlock
|
||||||
|
#define rsleep jehanne_rsleep
|
||||||
|
#define rsleept jehanne_rsleept
|
||||||
|
#define rwakeup jehanne_rwakeup
|
||||||
|
#define rwakeupall jehanne_rwakeupall
|
||||||
|
#define privalloc jehanne_privalloc
|
||||||
|
#define accept jehanne_accept
|
||||||
|
#define announce jehanne_announce
|
||||||
|
#define dial jehanne_dial
|
||||||
|
#define setnetmtpt jehanne_setnetmtpt
|
||||||
|
#define hangup jehanne_hangup
|
||||||
|
#define listen jehanne_listen
|
||||||
|
#define netmkaddr jehanne_netmkaddr
|
||||||
|
#define reject jehanne_reject
|
||||||
|
#define pushssl jehanne_pushssl
|
||||||
|
#define pushtls jehanne_pushtls
|
||||||
|
#define getnetconninfo jehanne_getnetconninfo
|
||||||
|
#define freenetconninfo jehanne_freenetconninfo
|
||||||
|
#define access jehanne_access
|
||||||
|
#define awakened jehanne_awakened
|
||||||
|
#define brk jehanne_brk
|
||||||
|
#define execl jehanne_execl
|
||||||
|
#define forgivewkp jehanne_forgivewkp
|
||||||
|
#define fork jehanne_fork
|
||||||
|
#define readn jehanne_readn
|
||||||
|
#define segbrk jehanne_segbrk
|
||||||
|
#define segbrk jehanne_segbrk
|
||||||
|
#define segattach jehanne_segattach
|
||||||
|
#define segdetach jehanne_segdetach
|
||||||
|
#define segfree jehanne_segfree
|
||||||
|
#define sleep jehanne_sleep
|
||||||
|
#define stat jehanne_stat
|
||||||
|
#define wait jehanne_wait
|
||||||
|
#define waitpid jehanne_waitpid
|
||||||
|
#define wstat jehanne_wstat
|
||||||
|
#define dirstat jehanne_dirstat
|
||||||
|
#define dirfstat jehanne_dirfstat
|
||||||
|
#define dirwstat jehanne_dirwstat
|
||||||
|
#define dirfwstat jehanne_dirfwstat
|
||||||
|
#define dirread jehanne_dirread
|
||||||
|
#define nulldir jehanne_nulldir
|
||||||
|
#define dirreadall jehanne_dirreadall
|
||||||
|
#define getpid jehanne_getpid
|
||||||
|
#define getppid jehanne_getppid
|
||||||
|
#define getmainpid jehanne_getmainpid
|
||||||
|
#define rerrstr jehanne_rerrstr
|
||||||
|
#define sysname jehanne_sysname
|
||||||
|
#define werrstr jehanne_werrstr
|
||||||
|
#define convM2D jehanne_convM2D
|
||||||
|
#define convD2M jehanne_convD2M
|
||||||
|
#define sizeD2M jehanne_sizeD2M
|
||||||
|
#define dirmodefmt jehanne_dirmodefmt
|
||||||
|
#define chartorune jehanne_chartorune
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
#define nelem(x) (sizeof(x)/sizeof((x)[0]))
|
#define nelem(x) (sizeof(x)/sizeof((x)[0]))
|
||||||
#define offsetof(s, m) (uintptr_t)(&(((s*)0)->m))
|
#define offsetof(s, m) (uintptr_t)(&(((s*)0)->m))
|
||||||
#define assert(x) if(x){}else _assert(#x)
|
#define assert(x) if(x){}else jehanne__assert(#x)
|
||||||
|
|
||||||
extern void (*_abort)(void);
|
extern void (*_abort)(void);
|
||||||
#define abort() if(_abort){_abort();}else{while(*(int*)0);}
|
#define abort() if(_abort){_abort();}else{while(*(int*)0);}
|
||||||
@ -24,36 +24,36 @@ extern void (*_abort)(void);
|
|||||||
/*
|
/*
|
||||||
* mem routines
|
* mem routines
|
||||||
*/
|
*/
|
||||||
extern void* memccpy(void*, const void*, int, uint32_t);
|
extern void* jehanne_memccpy(void*, const void*, int, uint32_t);
|
||||||
extern void* memset(void*, int, uint32_t);
|
extern void* jehanne_memset(void*, int, uint32_t);
|
||||||
extern int memcmp(const void*, const void*, uint32_t);
|
extern int jehanne_memcmp(const void*, const void*, uint32_t);
|
||||||
extern void* memcpy(void*, const void*, size_t);
|
extern void* jehanne_memcpy(void*, const void*, size_t);
|
||||||
extern void* memmove(void*, const void*, size_t);
|
extern void* jehanne_memmove(void*, const void*, size_t);
|
||||||
extern void* memchr(const void*, int, uint32_t);
|
extern void* jehanne_memchr(const void*, int, uint32_t);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* string routines
|
* string routines
|
||||||
*/
|
*/
|
||||||
extern char* strcat(char*, const char*);
|
extern char* jehanne_strcat(char*, const char*);
|
||||||
extern char* strchr(const char*, int);
|
extern char* jehanne_strchr(const char*, int);
|
||||||
extern int strcmp(const char*, const char*);
|
extern int jehanne_strcmp(const char*, const char*);
|
||||||
extern char* strcpy(char*, const char*);
|
extern char* jehanne_strcpy(char*, const char*);
|
||||||
extern char* strecpy(char*, char *, const char*);
|
extern char* jehanne_strecpy(char*, char *, const char*);
|
||||||
extern char* strdup(const char*);
|
extern char* jehanne_strdup(const char*);
|
||||||
extern char* strncat(char*, const char*, int32_t);
|
extern char* jehanne_strncat(char*, const char*, int32_t);
|
||||||
extern char* strncpy(char*, const char*, uint32_t);
|
extern char* jehanne_strncpy(char*, const char*, uint32_t);
|
||||||
extern int strncmp(const char*, const char*, int32_t);
|
extern int jehanne_strncmp(const char*, const char*, int32_t);
|
||||||
extern char* strpbrk(const char*, const char*);
|
extern char* jehanne_strpbrk(const char*, const char*);
|
||||||
extern char* strrchr(const char*, int);
|
extern char* jehanne_strrchr(const char*, int);
|
||||||
extern char* strtok(char*, char*);
|
extern char* jehanne_strtok(char*, char*);
|
||||||
extern int strlen(const char*);
|
extern int jehanne_strlen(const char*);
|
||||||
extern int32_t strspn(const char*, const char*);
|
extern int32_t jehanne_strspn(const char*, const char*);
|
||||||
extern int32_t strcspn(const char*, const char*);
|
extern int32_t jehanne_strcspn(const char*, const char*);
|
||||||
extern char* strstr(const char*, const char*);
|
extern char* jehanne_strstr(const char*, const char*);
|
||||||
extern int cistrncmp(const char*, const char*, int);
|
extern int jehanne_cistrncmp(const char*, const char*, int);
|
||||||
extern int cistrcmp(const char*, const char*);
|
extern int jehanne_cistrcmp(const char*, const char*);
|
||||||
extern char* cistrstr(const char*, const char*);
|
extern char* jehanne_cistrstr(const char*, const char*);
|
||||||
extern int tokenize(char*, char**, int);
|
extern int jehanne_tokenize(char*, char**, int);
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
@ -68,58 +68,58 @@ enum
|
|||||||
/*
|
/*
|
||||||
* rune routines
|
* rune routines
|
||||||
*/
|
*/
|
||||||
extern int runetochar(char*, const Rune*);
|
extern int jehanne_runetochar(char*, const Rune*);
|
||||||
extern int chartorune(Rune*, const char*);
|
extern int jehanne_chartorune(Rune*, const char*);
|
||||||
extern int runelen(Rune);
|
extern int jehanne_runelen(Rune);
|
||||||
extern int runenlen(const Rune*, int);
|
extern int jehanne_runenlen(const Rune*, int);
|
||||||
extern int fullrune(const char*, int);
|
extern int jehanne_fullrune(const char*, int);
|
||||||
extern int utflen(const char*);
|
extern int jehanne_utflen(const char*);
|
||||||
extern int utfnlen(const char*, int32_t);
|
extern int jehanne_utfnlen(const char*, int32_t);
|
||||||
extern char* utfrune(const char*, Rune);
|
extern char* jehanne_utfrune(const char*, Rune);
|
||||||
extern char* utfrrune(const char*, Rune);
|
extern char* jehanne_utfrrune(const char*, Rune);
|
||||||
extern char* utfutf(const char*, const char*);
|
extern char* jehanne_utfutf(const char*, const char*);
|
||||||
extern char* utfecpy(char*, char *, const char*);
|
extern char* jehanne_utfecpy(char*, char *, const char*);
|
||||||
|
|
||||||
extern Rune* runestrcat(Rune*, const Rune*);
|
extern Rune* jehanne_runestrcat(Rune*, const Rune*);
|
||||||
extern Rune* runestrchr(const Rune*, Rune);
|
extern Rune* jehanne_runestrchr(const Rune*, Rune);
|
||||||
extern int runestrcmp(const Rune*, const Rune*);
|
extern int jehanne_runestrcmp(const Rune*, const Rune*);
|
||||||
extern Rune* runestrcpy(Rune*, const Rune*);
|
extern Rune* jehanne_runestrcpy(Rune*, const Rune*);
|
||||||
extern Rune* runestrncpy(Rune*, const Rune*, int32_t);
|
extern Rune* jehanne_runestrncpy(Rune*, const Rune*, int32_t);
|
||||||
extern Rune* runestrecpy(Rune*, Rune*, const Rune*);
|
extern Rune* jehanne_runestrecpy(Rune*, Rune*, const Rune*);
|
||||||
extern Rune* runestrdup(const Rune*);
|
extern Rune* jehanne_runestrdup(const Rune*);
|
||||||
extern Rune* runestrncat(Rune*, const Rune*, int32_t);
|
extern Rune* jehanne_runestrncat(Rune*, const Rune*, int32_t);
|
||||||
extern int runestrncmp(const Rune*, const Rune*, int32_t);
|
extern int jehanne_runestrncmp(const Rune*, const Rune*, int32_t);
|
||||||
extern Rune* runestrrchr(const Rune*, Rune);
|
extern Rune* jehanne_runestrrchr(const Rune*, Rune);
|
||||||
extern int32_t runestrlen(const Rune*);
|
extern int32_t jehanne_runestrlen(const Rune*);
|
||||||
extern Rune* runestrstr(const Rune*, const Rune*);
|
extern Rune* jehanne_runestrstr(const Rune*, const Rune*);
|
||||||
|
|
||||||
extern Rune tolowerrune(Rune);
|
extern Rune jehanne_tolowerrune(Rune);
|
||||||
extern Rune totitlerune(Rune);
|
extern Rune jehanne_totitlerune(Rune);
|
||||||
extern Rune toupperrune(Rune);
|
extern Rune jehanne_toupperrune(Rune);
|
||||||
extern Rune tobaserune(Rune);
|
extern Rune jehanne_tobaserune(Rune);
|
||||||
extern int isalpharune(Rune);
|
extern int jehanne_isalpharune(Rune);
|
||||||
extern int isbaserune(Rune);
|
extern int jehanne_isbaserune(Rune);
|
||||||
extern int isdigitrune(Rune);
|
extern int jehanne_isdigitrune(Rune);
|
||||||
extern int islowerrune(Rune);
|
extern int jehanne_islowerrune(Rune);
|
||||||
extern int isspacerune(Rune);
|
extern int jehanne_isspacerune(Rune);
|
||||||
extern int istitlerune(Rune);
|
extern int jehanne_istitlerune(Rune);
|
||||||
extern int isupperrune(Rune);
|
extern int jehanne_isupperrune(Rune);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* malloc
|
* malloc
|
||||||
*/
|
*/
|
||||||
extern void* malloc(size_t);
|
extern void* jehanne_malloc(size_t);
|
||||||
extern void* mallocz(uint32_t, int);
|
extern void* jehanne_mallocz(uint32_t, int);
|
||||||
extern void free(void*);
|
extern void jehanne_free(void*);
|
||||||
extern uint32_t msize(void*);
|
extern uint32_t jehanne_msize(void*);
|
||||||
extern void* mallocalign(uint32_t, uint32_t, int32_t, uint32_t);
|
extern void* jehanne_mallocalign(uint32_t, uint32_t, int32_t, uint32_t);
|
||||||
extern void* calloc(uint32_t, size_t);
|
extern void* jehanne_calloc(uint32_t, size_t);
|
||||||
extern void* realloc(void*, size_t);
|
extern void* jehanne_realloc(void*, size_t);
|
||||||
void setmalloctag(void*, uintptr_t);
|
void jehanne_setmalloctag(void*, uintptr_t);
|
||||||
void setrealloctag(void*, uintptr_t);
|
void jehanne_setrealloctag(void*, uintptr_t);
|
||||||
uintptr_t getmalloctag(void*);
|
uintptr_t jehanne_getmalloctag(void*);
|
||||||
uintptr_t getrealloctag(void*);
|
uintptr_t jehanne_getrealloctag(void*);
|
||||||
void* malloctopoolblock(void*);
|
void* jehanne_malloctopoolblock(void*);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* print routines
|
* print routines
|
||||||
@ -158,164 +158,105 @@ enum{
|
|||||||
FmtFlag = FmtByte << 1
|
FmtFlag = FmtByte << 1
|
||||||
};
|
};
|
||||||
|
|
||||||
extern int print(const char*, ...);
|
extern int jehanne_print(const char*, ...);
|
||||||
extern char* seprint(char*, char*, const char*, ...);
|
extern char* jehanne_seprint(char*, char*, const char*, ...);
|
||||||
extern char* vseprint(char*, char*, const char*, va_list);
|
extern char* jehanne_vseprint(char*, char*, const char*, va_list);
|
||||||
extern int snprint(char*, int, const char*, ...);
|
extern int jehanne_snprint(char*, int, const char*, ...);
|
||||||
extern int vsnprint(char*, int, const char*, va_list);
|
extern int jehanne_vsnprint(char*, int, const char*, va_list);
|
||||||
extern char* smprint(const char*, ...);
|
extern char* jehanne_smprint(const char*, ...);
|
||||||
extern char* vsmprint(const char*, va_list);
|
extern char* jehanne_vsmprint(const char*, va_list);
|
||||||
extern int sprint(char*, const char*, ...);
|
extern int jehanne_sprint(char*, const char*, ...);
|
||||||
extern int fprint(int, const char*, ...);
|
extern int jehanne_fprint(int, const char*, ...);
|
||||||
extern int vfprint(int, const char*, va_list);
|
extern int jehanne_vfprint(int, const char*, va_list);
|
||||||
|
|
||||||
extern int runesprint(Rune*, const char*, ...);
|
extern int jehanne_runesprint(Rune*, const char*, ...);
|
||||||
extern int runesnprint(Rune*, int, const char*, ...);
|
extern int jehanne_runesnprint(Rune*, int, const char*, ...);
|
||||||
extern int runevsnprint(Rune*, int, const char*, va_list);
|
extern int jehanne_runevsnprint(Rune*, int, const char*, va_list);
|
||||||
extern Rune* runeseprint(Rune*, Rune*, const char*, ...);
|
extern Rune* jehanne_runeseprint(Rune*, Rune*, const char*, ...);
|
||||||
extern Rune* runevseprint(Rune*, Rune*, const char*, va_list);
|
extern Rune* jehanne_runevseprint(Rune*, Rune*, const char*, va_list);
|
||||||
extern Rune* runesmprint(const char*, ...);
|
extern Rune* jehanne_runesmprint(const char*, ...);
|
||||||
extern Rune* runevsmprint(const char*, va_list);
|
extern Rune* jehanne_runevsmprint(const char*, va_list);
|
||||||
|
|
||||||
extern int fmtfdinit(Fmt*, int, char*, int);
|
extern int jehanne_fmtfdinit(Fmt*, int, char*, int);
|
||||||
extern int fmtfdflush(Fmt*);
|
extern int jehanne_fmtfdflush(Fmt*);
|
||||||
extern int fmtstrinit(Fmt*);
|
extern int jehanne_fmtstrinit(Fmt*);
|
||||||
extern char* fmtstrflush(Fmt*);
|
extern char* jehanne_fmtstrflush(Fmt*);
|
||||||
extern int runefmtstrinit(Fmt*);
|
extern int jehanne_runefmtstrinit(Fmt*);
|
||||||
extern Rune* runefmtstrflush(Fmt*);
|
extern Rune* jehanne_runefmtstrflush(Fmt*);
|
||||||
|
|
||||||
#pragma varargck argpos fmtprint 2
|
extern int jehanne_fmtinstall(int, int (*)(Fmt*));
|
||||||
#pragma varargck argpos fprint 2
|
extern int jehanne_dofmt(Fmt*, const char*);
|
||||||
#pragma varargck argpos print 1
|
extern int jehanne_dorfmt(Fmt*, const Rune*);
|
||||||
#pragma varargck argpos runeseprint 3
|
extern int jehanne_fmtprint(Fmt*, const char*, ...);
|
||||||
#pragma varargck argpos runesmprint 1
|
extern int jehanne_fmtvprint(Fmt*, const char*, va_list);
|
||||||
#pragma varargck argpos runesnprint 3
|
extern int jehanne_fmtrune(Fmt*, int);
|
||||||
#pragma varargck argpos runesprint 2
|
extern int jehanne_fmtstrcpy(Fmt*, const char*);
|
||||||
#pragma varargck argpos seprint 3
|
extern int jehanne_fmtrunestrcpy(Fmt*, const Rune*);
|
||||||
#pragma varargck argpos smprint 1
|
|
||||||
#pragma varargck argpos snprint 3
|
|
||||||
#pragma varargck argpos sprint 2
|
|
||||||
|
|
||||||
#pragma varargck type "lld" vlong
|
|
||||||
#pragma varargck type "llo" vlong
|
|
||||||
#pragma varargck type "llx" vlong
|
|
||||||
#pragma varargck type "llb" vlong
|
|
||||||
#pragma varargck type "lld" uvlong
|
|
||||||
#pragma varargck type "llo" uvlong
|
|
||||||
#pragma varargck type "llx" uvlong
|
|
||||||
#pragma varargck type "llb" uvlong
|
|
||||||
#pragma varargck type "ld" long
|
|
||||||
#pragma varargck type "lo" long
|
|
||||||
#pragma varargck type "lx" long
|
|
||||||
#pragma varargck type "lb" long
|
|
||||||
#pragma varargck type "ld" ulong
|
|
||||||
#pragma varargck type "lo" ulong
|
|
||||||
#pragma varargck type "lx" ulong
|
|
||||||
#pragma varargck type "lb" ulong
|
|
||||||
#pragma varargck type "d" int
|
|
||||||
#pragma varargck type "o" int
|
|
||||||
#pragma varargck type "x" int
|
|
||||||
#pragma varargck type "c" int
|
|
||||||
#pragma varargck type "C" int
|
|
||||||
#pragma varargck type "b" int
|
|
||||||
#pragma varargck type "d" uint32_t
|
|
||||||
#pragma varargck type "x" uint32_t
|
|
||||||
#pragma varargck type "c" uint32_t
|
|
||||||
#pragma varargck type "C" uint32_t
|
|
||||||
#pragma varargck type "b" uint32_t
|
|
||||||
#pragma varargck type "f" double
|
|
||||||
#pragma varargck type "e" double
|
|
||||||
#pragma varargck type "g" double
|
|
||||||
#pragma varargck type "s" char*
|
|
||||||
#pragma varargck type "q" char*
|
|
||||||
#pragma varargck type "S" Rune*
|
|
||||||
#pragma varargck type "Q" Rune*
|
|
||||||
#pragma varargck type "r" void
|
|
||||||
#pragma varargck type "%" void
|
|
||||||
#pragma varargck type "n" int*
|
|
||||||
#pragma varargck type "p" uintptr_t
|
|
||||||
#pragma varargck type "p" void*
|
|
||||||
#pragma varargck flag ','
|
|
||||||
#pragma varargck flag ' '
|
|
||||||
#pragma varargck flag 'h'
|
|
||||||
#pragma varargck type "<" void*
|
|
||||||
#pragma varargck type "[" void*
|
|
||||||
#pragma varargck type "H" void*
|
|
||||||
#pragma varargck type "lH" void*
|
|
||||||
|
|
||||||
extern int fmtinstall(int, int (*)(Fmt*));
|
|
||||||
extern int dofmt(Fmt*, const char*);
|
|
||||||
extern int dorfmt(Fmt*, const Rune*);
|
|
||||||
extern int fmtprint(Fmt*, const char*, ...);
|
|
||||||
extern int fmtvprint(Fmt*, const char*, va_list);
|
|
||||||
extern int fmtrune(Fmt*, int);
|
|
||||||
extern int fmtstrcpy(Fmt*, const char*);
|
|
||||||
extern int fmtrunestrcpy(Fmt*, const Rune*);
|
|
||||||
/*
|
/*
|
||||||
* error string for %r
|
* error string for %r
|
||||||
* supplied on per os basis, not part of fmt library
|
* supplied on per os basis, not part of fmt library
|
||||||
*/
|
*/
|
||||||
extern int errfmt(Fmt *f);
|
extern int jehanne_errfmt(Fmt *f);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* quoted strings
|
* quoted strings
|
||||||
*/
|
*/
|
||||||
extern char *unquotestrdup(const char*);
|
extern char *jehanne_unquotestrdup(const char*);
|
||||||
extern Rune *unquoterunestrdup(const Rune*);
|
extern Rune *jehanne_unquoterunestrdup(const Rune*);
|
||||||
extern char *quotestrdup(const char*);
|
extern char *jehanne_quotestrdup(const char*);
|
||||||
extern Rune *quoterunestrdup(const Rune*);
|
extern Rune *jehanne_quoterunestrdup(const Rune*);
|
||||||
extern int quotestrfmt(Fmt*);
|
extern int jehanne_quotestrfmt(Fmt*);
|
||||||
extern int quoterunestrfmt(Fmt*);
|
extern int jehanne_quoterunestrfmt(Fmt*);
|
||||||
extern void quotefmtinstall(void);
|
extern void jehanne_quotefmtinstall(void);
|
||||||
extern int (*doquote)(int);
|
extern int (*doquote)(int);
|
||||||
extern int needsrcquote(int);
|
extern int jehanne_needsrcquote(int);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* random number
|
* random number
|
||||||
*/
|
*/
|
||||||
extern void srand(int32_t);
|
extern void jehanne_srand(int32_t);
|
||||||
extern int rand(void);
|
extern int jehanne_rand(void);
|
||||||
extern int nrand(int);
|
extern int jehanne_nrand(int);
|
||||||
extern int32_t lrand(void);
|
extern int32_t jehanne_lrand(void);
|
||||||
extern int32_t lnrand(int32_t);
|
extern int32_t jehanne_lnrand(int32_t);
|
||||||
extern double frand(void);
|
extern double jehanne_frand(void);
|
||||||
extern uint32_t truerand(void); /* uses /dev/random */
|
extern uint32_t jehanne_truerand(void); /* uses /dev/random */
|
||||||
extern uint32_t ntruerand(uint32_t); /* uses /dev/random */
|
extern uint32_t jehanne_ntruerand(uint32_t); /* uses /dev/random */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* math
|
* math
|
||||||
*/
|
*/
|
||||||
extern uint32_t getfcr(void);
|
extern uint32_t jehanne_getfcr(void);
|
||||||
extern void setfsr(uint32_t);
|
extern void jehanne_setfsr(uint32_t);
|
||||||
extern uint32_t getfsr(void);
|
extern uint32_t getfsr(void);
|
||||||
extern void setfcr(uint32_t);
|
extern void jehanne_setfcr(uint32_t);
|
||||||
extern double NaN(void);
|
extern double jehanne_NaN(void);
|
||||||
extern double Inf(int);
|
extern double jehanne_Inf(int);
|
||||||
extern int isNaN(double);
|
extern int jehanne_isNaN(double);
|
||||||
extern int isInf(double, int);
|
extern int jehanne_isInf(double, int);
|
||||||
extern uint32_t umuldiv(uint32_t, uint32_t, uint32_t);
|
extern uint32_t jehanne_umuldiv(uint32_t, uint32_t, uint32_t);
|
||||||
extern int32_t muldiv(int32_t, int32_t, int32_t);
|
extern int32_t jehanne_muldiv(int32_t, int32_t, int32_t);
|
||||||
|
|
||||||
extern double pow(double, double);
|
extern double jehanne_pow(double, double);
|
||||||
extern double atan2(double, double);
|
extern double jehanne_atan2(double, double);
|
||||||
extern double fabs(double);
|
extern double jehanne_fabs(double);
|
||||||
extern double atan(double);
|
extern double jehanne_atan(double);
|
||||||
extern double log(double);
|
extern double jehanne_log(double);
|
||||||
extern double log10(double);
|
extern double jehanne_log10(double);
|
||||||
extern double exp(double);
|
extern double jehanne_exp(double);
|
||||||
extern double floor(double);
|
extern double jehanne_floor(double);
|
||||||
extern double ceil(double);
|
extern double jehanne_ceil(double);
|
||||||
extern double hypot(double, double);
|
extern double jehanne_hypot(double, double);
|
||||||
extern double sin(double);
|
extern double jehanne_sin(double);
|
||||||
extern double cos(double);
|
extern double jehanne_cos(double);
|
||||||
extern double tan(double);
|
extern double jehanne_tan(double);
|
||||||
extern double asin(double);
|
extern double jehanne_asin(double);
|
||||||
extern double acos(double);
|
extern double jehanne_acos(double);
|
||||||
extern double sinh(double);
|
extern double jehanne_sinh(double);
|
||||||
extern double cosh(double);
|
extern double jehanne_cosh(double);
|
||||||
extern double tanh(double);
|
extern double jehanne_tanh(double);
|
||||||
extern double sqrt(double);
|
extern double jehanne_sqrt(double);
|
||||||
extern double fmod(double, double);
|
extern double jehanne_fmod(double, double);
|
||||||
|
|
||||||
#define HUGE 3.4028234e38
|
#define HUGE 3.4028234e38
|
||||||
#define PIO2 1.570796326794896619231e0
|
#define PIO2 1.570796326794896619231e0
|
||||||
@ -340,14 +281,14 @@ struct Tm
|
|||||||
int tzoff;
|
int tzoff;
|
||||||
} Tm;
|
} Tm;
|
||||||
|
|
||||||
extern Tm* gmtime(int32_t);
|
extern Tm* jehanne_gmtime(int32_t);
|
||||||
extern Tm* localtime(int32_t);
|
extern Tm* jehanne_localtime(int32_t);
|
||||||
extern char* asctime(Tm*);
|
extern char* jehanne_asctime(Tm*);
|
||||||
extern char* ctime(int32_t);
|
extern char* jehanne_ctime(int32_t);
|
||||||
extern double cputime(void);
|
extern double jehanne_cputime(void);
|
||||||
extern int32_t times(int32_t*);
|
extern int32_t jehanne_times(int32_t*);
|
||||||
extern int32_t tm2sec(Tm*);
|
extern int32_t jehanne_tm2sec(Tm*);
|
||||||
//extern int64_t nsec(void);
|
//extern int64_t jehanne_nsec(void);
|
||||||
|
|
||||||
extern void cycles(uint64_t*); /* 64-bit value of the cycle counter if there is one, 0 if there isn't */
|
extern void cycles(uint64_t*); /* 64-bit value of the cycle counter if there is one, 0 if there isn't */
|
||||||
|
|
||||||
@ -360,73 +301,71 @@ enum
|
|||||||
PNGROUP = 2,
|
PNGROUP = 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
extern void _assert(const char*) __attribute__ ((noreturn));
|
extern void jehanne__assert(const char*) __attribute__ ((noreturn));
|
||||||
extern int abs(int);
|
extern int jehanne_abs(int);
|
||||||
extern int atexit(void(*)(void));
|
extern int jehanne_atexit(void(*)(void));
|
||||||
extern void atexitdont(void(*)(void));
|
extern void jehanne_atexitdont(void(*)(void));
|
||||||
extern int atnotify(int(*)(void*, char*), int);
|
extern int jehanne_atnotify(int(*)(void*, char*), int);
|
||||||
extern double atof(const char*);
|
extern double jehanne_atof(const char*);
|
||||||
extern int atoi(const char*);
|
extern int jehanne_atoi(const char*);
|
||||||
extern int32_t atol(const char*);
|
extern int32_t jehanne_atol(const char*);
|
||||||
extern int64_t atoll(const char*);
|
extern int64_t jehanne_atoll(const char*);
|
||||||
extern double charstod(int(*)(void*), void*);
|
extern double jehanne_charstod(int(*)(void*), void*);
|
||||||
extern int chdir(const char *dirname);
|
extern int jehanne_chdir(const char *dirname);
|
||||||
extern char* cleanname(char*);
|
extern char* jehanne_cleanname(char*);
|
||||||
extern int decrypt(void*, void*, int);
|
extern int decrypt(void*, void*, int);
|
||||||
extern int encrypt(void*, void*, int);
|
extern int encrypt(void*, void*, int);
|
||||||
extern int dec64(uint8_t*, int, const char*, int);
|
extern int jehanne_dec64(uint8_t*, int, const char*, int);
|
||||||
extern int enc64(char*, int, const uint8_t*, int);
|
extern int jehanne_enc64(char*, int, const uint8_t*, int);
|
||||||
extern int dec32(uint8_t*, int, const char*, int);
|
extern int jehanne_dec32(uint8_t*, int, const char*, int);
|
||||||
extern int enc32(char*, int, const uint8_t*, int);
|
extern int jehanne_enc32(char*, int, const uint8_t*, int);
|
||||||
extern int dec16(uint8_t*, int, const char*, int);
|
extern int jehanne_dec16(uint8_t*, int, const char*, int);
|
||||||
extern int enc16(char*, int, const uint8_t*, int);
|
extern int jehanne_enc16(char*, int, const uint8_t*, int);
|
||||||
extern int encodefmt(Fmt*);
|
extern int jehanne_encodefmt(Fmt*);
|
||||||
extern void exits(const char*) __attribute__ ((noreturn));
|
extern void jehanne_exits(const char*) __attribute__ ((noreturn));
|
||||||
extern double frexp(double, int*);
|
extern double jehanne_frexp(double, int*);
|
||||||
extern uintptr_t getcallerpc(void);
|
extern uintptr_t jehanne_getcallerpc(void);
|
||||||
extern char* getenv(const char*);
|
extern char* jehanne_getenv(const char*);
|
||||||
extern int getfields(char*, char**, int, int, const char*);
|
extern int jehanne_getfields(char*, char**, int, int, const char*);
|
||||||
extern int gettokens(char *, char **, int, const char *);
|
extern int jehanne_gettokens(char *, char **, int, const char *);
|
||||||
extern char* getuser(void);
|
extern char* jehanne_getuser(void);
|
||||||
extern long getwd(char*, int);
|
extern long jehanne_getwd(char*, int);
|
||||||
extern int iounit(int);
|
extern int jehanne_iounit(int);
|
||||||
extern int32_t labs(int32_t);
|
extern int32_t jehanne_labs(int32_t);
|
||||||
extern double ldexp(double, int);
|
extern double jehanne_ldexp(double, int);
|
||||||
extern void longjmp(jmp_buf, int);
|
extern void jehanne_longjmp(jmp_buf, int);
|
||||||
extern char* mktemp(char*);
|
extern char* jehanne_mktemp(char*);
|
||||||
extern double modf(double, double*);
|
extern double jehanne_modf(double, double*);
|
||||||
extern void notejmp(void*, jmp_buf, int);
|
extern void jehanne_notejmp(void*, jmp_buf, int);
|
||||||
extern unsigned long nsec(void);
|
extern unsigned long jehanne_nsec(void);
|
||||||
extern int dup(int oldfd, int newfd);
|
extern int jehanne_dup(int oldfd, int newfd);
|
||||||
extern int ocreate(const char* path, unsigned int omode, unsigned int perm);
|
extern int jehanne_ocreate(const char* path, unsigned int omode, unsigned int perm);
|
||||||
extern void perror(const char*);
|
extern void jehanne_perror(const char*);
|
||||||
extern int pipe(int pipes[2]);
|
extern int jehanne_pipe(int pipes[2]);
|
||||||
extern int postnote(int, int, const char *);
|
extern int jehanne_postnote(int, int, const char *);
|
||||||
extern double pow10(int);
|
extern double jehanne_pow10(int);
|
||||||
extern int putenv(const char*, const char*);
|
extern int jehanne_putenv(const char*, const char*);
|
||||||
extern void qsort(void*, long, int,
|
extern void jehanne_qsort(void*, long, int,
|
||||||
int (*)(const void*, const void*));
|
int (*)(const void*, const void*));
|
||||||
extern void* bsearch(const void* key, const void* base, size_t nmemb, size_t size,
|
extern void* jehanne_bsearch(const void* key, const void* base, size_t nmemb, size_t size,
|
||||||
int (*compar)(const void*, const void*));
|
int (*compar)(const void*, const void*));
|
||||||
extern int setjmp(jmp_buf);
|
extern int jehanne_setjmp(jmp_buf);
|
||||||
extern double strtod(const char*, const char**);
|
extern double jehanne_strtod(const char*, const char**);
|
||||||
extern int32_t strtol(const char*, char**, int);
|
extern int32_t jehanne_strtol(const char*, char**, int);
|
||||||
extern uint32_t strtoul(const char*, char**, int);
|
extern uint32_t jehanne_strtoul(const char*, char**, int);
|
||||||
extern int64_t strtoll(const char*, char**, int);
|
extern int64_t jehanne_strtoll(const char*, char**, int);
|
||||||
extern uint64_t strtoull(const char*, char**, int);
|
extern uint64_t jehanne_strtoull(const char*, char**, int);
|
||||||
extern void sysfatal(const char*, ...);
|
extern void jehanne_sysfatal(const char*, ...);
|
||||||
#pragma varargck argpos sysfatal 1
|
extern void jehanne_syslog(int, const char*, const char*, ...);
|
||||||
extern void syslog(int, const char*, const char*, ...);
|
extern int32_t jehanne_time(int32_t*);
|
||||||
#pragma varargck argpos syslog 3
|
extern int jehanne_tolower(int);
|
||||||
extern int32_t time(int32_t*);
|
extern int jehanne_toupper(int);
|
||||||
extern int tolower(int);
|
|
||||||
extern int toupper(int);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* atomic
|
* atomic
|
||||||
*/
|
*/
|
||||||
int32_t ainc(int32_t*);
|
int32_t jehanne_ainc(int32_t*);
|
||||||
int32_t adec(int32_t*);
|
int32_t jehanne_adec(int32_t*);
|
||||||
#define cas(ptr, oldval, newval) __sync_bool_compare_and_swap(ptr, oldval, newval)
|
#define cas(ptr, oldval, newval) __sync_bool_compare_and_swap(ptr, oldval, newval)
|
||||||
#define casv(ptr, oldval, newval) __sync_val_compare_and_swap(ptr, oldval, newval)
|
#define casv(ptr, oldval, newval) __sync_val_compare_and_swap(ptr, oldval, newval)
|
||||||
|
|
||||||
@ -439,12 +378,12 @@ struct Lock {
|
|||||||
int32_t sem;
|
int32_t sem;
|
||||||
} Lock;
|
} Lock;
|
||||||
|
|
||||||
extern int _tas(int*);
|
extern int jehanne__tas(int*);
|
||||||
|
|
||||||
extern void lock(Lock*);
|
extern void jehanne_lock(Lock*);
|
||||||
extern int lockt(Lock*, uint32_t);
|
extern int jehanne_lockt(Lock*, uint32_t);
|
||||||
extern void unlock(Lock*);
|
extern void jehanne_unlock(Lock*);
|
||||||
extern int canlock(Lock*);
|
extern int jehanne_canlock(Lock*);
|
||||||
|
|
||||||
typedef struct QLp QLp;
|
typedef struct QLp QLp;
|
||||||
struct QLp
|
struct QLp
|
||||||
@ -462,11 +401,11 @@ struct QLock
|
|||||||
QLp *tail;
|
QLp *tail;
|
||||||
} QLock;
|
} QLock;
|
||||||
|
|
||||||
extern void qlock(QLock*);
|
extern void jehanne_qlock(QLock*);
|
||||||
extern int qlockt(QLock*, uint32_t);
|
extern int jehanne_qlockt(QLock*, uint32_t);
|
||||||
extern void qunlock(QLock*);
|
extern void jehanne_qunlock(QLock*);
|
||||||
extern int canqlock(QLock*);
|
extern int jehanne_canqlock(QLock*);
|
||||||
extern void _qlockinit(void* (*)(void*, void*)); /* called only by the thread library */
|
extern void jehanne__qlockinit(void* (*)(void*, void*)); /* called only by the thread library */
|
||||||
|
|
||||||
typedef
|
typedef
|
||||||
struct RWLock
|
struct RWLock
|
||||||
@ -478,14 +417,14 @@ struct RWLock
|
|||||||
QLp *tail;
|
QLp *tail;
|
||||||
} RWLock;
|
} RWLock;
|
||||||
|
|
||||||
extern void rlock(RWLock*);
|
extern void jehanne_rlock(RWLock*);
|
||||||
extern int rlockt(RWLock*, uint32_t);
|
extern int jehanne_rlockt(RWLock*, uint32_t);
|
||||||
extern void runlock(RWLock*);
|
extern void jehanne_runlock(RWLock*);
|
||||||
extern int canrlock(RWLock*);
|
extern int jehanne_canrlock(RWLock*);
|
||||||
extern void wlock(RWLock*);
|
extern void jehanne_wlock(RWLock*);
|
||||||
extern int wlockt(RWLock*, uint32_t);
|
extern int jehanne_wlockt(RWLock*, uint32_t);
|
||||||
extern void wunlock(RWLock*);
|
extern void jehanne_wunlock(RWLock*);
|
||||||
extern int canwlock(RWLock*);
|
extern int jehanne_canwlock(RWLock*);
|
||||||
|
|
||||||
typedef
|
typedef
|
||||||
struct Rendez
|
struct Rendez
|
||||||
@ -495,31 +434,31 @@ struct Rendez
|
|||||||
QLp *tail;
|
QLp *tail;
|
||||||
} Rendez;
|
} Rendez;
|
||||||
|
|
||||||
extern void rsleep(Rendez*); /* unlocks r->l, sleeps, locks r->l again */
|
extern void jehanne_rsleep(Rendez*); /* unlocks r->l, sleeps, locks r->l again */
|
||||||
extern int rsleept(Rendez*, uint32_t); /* unlocks r->l, sleeps (up to ms), locks r->l again (if not timedout) */
|
extern int jehanne_rsleept(Rendez*, uint32_t); /* unlocks r->l, sleeps (up to ms), locks r->l again (if not timedout) */
|
||||||
extern int rwakeup(Rendez*);
|
extern int jehanne_rwakeup(Rendez*);
|
||||||
extern int rwakeupall(Rendez*);
|
extern int jehanne_rwakeupall(Rendez*);
|
||||||
extern void** privalloc(void);
|
extern void** jehanne_privalloc(void);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* network dialing
|
* network dialing
|
||||||
*/
|
*/
|
||||||
#define NETPATHLEN 40
|
#define NETPATHLEN 40
|
||||||
extern int accept(int, const char*);
|
extern int jehanne_accept(int, const char*);
|
||||||
extern int announce(const char*, char*);
|
extern int jehanne_announce(const char*, char*);
|
||||||
extern int dial(const char*, const char*, char*, int*);
|
extern int jehanne_dial(const char*, const char*, char*, int*);
|
||||||
extern void setnetmtpt(char*, int, const char*);
|
extern void jehanne_setnetmtpt(char*, int, const char*);
|
||||||
extern int hangup(int);
|
extern int jehanne_hangup(int);
|
||||||
extern int listen(const char*, char*);
|
extern int jehanne_listen(const char*, char*);
|
||||||
extern char* netmkaddr(const char*, const char*, const char*);
|
extern char* jehanne_netmkaddr(const char*, const char*, const char*);
|
||||||
extern int reject(int, const char*, const char*);
|
extern int jehanne_reject(int, const char*, const char*);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* encryption
|
* encryption
|
||||||
*/
|
*/
|
||||||
extern int pushssl(int, const char*, const char*, const char*, int*);
|
extern int jehanne_pushssl(int, const char*, const char*, const char*, int*);
|
||||||
extern int pushtls(int, const char*, const char*, int, const char*,
|
//extern int jehanne_pushtls(int, const char*, const char*, int, const char*,
|
||||||
char*);
|
// char*);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* network services
|
* network services
|
||||||
@ -537,8 +476,8 @@ struct NetConnInfo
|
|||||||
char *laddr; /* local address */
|
char *laddr; /* local address */
|
||||||
char *raddr; /* remote address */
|
char *raddr; /* remote address */
|
||||||
};
|
};
|
||||||
extern NetConnInfo* getnetconninfo(const char*, int);
|
extern NetConnInfo* jehanne_getnetconninfo(const char*, int);
|
||||||
extern void freenetconninfo(NetConnInfo*);
|
extern void jehanne_freenetconninfo(NetConnInfo*);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* system calls
|
* system calls
|
||||||
@ -571,7 +510,7 @@ extern void freenetconninfo(NetConnInfo*);
|
|||||||
|
|
||||||
/* Access modes */
|
/* Access modes */
|
||||||
#define AEXIST 0 /* accessible: exists */
|
#define AEXIST 0 /* accessible: exists */
|
||||||
#define AREAD 4 /* read access */
|
#define AREAD 4 /* read ccess */
|
||||||
#define AWRITE 2 /* write access */
|
#define AWRITE 2 /* write access */
|
||||||
#define AEXEC 1 /* execute access */
|
#define AEXEC 1 /* execute access */
|
||||||
#define AMASK (AEXIST|AREAD|AWRITE|AEXEC)
|
#define AMASK (AEXIST|AREAD|AWRITE|AEXEC)
|
||||||
@ -656,47 +595,49 @@ struct Waitmsg
|
|||||||
char *msg;
|
char *msg;
|
||||||
} Waitmsg;
|
} Waitmsg;
|
||||||
|
|
||||||
extern int access(const char*, int);
|
extern int jehanne_access(const char*, int);
|
||||||
extern int awakened(int64_t);
|
extern int jehanne_awakened(int64_t);
|
||||||
extern int brk(void*);
|
extern int jehanne_brk(void*);
|
||||||
extern int execl(const char*, ...);
|
extern int jehanne_execl(const char*, ...);
|
||||||
extern int forgivewkp(int64_t);
|
extern int jehanne_forgivewkp(int64_t);
|
||||||
extern pid_t fork(void);
|
extern pid_t jehanne_fork(void);
|
||||||
extern int32_t readn(int, void*, int32_t);
|
extern int32_t jehanne_readn(int, void*, int32_t);
|
||||||
extern void* sbrk(uint32_t);
|
extern void* jehanne_segbrk(uint32_t);
|
||||||
extern int32_t oseek(int, int32_t, int);
|
#define sbrk(incr) jehanne_segbrk(incr)
|
||||||
extern void* segattach(int, const char*, void*, unsigned long);
|
extern void* jehanne_segattach(int, const char*, void*, unsigned long);
|
||||||
extern int segdetach(void*);
|
extern int jehanne_segdetach(void*);
|
||||||
extern int segfree(void*, unsigned long);
|
extern int jehanne_segfree(void*, unsigned long);
|
||||||
extern void sleep(int32_t);
|
extern void jehanne_sleep(int32_t);
|
||||||
extern int stat(const char*, uint8_t*, int);
|
extern int jehanne_stat(const char*, uint8_t*, int);
|
||||||
extern Waitmsg* wait(void);
|
extern Waitmsg* jehanne_wait(void);
|
||||||
extern int waitpid(void);
|
extern int jehanne_waitpid(void);
|
||||||
extern int wstat(const char*, uint8_t*, int);
|
extern int jehanne_wstat(const char*, uint8_t*, int);
|
||||||
|
|
||||||
extern Dir* dirstat(const char*);
|
extern Dir* jehanne_dirstat(const char*);
|
||||||
extern Dir* dirfstat(int);
|
extern Dir* jehanne_dirfstat(int);
|
||||||
extern int dirwstat(const char*, Dir*);
|
extern int jehanne_dirwstat(const char*, Dir*);
|
||||||
extern int dirfwstat(int, Dir*);
|
extern int jehanne_dirfwstat(int, Dir*);
|
||||||
extern int32_t dirread(int, Dir**);
|
extern int32_t jehanne_dirread(int, Dir**);
|
||||||
extern void nulldir(Dir*);
|
extern void jehanne_nulldir(Dir*);
|
||||||
extern int32_t dirreadall(int, Dir**);
|
extern int32_t jehanne_dirreadall(int, Dir**);
|
||||||
extern int32_t getpid(void);
|
extern int32_t jehanne_getpid(void);
|
||||||
extern int32_t getppid(void);
|
extern int32_t jehanne_getppid(void);
|
||||||
extern int32_t getmainpid(void);
|
extern int32_t jehanne_getmainpid(void);
|
||||||
extern void rerrstr(char*, uint32_t);
|
extern void jehanne_rerrstr(char*, uint32_t);
|
||||||
extern char* sysname(void);
|
extern char* jehanne_sysname(void);
|
||||||
extern void werrstr(const char*, ...);
|
extern void jehanne_werrstr(const char*, ...);
|
||||||
#pragma varargck argpos werrstr 1
|
|
||||||
|
|
||||||
|
extern unsigned int jehanne_convM2D(uint8_t*, uint, Dir*, char*);
|
||||||
|
extern unsigned int jehanne_convD2M(Dir*, uint8_t*, uint);
|
||||||
|
extern unsigned int jehanne_sizeD2M(Dir*);
|
||||||
|
extern int jehanne_dirmodefmt(Fmt*);
|
||||||
|
|
||||||
extern unsigned int convM2D(uint8_t*, uint, Dir*, char*);
|
#ifndef NPRIVATES
|
||||||
extern unsigned int convD2M(Dir*, uint8_t*, uint);
|
# define NPRIVATES 16
|
||||||
extern unsigned int sizeD2M(Dir*);
|
#endif
|
||||||
extern int dirfmt(Fmt*);
|
|
||||||
extern int dirmodefmt(Fmt*);
|
|
||||||
#pragma varargck type "D" Dir*
|
|
||||||
|
|
||||||
|
/* can be overwritten to do anything before calling main */
|
||||||
|
extern void __libc_init(int argc, char *argv[]) __attribute__((weak, noreturn));
|
||||||
|
|
||||||
/* compiler directives on plan 9 */
|
/* compiler directives on plan 9 */
|
||||||
#define SET(x) ((x)=0)
|
#define SET(x) ((x)=0)
|
||||||
@ -723,7 +664,7 @@ extern char *argv0;
|
|||||||
argc--; argv++; break;\
|
argc--; argv++; break;\
|
||||||
}\
|
}\
|
||||||
_argc = 0;\
|
_argc = 0;\
|
||||||
while(*_args && (_args += chartorune(&_argc, _args)))\
|
while(*_args && (_args += jehanne_chartorune(&_argc, _args)))\
|
||||||
switch(_argc)
|
switch(_argc)
|
||||||
/* #define ARGEND SET(_argt);USED(_argt,_argc,_args);}USED(argv, argc); */
|
/* #define ARGEND SET(_argt);USED(_argt,_argc,_args);}USED(argv, argc); */
|
||||||
#define ARGEND SET(_argt);USED(_argt);USED(_argc);USED(_args);}USED(argv);USED(argc);
|
#define ARGEND SET(_argt);USED(_argt);USED(_argc);USED(_args);}USED(argv);USED(argc);
|
||||||
@ -734,6 +675,6 @@ extern char *argv0;
|
|||||||
|
|
||||||
#define ARGC() _argc
|
#define ARGC() _argc
|
||||||
|
|
||||||
/* this is used by sbrk and brk, it's a really bad idea to redefine it */
|
/* this is used by segbrk and brk, it's a really bad idea to redefine it */
|
||||||
extern char end[];
|
extern char end[];
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <draw.h>
|
#include <draw.h>
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
#include <cursor.h>
|
#include <cursor.h>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <draw.h>
|
#include <draw.h>
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
#include <cursor.h>
|
#include <cursor.h>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* like fprint but be sure to deliver as a single write.
|
* like fprint but be sure to deliver as a single write.
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
|
|
||||||
void
|
void
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <9P2000.h>
|
#include <9P2000.h>
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
#include <9p.h>
|
#include <9p.h>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <bio.h>
|
#include <bio.h>
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
#include <9P2000.h>
|
#include <9P2000.h>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <9P2000.h>
|
#include <9P2000.h>
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
#include <9p.h>
|
#include <9p.h>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <bio.h>
|
#include <bio.h>
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
#include "dat.h"
|
#include "dat.h"
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <bio.h>
|
#include <bio.h>
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
#include "dat.h"
|
#include "dat.h"
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <draw.h>
|
#include <draw.h>
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
#include <cursor.h>
|
#include <cursor.h>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <draw.h>
|
#include <draw.h>
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
#include <cursor.h>
|
#include <cursor.h>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <draw.h>
|
#include <draw.h>
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
#include <cursor.h>
|
#include <cursor.h>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <draw.h>
|
#include <draw.h>
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
#include <cursor.h>
|
#include <cursor.h>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <draw.h>
|
#include <draw.h>
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
#include <cursor.h>
|
#include <cursor.h>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <draw.h>
|
#include <draw.h>
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
#include <cursor.h>
|
#include <cursor.h>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <draw.h>
|
#include <draw.h>
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
#include <cursor.h>
|
#include <cursor.h>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <draw.h>
|
#include <draw.h>
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
#include <cursor.h>
|
#include <cursor.h>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <draw.h>
|
#include <draw.h>
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
#include <cursor.h>
|
#include <cursor.h>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <draw.h>
|
#include <draw.h>
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
#include <cursor.h>
|
#include <cursor.h>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <draw.h>
|
#include <draw.h>
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
#include <cursor.h>
|
#include <cursor.h>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <draw.h>
|
#include <draw.h>
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
#include <cursor.h>
|
#include <cursor.h>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <draw.h>
|
#include <draw.h>
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
#include <cursor.h>
|
#include <cursor.h>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <draw.h>
|
#include <draw.h>
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
#include <cursor.h>
|
#include <cursor.h>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <draw.h>
|
#include <draw.h>
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
#include <cursor.h>
|
#include <cursor.h>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <draw.h>
|
#include <draw.h>
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
#include <cursor.h>
|
#include <cursor.h>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <draw.h>
|
#include <draw.h>
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
#include <cursor.h>
|
#include <cursor.h>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <draw.h>
|
#include <draw.h>
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
#include <cursor.h>
|
#include <cursor.h>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <bio.h>
|
#include <bio.h>
|
||||||
|
|
||||||
#define MAXBASE 36
|
#define MAXBASE 36
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* needs #¤/caphash and #¤/capuse.
|
* needs #¤/caphash and #¤/capuse.
|
||||||
*/
|
*/
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <bio.h>
|
#include <bio.h>
|
||||||
#include <libsec.h>
|
#include <libsec.h>
|
||||||
#include <auth.h>
|
#include <auth.h>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <bio.h>
|
#include <bio.h>
|
||||||
#include <mp.h>
|
#include <mp.h>
|
||||||
#include <libsec.h>
|
#include <libsec.h>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <bio.h>
|
#include <bio.h>
|
||||||
#include <mp.h>
|
#include <mp.h>
|
||||||
#include <libsec.h>
|
#include <libsec.h>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <bio.h>
|
#include <bio.h>
|
||||||
#include <ndb.h>
|
#include <ndb.h>
|
||||||
#include <regexp.h>
|
#include <regexp.h>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <auth.h>
|
#include <auth.h>
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <libsec.h>
|
#include <libsec.h>
|
||||||
#include <authsrv.h>
|
#include <authsrv.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <bio.h>
|
#include <bio.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include "authcmdlib.h"
|
#include "authcmdlib.h"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <authsrv.h>
|
#include <authsrv.h>
|
||||||
#include <mp.h>
|
#include <mp.h>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <bio.h>
|
#include <bio.h>
|
||||||
#include <libsec.h>
|
#include <libsec.h>
|
||||||
#include <auth.h>
|
#include <auth.h>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <lib9.h>
|
||||||
#include <bio.h>
|
#include <bio.h>
|
||||||
#include <ndb.h>
|
#include <ndb.h>
|
||||||
#include <auth.h>
|
#include <auth.h>
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user