Added SILC Thread Queue API
[crypto.git] / apps / irssi / src / core / misc.h
index a321bdfca8187c515e9164e1e9fb8bd4ec3e097f..35a9dfc8a5f316e53e669cee43e8daf3612e0838 100644 (file)
@@ -8,14 +8,6 @@
 typedef void* (*FOREACH_FIND_FUNC) (void *item, void *data);
 typedef int (*COLUMN_LEN_FUNC)(void *data);
 
-static inline int nearest_power(int num)
-{
-       int n = 1;
-
-       while (n < num) n <<= 1;
-       return n;
-}
-
 /* Returns 1 if tv1 > tv2, -1 if tv2 > tv1 or 0 if they're equal. */
 int g_timeval_cmp(const GTimeVal *tv1, const GTimeVal *tv2);
 /* Returns "tv1 - tv2", returns the result in milliseconds. Note that
@@ -29,8 +21,6 @@ int strarray_length(char **array);
 /* return index of `item' in `array' or -1 if not found */
 int strarray_find(char **array, const char *item);
 
-int execute(const char *cmd); /* returns pid or -1 = error */
-
 GSList *gslist_find_string(GSList *list, const char *key);
 GSList *gslist_find_icase_string(GSList *list, const char *key);
 GList *glist_find_string(GList *list, const char *key);
@@ -61,10 +51,6 @@ int regexp_match(const char *str, const char *regexp);
 
 /* Create the directory and all it's parent directories */
 int mkpath(const char *path, int mode);
-
-/* Get home directory */
-const char *get_home_dir(void);
-
 /* convert ~/ to $HOME */
 char *convert_home(const char *path);
 
@@ -89,6 +75,9 @@ char *replace_chars(char *str, char from, char to);
 int octal2dec(int octal);
 int dec2octal(int decimal);
 
+/* string -> uoff_t */
+uoff_t str_to_uofft(const char *str);
+
 /* convert all low-ascii (<32) to ^<A..> combinations */
 char *show_lowascii(const char *channel);
 
@@ -109,4 +98,16 @@ GSList *columns_sort_list(GSList *list, int rows);
    one after '\'. Returns the expanded character or -1 if error. */
 int expand_escape(const char **data);
 
+/* Escape all '"', "'" and '\' chars with '\' */
+char *escape_string(const char *str);
+
+/* Like strlcpy(), but return -1 if buffer was overflown, 0 if not. */
+int strocpy(char *dest, const char *src, size_t dstsize);
+
+int nearest_power(int num);
+
+/* Returns TRUE / FALSE */
+int parse_time_interval(const char *time, int *msecs);
+int parse_size(const char *size, int *bytes);
+
 #endif