]> mj.ucw.cz Git - libucw.git/blobdiff - lib/lib.h
Implemented base-224 encoder and decoder.
[libucw.git] / lib / lib.h
index 05bde59ef85f7107fdd2d02f18a31068b6ba341f..dea7c10c8929fa7fe923d24f69bbb78d12204e0a 100644 (file)
--- a/lib/lib.h
+++ b/lib/lib.h
 #define MIN(a,b) (((a)<(b))?(a):(b))
 #define MAX(a,b) (((a)>(b))?(a):(b))
 #define CLAMP(x,min,max) ({ int _t=x; (_t < min) ? min : (_t > max) ? max : _t; })
+#define ABS(x) ((x) < 0 ? -(x) : (x))
 #define ARRAY_SIZE(a) (sizeof(a)/sizeof(*(a)))
 
-/* Temporary Files */
-
-#define TMP_DIR "tmp"
-#define TMP_DIR_LEN 3
-
-struct tempfile {
-  int fh;
-  byte name[32];
-};
-
-void open_temp(struct tempfile *, byte *);
-void delete_temp(struct tempfile *);
-u32 temprand(uns);
-
 /* Logging */
 
 #define L_DEBUG                'D'             /* Debugging messages */
@@ -170,7 +157,7 @@ uns get_timer(void);
 
 typedef struct regex regex;
 
-regex *rx_compile(byte *r);
+regex *rx_compile(byte *r, int icase);
 void rx_free(regex *r);
 int rx_match(regex *r, byte *s);
 int rx_subst(regex *r, byte *by, byte *src, byte *dest, uns destlen);
@@ -189,4 +176,8 @@ void munmap_file(void *start, unsigned len);
 void setproctitle_init(int argc, char **argv);
 void setproctitle(char *msg, ...) __attribute__((format(printf,1,2)));
 
+/* randomkey.c */
+
+void randomkey(byte *buf, uns size);
+
 #endif