|
|
| version 1.28, 2008/03/13 16:27:39 | version 1.29, 2008/03/18 15:33:14 |
|---|---|
| Line 1 | Line 1 |
| /* $Id$ */ | |
| /* | /* |
| * Copyright (c) 2003 NONAKA Kimihiro | * Copyright (c) 2003 NONAKA Kimihiro |
| * All rights reserved. | * All rights reserved. |
| Line 136 main(int argc, char *argv[]) | Line 138 main(int argc, char *argv[]) |
| exit(1); | exit(1); |
| } | } |
| milstr_ncpy(modulefile, optarg, sizeof(modulefile)); | milstr_ncpy(modulefile, optarg, sizeof(modulefile)); |
| /* resume/statsave dir */ | |
| file_cpyname(statpath, modulefile, sizeof(statpath)); | |
| file_cutname(statpath); | |
| break; | break; |
| case 'C': | case 'C': |
| Line 151 main(int argc, char *argv[]) | Line 149 main(int argc, char *argv[]) |
| sizeof(timidity_cfgfile_path)); | sizeof(timidity_cfgfile_path)); |
| break; | break; |
| case 't': | |
| if (stat(optarg, &sb) < 0 || !S_ISREG(sb.st_mode)) { | |
| fprintf(stderr, "Can't access %s.\n", optarg); | |
| exit(1); | |
| } | |
| milstr_ncpy(fontfilename, optarg, sizeof(fontfilename)); | |
| break; | |
| case 'v': | case 'v': |
| verbose = 1; | verbose = 1; |
| break; | break; |
| Line 178 main(int argc, char *argv[]) | Line 168 main(int argc, char *argv[]) |
| if (env) { | if (env) { |
| /* base dir */ | /* base dir */ |
| snprintf(modulefile, sizeof(modulefile), | snprintf(modulefile, sizeof(modulefile), |
| "%s/.np2", env); | "%s/.%s", env, np2appname); |
| if (stat(modulefile, &sb) < 0) { | if (stat(modulefile, &sb) < 0) { |
| if (mkdir(modulefile, 0700) < 0) { | if (mkdir(modulefile, 0700) < 0) { |
| perror(modulefile); | perror(modulefile); |
| Line 190 main(int argc, char *argv[]) | Line 180 main(int argc, char *argv[]) |
| exit(1); | exit(1); |
| } | } |
| /* font file */ | |
| snprintf(np2cfg.fontfile, sizeof(np2cfg.fontfile), | |
| "%s/font.bmp", modulefile); | |
| /* resume/statsave dir */ | |
| file_cpyname(statpath, modulefile, sizeof(statpath)); | |
| file_catname(statpath, "/sav/", sizeof(statpath)); | |
| if (stat(statpath, &sb) < 0) { | |
| if (mkdir(statpath, 0700) < 0) { | |
| perror(statpath); | |
| exit(1); | |
| } | |
| } else if (!S_ISDIR(sb.st_mode)) { | |
| fprintf(stderr, "%s isn't directory.\n", | |
| statpath); | |
| exit(1); | |
| } | |
| /* config file */ | /* config file */ |
| milstr_ncat(modulefile, "/np2rc", sizeof(modulefile)); | milstr_ncat(modulefile, "/np2rc", sizeof(modulefile)); |
| if ((stat(modulefile, &sb) >= 0) | if ((stat(modulefile, &sb) >= 0) |
| Line 217 main(int argc, char *argv[]) | Line 189 main(int argc, char *argv[]) |
| } | } |
| } | } |
| } | } |
| if (modulefile[0] != '\0') { | |
| /* font file */ | |
| snprintf(np2cfg.fontfile, sizeof(np2cfg.fontfile), | |
| "%s/font.bmp", modulefile); | |
| /* resume/statsave dir */ | |
| file_cpyname(statpath, modulefile, sizeof(statpath)); | |
| file_cutname(statpath); | |
| file_catname(statpath, "/sav/", sizeof(statpath)); | |
| if (stat(statpath, &sb) < 0) { | |
| if (mkdir(statpath, 0700) < 0) { | |
| perror(statpath); | |
| exit(1); | |
| } | |
| } else if (!S_ISDIR(sb.st_mode)) { | |
| fprintf(stderr, "%s isn't directory.\n", | |
| statpath); | |
| exit(1); | |
| } | |
| file_catname(statpath, np2appname, sizeof(statpath)); | |
| } | |
| if (timidity_cfgfile_path[0] == '\0') { | if (timidity_cfgfile_path[0] == '\0') { |
| file_cpyname(timidity_cfgfile_path, modulefile, | file_cpyname(timidity_cfgfile_path, modulefile, |
| sizeof(timidity_cfgfile_path)); | sizeof(timidity_cfgfile_path)); |
| Line 352 scrnmng_failure: | Line 345 scrnmng_failure: |
| fontmng_terminate(); | fontmng_terminate(); |
| fontmng_failure: | fontmng_failure: |
| if (sys_updates & (SYS_UPDATECFG|SYS_UPDATEOSCFG)) { | if (!np2oscfg.cfgreadonly |
| && (sys_updates & (SYS_UPDATECFG|SYS_UPDATEOSCFG))) { | |
| initsave(); | initsave(); |
| toolwin_writeini(); | toolwin_writeini(); |
| kdispwin_writeini(); | kdispwin_writeini(); |