comparison main.c @ 545:895ede06ff11

Implement default log file directory.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 12 Nov 2012 11:28:17 +0200
parents e30fa8592a48
children 3d7ff16389cf
comparison
equal deleted inserted replaced
544:e30fa8592a48 545:895ede06ff11
15 #include <shfolder.h> 15 #include <shfolder.h>
16 #define srandom srand 16 #define srandom srand
17 #define random rand 17 #define random rand
18 #else 18 #else
19 #include <sys/wait.h> 19 #include <sys/wait.h>
20 #include <sys/stat.h>
21 #include <sys/types.h>
20 #endif 22 #endif
21 23
22 #ifdef __WIN32 24 #ifdef __WIN32
23 #define SET_CONFIG_FILE "nnchat.txt" 25 #define SET_CONFIG_FILE "nnchat.txt"
26 #define SET_LOG_DIR "NNChat Log Files"
24 #define SET_DIR_SEPARATOR '\\' 27 #define SET_DIR_SEPARATOR '\\'
25 #else 28 #else
26 #define SET_CONFIG_FILE ".nnchat" 29 #define SET_CONFIG_FILE ".nnchat"
30 #define SET_LOG_DIR "nnlogs"
27 #define SET_DIR_SEPARATOR '/' 31 #define SET_DIR_SEPARATOR '/'
28 #endif 32 #endif
29 33
30 #define SET_PROFILE_PREFIX "http://www.newbienudes.com/profile/%s/" 34 #define SET_PROFILE_PREFIX "http://www.newbienudes.com/profile/%s/"
31 #define SET_NICK_SEPARATOR ':' 35 #define SET_NICK_SEPARATOR ':'
1692 1696
1693 setBrowser = getenv("BROWSER"); 1697 setBrowser = getenv("BROWSER");
1694 if (setBrowser == NULL) 1698 if (setBrowser == NULL)
1695 setBrowser = "firefox"; 1699 setBrowser = "firefox";
1696 1700
1701 if (optLogPath == NULL)
1702 {
1703 optLogPath = th_strdup_printf("%s%c%s%c",
1704 setHomeDir, SET_DIR_SEPARATOR, SET_LOG_DIR, SET_DIR_SEPARATOR);
1705 }
1706
1697 // Parse command line arguments 1707 // Parse command line arguments
1698 argsOK = th_args_process(argc, argv, optList, optListN, 1708 argsOK = th_args_process(argc, argv, optList, optListN,
1699 argHandleOpt, argHandleFile, FALSE); 1709 argHandleOpt, argHandleFile, FALSE);
1700 1710
1701 if (optUserNameCmd != NULL) 1711 if (optUserNameCmd != NULL)