1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Moved create_config_dir function to profanity.c

This commit is contained in:
James Booth 2012-08-26 18:01:44 +01:00
parent fe519410b1
commit 6f2870ed7d
3 changed files with 12 additions and 11 deletions

View File

@ -36,15 +36,6 @@ p_slist_free_full(GSList *items, GDestroyNotify free_func)
g_slist_free (items); g_slist_free (items);
} }
void
create_config_directory()
{
GString *dir = g_string_new(getenv("HOME"));
g_string_append(dir, "/.profanity");
create_dir(dir->str);
g_string_free(dir, TRUE);
}
void void
create_dir(char *name) create_dir(char *name)
{ {

View File

@ -36,7 +36,6 @@
#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
void p_slist_free_full(GSList *items, GDestroyNotify free_func); void p_slist_free_full(GSList *items, GDestroyNotify free_func);
void create_config_directory(void);
void create_dir(char *name); void create_dir(char *name);
void get_time(char *thetime); void get_time(char *thetime);
char * str_replace(const char *string, const char *substr, char * str_replace(const char *string, const char *substr,

View File

@ -37,6 +37,7 @@
static log_level_t _get_log_level(char *log_level); static log_level_t _get_log_level(char *log_level);
gboolean _process_input(char *inp); gboolean _process_input(char *inp);
static void _profanity_shutdown(void); static void _profanity_shutdown(void);
static void _create_config_directory();
void void
profanity_run(void) profanity_run(void)
@ -73,7 +74,7 @@ profanity_run(void)
void void
profanity_init(const int disable_tls, char *log_level) profanity_init(const int disable_tls, char *log_level)
{ {
create_config_directory(); _create_config_directory();
log_level_t prof_log_level = _get_log_level(log_level); log_level_t prof_log_level = _get_log_level(log_level);
log_init(prof_log_level); log_init(prof_log_level);
log_info("Starting Profanity (%s)...", PACKAGE_VERSION); log_info("Starting Profanity (%s)...", PACKAGE_VERSION);
@ -151,3 +152,13 @@ _process_input(char *inp)
return result; return result;
} }
static void
_create_config_directory()
{
GString *dir = g_string_new(getenv("HOME"));
g_string_append(dir, "/.profanity");
create_dir(dir->str);
g_string_free(dir, TRUE);
}