]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/include/libc.h
libsec: use tsmemcmp() when comparing hashes, use mpfield() for ecc, use mptober...
[plan9front.git] / sys / include / libc.h
index c84acc0f5a629c6031ce88094d6994456cfa3708..bd273d8b8e23903c313485889927a100c4ee0bae 100644 (file)
@@ -41,12 +41,12 @@ extern      int     tokenize(char*, char**, int);
 
 enum
 {
-       UTFmax          = 3,            /* maximum bytes per rune */
+       UTFmax          = 4,            /* maximum bytes per rune */
        Runesync        = 0x80,         /* cannot represent part of a UTF sequence (<) */
        Runeself        = 0x80,         /* rune and UTF sequences are the same (<) */
        Runeerror       = 0xFFFD,       /* decoding error in UTF */
-       Runemax         = 0xFFFF,       /* 16 bit rune */
-       Runemask        = 0xFFFF,       /* bits used by runes (see grep) */
+       Runemax         = 0x10FFFF,     /* 21 bit rune */
+       Runemask        = 0x1FFFFF,     /* bits used by runes (see grep) */
 };
 
 /*
@@ -97,10 +97,10 @@ extern      ulong   msize(void*);
 extern void*   mallocalign(ulong, ulong, long, ulong);
 extern void*   calloc(ulong, ulong);
 extern void*   realloc(void*, ulong);
-extern void    setmalloctag(void*, ulong);
-extern void    setrealloctag(void*, ulong);
-extern ulong   getmalloctag(void*);
-extern ulong   getrealloctag(void*);
+extern void    setmalloctag(void*, uintptr);
+extern void    setrealloctag(void*, uintptr);
+extern uintptr getmalloctag(void*);
+extern uintptr getrealloctag(void*);
 extern void*   malloctopoolblock(void*);
 
 /*
@@ -409,19 +409,12 @@ enum {
 }; /* what */
 extern void    prof(void (*fn)(void*), void *arg, int entries, int what);
 
-/*
- *  atomic
- */
-extern long    ainc(long*);
-extern long    adec(long*);
-
 /*
  *  synchronization
  */
 typedef
 struct Lock {
-       long    key;
-       long    sem;
+       int     val;
 } Lock;
 
 extern int     _tas(int*);
@@ -481,7 +474,6 @@ extern      void    rsleep(Rendez*);        /* unlocks r->l, sleeps, locks r->l again */
 extern int     rwakeup(Rendez*);
 extern int     rwakeupall(Rendez*);
 extern void**  privalloc(void);
-extern void    privfree(void**);
 
 /*
  *  network dialing
@@ -708,6 +700,9 @@ extern      char*   sysname(void);
 extern void    werrstr(char*, ...);
 #pragma        varargck        argpos  werrstr 1
 
+extern long    ainc(long*);
+extern long    adec(long*);
+
 extern char *argv0;
 #define        ARGBEGIN        for((argv0||(argv0=*argv)),argv++,argc--;\
                            argv[0] && argv[0][0]=='-' && argv[0][1];\