version 1.4, 2000/08/21 08:31:19 |
version 1.7, 2000/11/08 06:21:17 |
|
|
* shall be made on your publication or presentation in any form of the |
* shall be made on your publication or presentation in any form of the |
* results obtained by use of the SOFTWARE. |
* results obtained by use of the SOFTWARE. |
* (4) In the event that you modify the SOFTWARE, you shall notify FLL by |
* (4) In the event that you modify the SOFTWARE, you shall notify FLL by |
* e-mail at risa-admin@flab.fujitsu.co.jp of the detailed specification |
* e-mail at risa-admin@sec.flab.fujitsu.co.jp of the detailed specification |
* for such modification or the source code of the modified part of the |
* for such modification or the source code of the modified part of the |
* SOFTWARE. |
* SOFTWARE. |
* |
* |
|
|
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* |
* |
* $OpenXM: OpenXM_contrib2/asir2000/builtin/file.c,v 1.3 2000/03/02 07:16:09 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/builtin/file.c,v 1.6 2000/08/25 08:06:19 noro Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
#include "parse.h" |
#include "parse.h" |
Line 88 struct ftab file_tab[] = { |
|
Line 88 struct ftab file_tab[] = { |
|
{"bsave",Pbsave,2}, |
{"bsave",Pbsave,2}, |
{"bload",Pbload,1}, |
{"bload",Pbload,1}, |
{"get_rootdir",Pget_rootdir,0}, |
{"get_rootdir",Pget_rootdir,0}, |
|
#if defined(VISUAL) && defined(DES_ENC) |
{"bsave_enc",Pbsave_enc,2}, |
{"bsave_enc",Pbsave_enc,2}, |
{"bload_enc",Pbload_enc,1}, |
{"bload_enc",Pbload_enc,1}, |
|
#endif |
{"bload27",Pbload27,1}, |
{"bload27",Pbload27,1}, |
{"bsave_compat",Pbsave_compat,2}, |
{"bsave_compat",Pbsave_compat,2}, |
{"bload_compat",Pbload_compat,1}, |
{"bload_compat",Pbload_compat,1}, |
|
|
ox_file_io = 0; |
ox_file_io = 0; |
} |
} |
|
|
|
static struct oSTRING rootdir; |
|
|
#if defined(VISUAL) |
#if defined(VISUAL) |
void get_rootdir(name,len) |
void get_rootdir(name,len) |
char *name; |
char *name; |
|
|
LONG ret; |
LONG ret; |
HKEY hOpenKey; |
HKEY hOpenKey; |
DWORD Type; |
DWORD Type; |
|
char *slash; |
|
|
|
if ( rootdir.body ) { |
|
strcpy(name,rootdir.body); |
|
return; |
|
} |
name[0] = 0; |
name[0] = 0; |
ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, ECGEN_KEYNAME, 0, |
ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, ECGEN_KEYNAME, 0, |
KEY_QUERY_VALUE, &hOpenKey); |
KEY_QUERY_VALUE, &hOpenKey); |
|
|
if( ret == ERROR_SUCCESS ) { |
if( ret == ERROR_SUCCESS ) { |
RegQueryValueEx(hOpenKey, "Directory", NULL, &Type, name, &len); |
RegQueryValueEx(hOpenKey, "Directory", NULL, &Type, name, &len); |
RegCloseKey(hOpenKey); |
RegCloseKey(hOpenKey); |
|
} else { |
|
GetCurrentDirectory(len,name); |
|
slash = strrchr(name,'\\'); |
|
if ( slash ) |
|
*slash = 0; |
} |
} |
} |
} |
|
|
|
void set_rootdir(name) |
|
char *name; |
|
{ |
|
static char DirName[BUFSIZ]; |
|
|
|
strcpy(DirName,name); |
|
rootdir.id = O_STR; |
|
rootdir.body = DirName; |
|
asir_libdir = DirName; |
|
/* XXX */ |
|
env_init(); |
|
} |
|
|
#else |
#else |
void get_rootdir(name,len) |
void get_rootdir(name,len) |
char *name; |
char *name; |
|
|
{ |
{ |
strcpy(name,asir_libdir); |
strcpy(name,asir_libdir); |
} |
} |
|
|
|
void set_rootdir(name) |
|
char *name; |
|
{ |
|
static char DirName[BUFSIZ]; |
|
|
|
strcpy(DirName,name); |
|
asir_libdir = DirName; |
|
/* XXX */ |
|
env_init(); |
|
} |
|
|
#endif |
#endif |
|
|
void Pget_rootdir(rp) |
void Pget_rootdir(rp) |
STRING *rp; |
STRING *rp; |
{ |
{ |
static struct oSTRING rootdir; |
|
static char DirName[BUFSIZ]; |
static char DirName[BUFSIZ]; |
int DirNameLen; |
int DirNameLen; |
|
|
|
|
*rp = &rootdir; |
*rp = &rootdir; |
} |
} |
|
|
|
#if defined(VISUAL) && defined(DES_ENC) |
void Pbsave_enc(arg,rp) |
void Pbsave_enc(arg,rp) |
NODE arg; |
NODE arg; |
Obj *rp; |
Obj *rp; |
|
|
Pbload(arg,rp); |
Pbload(arg,rp); |
des_encryption = 0; |
des_encryption = 0; |
} |
} |
|
#endif |
|
|
void Pbload27(arg,rp) |
void Pbload27(arg,rp) |
NODE arg; |
NODE arg; |