Lines 1013-1018
Link Here
|
1013 |
} |
1013 |
} |
1014 |
|
1014 |
|
1015 |
#ifdef WNN_CHECK_INODE |
1015 |
#ifdef WNN_CHECK_INODE |
|
|
1016 |
|
1017 |
static |
1018 |
int |
1019 |
check_inode(f, fh) |
1020 |
FILE *f; |
1021 |
struct wnn_file_head *fh; |
1022 |
{ |
1023 |
struct stat buf; |
1024 |
if(fstat(fileno(f), &buf) == -1){ |
1025 |
return(-1); |
1026 |
} |
1027 |
if((int)buf.st_ino != fh->file_uniq.inode){ |
1028 |
return(-1); |
1029 |
} |
1030 |
return(0); |
1031 |
} |
1032 |
|
1033 |
/*:::DOC_START |
1034 |
* |
1035 |
* Function Name: dic_check_inode |
1036 |
* Description : check i-node of file |
1037 |
* Parameter : |
1038 |
* f: (In) file pointer for dictionary file |
1039 |
* fh: (In) file header |
1040 |
* |
1041 |
* Return value : check result, 0: same, -1: different |
1042 |
* |
1043 |
* Revision history: |
1044 |
* 22-Sep-94: initial |
1045 |
* |
1046 |
*:::DOC_END |
1047 |
*/ |
1048 |
#ifdef JS |
1049 |
static |
1050 |
#endif |
1051 |
int |
1052 |
dic_check_inode(f, fh) |
1053 |
FILE *f; |
1054 |
struct wnn_file_head *fh; |
1055 |
{ |
1056 |
return(check_inode(f, fh)); |
1057 |
} /* End of dic_check_inode */ |
1058 |
|
1059 |
#ifdef WNN_CHECK_INODE |
1016 |
static |
1060 |
static |
1017 |
#else |
1061 |
#else |
1018 |
#ifdef JS |
1062 |
#ifdef JS |
Lines 1050-1108
Link Here
|
1050 |
strncpy(fh.file_uniq_org.createhost, file_uniq->createhost, WNN_HOSTLEN - 1); |
1094 |
strncpy(fh.file_uniq_org.createhost, file_uniq->createhost, WNN_HOSTLEN - 1); |
1051 |
|
1095 |
|
1052 |
fh.file_type = file_type; |
1096 |
fh.file_type = file_type; |
1053 |
if(file_passwd){ |
1097 |
if(file_passwd) { |
1054 |
strncpy(fh.file_passwd, file_passwd, WNN_PASSWD_LEN); |
1098 |
strncpy(fh.file_passwd, file_passwd, WNN_PASSWD_LEN); |
1055 |
} else{ |
1099 |
} else { |
1056 |
memset(fh.file_passwd, 0, WNN_PASSWD_LEN); |
1100 |
memset(fh.file_passwd, 0, WNN_PASSWD_LEN); |
1057 |
} |
1101 |
} |
1058 |
if(output_file_header(ofpter, &fh) == -1) return(-1); |
1102 |
if(output_file_header(ofpter, &fh) == -1) return(-1); |
1059 |
return(0); |
1103 |
return(0); |
1060 |
} |
1104 |
} |
1061 |
|
1105 |
|
1062 |
#ifdef WNN_CHECK_INODE |
|
|
1063 |
|
1064 |
static |
1065 |
int |
1066 |
check_inode(f, fh) |
1067 |
FILE *f; |
1068 |
struct wnn_file_head *fh; |
1069 |
{ |
1070 |
struct stat buf; |
1071 |
if(fstat(fileno(f), &buf) == -1){ |
1072 |
return(-1); |
1073 |
} |
1074 |
if((int)buf.st_ino != fh->file_uniq.inode){ |
1075 |
return(-1); |
1076 |
} |
1077 |
return(0); |
1078 |
} |
1079 |
|
1080 |
/*:::DOC_START |
1081 |
* |
1082 |
* Function Name: dic_check_inode |
1083 |
* Description : check i-node of file |
1084 |
* Parameter : |
1085 |
* f: (In) file pointer for dictionary file |
1086 |
* fh: (In) file header |
1087 |
* |
1088 |
* Return value : check result, 0: same, -1: different |
1089 |
* |
1090 |
* Revision history: |
1091 |
* 22-Sep-94: initial |
1092 |
* |
1093 |
*:::DOC_END |
1094 |
*/ |
1095 |
#ifdef JS |
1096 |
static |
1097 |
#endif |
1098 |
int |
1099 |
dic_check_inode(f, fh) |
1100 |
FILE *f; |
1101 |
struct wnn_file_head *fh; |
1102 |
{ |
1103 |
return(check_inode(f, fh)); |
1104 |
} /* End of dic_check_inode */ |
1105 |
|
1106 |
#ifdef JS |
1106 |
#ifdef JS |
1107 |
static |
1107 |
static |
1108 |
#endif |
1108 |
#endif |