/* IRCfs - IRC FileServ for *nix. * Copyright (C) 2002 Nick 'Zaf' Clifford * For licensing details, refer to the LICENSE file in the source * code directory. */ #ifndef __include_misc_h__ #define __include_misc_h__ #include "pool.h" char *clean_filename(char *filename); /* "Safes" a path, removes all misc /'s that aren't needed, and * removes any /../ reference. eg /home/./zaf/.././user becomes * /home/zaf/user */ char *clean_path(char *path); /* Removes the path from a string */ char *remove_path(char *path); /* Tidys a path, removes all the misc /'s that aren't needed, tracends * the /../'s correctly. (eg /home/./zaf/.././user becomes /home/user) */ char *tidy_path(char *path); char *skip_to_whitespace(char *cp); char *skip_whitespace(char *cp); const char *const_skip_to_whitespace(const char *cp); const char *const_skip_whitespace(const char *cp); char *trim(char *str); char *trim_comments(char *str); const char *nice_size(size_t size); int my_write(int fd, const void *buffer, size_t size); extern int write_delay_ohno; char **strarray_create(POOL p, const char *str, char ch); int strarray_join(char *buffer,size_t size, char **a, char ch); char *strarray_random(char **a); int strcasecmp_portion(const char *str_a, const char *str_b, int b_stop_ch, char **b_stop_pos); char *pstrdup_portion(POOL p, const char *str, int stop_ch, char **stop_pos); #endif