Beispiel #1
0
bool ossimVpfTable::openTable(const ossimFilename& tableName)
{
   closeTable();

   if(is_vpf_table(const_cast<char*>(tableName.c_str())))
   {
      if(theTableInformation)
      {
         delete theTableInformation;
         theTableInformation = NULL;
      }
      theTableInformation = new vpf_table_type;
      memset(theTableInformation, 0, sizeof(vpf_table_type));

      theTableName = tableName;
      *theTableInformation = vpf_open_table(const_cast<char*>(tableName.c_str()),
                                            disk,
                                            "rb",
                                            NULL);
   }
   else
   {
      delete theTableInformation;
      theTableInformation = NULL;

      return false;
   }

   return true;
}
ossimErrorCode ossimVpfDatabaseHeader::open(const ossimFilename& databaseHeaderTable)
{
    vpf_table_type tableTypeData;

    if( is_vpf_table( databaseHeaderTable.c_str() ) )
    {
        tableTypeData = vpf_open_table(databaseHeaderTable.c_str(),
                                       (storage_type)DISK,
                                       "rb",
                                       NULL);
        if(isDatabaseHeaderTable(tableTypeData))
        {

        }
        else
        {
            return ossimErrorCodes::OSSIM_ERROR;
        }
    }
    else
    {
        return ossimErrorCodes::OSSIM_ERROR;
    }

    return ossimErrorCodes::OSSIM_OK;
}
Beispiel #3
0
/**************************************************************************
 *
 *N  display_library_contents
 *
 *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 *
 *   Purpose:
 *P
 *    List the tables in the Library level directory and display their
 *    contents if selected.
 *E
 *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 *
 *   Parameters:
 *A
 *    library   <input> == (library_type) VPF library structure.
 *E
 *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 *
 *   History:
 *H
 *    Barry Michaels  DOS Turbo C
 *E
 *************************************************************************/
void display_library_contents( library_type library )
{
   char *filename, *libpath, *path, *libstr;

   libstr = (char *)vpfmalloc(128);
   libpath = (char *)vpfmalloc(255);
   filename = (char *)vpfmalloc(128);
   path = (char *)vpfmalloc(255);

   strcpy( libstr, "Library: " );
   strcat( libstr, library.name );

   strcpy(libpath,library.path);
   strcat(libpath,"*.*");
   do {
      strcpy(filename,pickfile(libpath,0,libstr));
      if (strcmp(filename,"")==0) break;
      strcpy( path, library.path );
      strcat( path, filename );
      rightjust(path);
      leftjust(path);
      strlwr(path);
      if (is_vpf_table(path)) {
	 strlwr(path);
	 if (strstr(path,".doc"))
	    vpf_dump_doc_table(path,"temp.out");
	 else
	    vpf_dump_table(path,"temp.out");
	 viewfile("temp.out", getmaxy()/3);
	 unlink("temp.out");
      } else {
	 not_a_vpf_table(path);
      }
   } while (strcmp(filename,"") != 0);

   free(path);
   free(filename);
   free(libpath);
   free(libstr);
}
Beispiel #4
0
/**************************************************************************
 *
 *N  display_database_contents
 *
 *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 *
 *   Purpose:
 *P
 *    List the tables in the Database level directory and display their
 *    contents if selected.
 *E
 *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 *
 *   Parameters:
 *A
 *    database <input> == (database_type) VPF database.
 *E
 *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 *
 *   History:
 *H
 *    Barry Michaels  DOS Turbo C
 *E
 *************************************************************************/
void display_database_contents( database_type database )
{
   char *filename, *dbpath, *path, *dbstr;

   dbstr = (char *)vpfmalloc(128);
   dbpath = (char *)vpfmalloc(255);
   filename = (char *)vpfmalloc(128);
   path = (char *)vpfmalloc(255);

   strcpy( dbstr, "Database: " );
   strcat( dbstr, database.name );

   strcpy(dbpath,database.path);
   strcat(dbpath,"*.*");
   do {
      strcpy(filename,pickfile(dbpath,0,dbstr));
      if (strcmp(filename,"")==0) break;
      strcpy( path, database.path );
      strcat( path, filename );
      rightjust(path);
      strlwr(path);
      if (is_vpf_table(path)) {
	 if (strstr(path,".doc"))
	    vpf_dump_doc_table(path,"temp.out");
	 else
	    vpf_dump_table(path,"temp.out");
	 viewfile("temp.out", getmaxy()/3);
	 unlink("temp.out");
      } else {
	 not_a_vpf_table(path);
      }
   } while (strcmp(filename,"") != 0);

   free(path);
   free(filename);
   free(dbpath);
   free(dbstr);
}