Added fdb insert code
This commit is contained in:
@@ -304,9 +304,14 @@ int UnpackFile(char *File)
|
||||
*/
|
||||
int AddFile(struct FILE_record f_db, int Area, char *DestPath, char *FromPath, char *LinkPath)
|
||||
{
|
||||
char *temp1, *temp2;
|
||||
int rc;
|
||||
#ifdef USE_EXPERIMENT
|
||||
struct _fdbarea *fdb_area = NULL;
|
||||
#else
|
||||
int i, Insert, Done = FALSE, Found = FALSE;
|
||||
FILE *fp1, *fp2;
|
||||
int i, rc, Insert, Done = FALSE, Found = FALSE;
|
||||
char *temp1, *temp2;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Copy file to the final destination and make a hard link with the
|
||||
@@ -338,6 +343,17 @@ int AddFile(struct FILE_record f_db, int Area, char *DestPath, char *FromPath, c
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef USE_EXPERIMENT
|
||||
if ((fdb_area = mbsedb_OpenFDB(Area, 30))) {
|
||||
Syslog('f', "opened");
|
||||
rc = mbsedb_InsertFDB(fdb_area, f_db, TRUE);
|
||||
mbsedb_CloseFDB(fdb_area);
|
||||
return rc;
|
||||
} else {
|
||||
Syslog('f', "not opened");
|
||||
return FALSE;
|
||||
}
|
||||
#else
|
||||
temp1 = calloc(PATH_MAX, sizeof(char));
|
||||
temp2 = calloc(PATH_MAX, sizeof(char));
|
||||
sprintf(temp1, "%s/fdb/file%d.data", getenv("MBSE_ROOT"), Area);
|
||||
@@ -432,6 +448,7 @@ int AddFile(struct FILE_record f_db, int Area, char *DestPath, char *FromPath, c
|
||||
free(temp1);
|
||||
free(temp2);
|
||||
return TRUE;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user