]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/lib.h
UCW docs: split definitions off the main index
[libucw.git] / ucw / lib.h
index 904cadeee5a4b01e681a8f3367bb380f4bc6e4b1..e4352ee85d9e7a675262e839b15302a1e164b0c7 100644 (file)
--- a/ucw/lib.h
+++ b/ucw/lib.h
@@ -43,7 +43,8 @@
 #define COMPARE_LT(x,y) do { if ((x)<(y)) return 1; if ((x)>(y)) return 0; } while(0)
 #define COMPARE_GT(x,y) COMPARE_LT(y,x)
 
-#define        ROL(x, bits) (((x) << (bits)) | ((x) >> (sizeof(uns)*8 - (bits))))      /* Bitwise rotation of an uns to the left */
+#define        ROL(x, bits) (((x) << (bits)) | ((uns)(x) >> (sizeof(uns)*8 - (bits)))) /* Bitwise rotation of an uns to the left */
+#define        ROR(x, bits) (((uns)(x) >> (bits)) | ((x) << (sizeof(uns)*8 - (bits))))
 
 /* GCC Extensions */
 
@@ -132,9 +133,9 @@ void assert_failed_noinfo(void) NONRET;
 
 /* Memory allocation */
 
-#define xmalloc sh_xmalloc
-#define xrealloc sh_xrealloc
-#define xfree sh_xfree
+#define xmalloc ucw_xmalloc
+#define xrealloc ucw_xrealloc
+#define xfree ucw_xfree
 
 /*
  * Unfortunately, several libraries we might want to link to define
@@ -148,16 +149,6 @@ void xfree(void *);
 void *xmalloc_zero(uns) LIKE_MALLOC;
 char *xstrdup(const char *) LIKE_MALLOC;
 
-/* prime.c */
-
-int isprime(uns x);
-uns nextprime(uns x);
-
-/* primetable.c */
-
-uns next_table_prime(uns x);
-uns prev_table_prime(uns x);
-
 /* timer.c */
 
 timestamp_t get_timestamp(void);
@@ -213,11 +204,11 @@ void sync_dir(const char *name);
 
 /* sighandler.c */
 
-typedef int (*sh_sighandler_t)(int);   // gets signum, returns nonzero if abort() should be called
+typedef int (*ucw_sighandler_t)(int);  // gets signum, returns nonzero if abort() should be called
 
 void handle_signal(int signum);
 void unhandle_signal(int signum);
-sh_sighandler_t set_signal_handler(int signum, sh_sighandler_t new);
+ucw_sighandler_t set_signal_handler(int signum, ucw_sighandler_t new);
 
 /* bigalloc.c */