Container.cpp & .h delete (#242)

* Remove GetFilesInDirectory()
* Remove BuildFileDirectory
* Remove container.cpp & .h

Not used in the code
This commit is contained in:
Asdow
2023-10-20 21:30:39 +03:00
committed by GitHub
parent a47ed9ed55
commit 8f454e2aab
17 changed files with 1 additions and 2423 deletions
-1
View File
@@ -11,7 +11,6 @@
#include "Animation Cache.h"
#include "Animation Data.h"
#include "Animation Control.h"
#include "container.h"
#include <math.h>
#include "pathai.h"
#include "Random.h"
-1
View File
@@ -2,7 +2,6 @@ set(SGPSrc
"${CMAKE_CURRENT_SOURCE_DIR}/Button Sound Control.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Button System.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Compression.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Container.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Cursor Control.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/DEBUG.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/debug_util.cpp"
File diff suppressed because it is too large Load Diff
-132
View File
@@ -1,132 +0,0 @@
//***********************************************
//
// Filename : Container.h
//
// Purpose : prototypes for the container file
//
// Modification History : 25 Nov 96 Creation
//
//***********************************************
#ifndef _CONTAINER_H
#define _CONTAINER_H
//***********************************************
//
// Includes
//
//
//***********************************************
#include "types.h"
//***********************************************
//
// Defines and typedefs
//
//***********************************************
#define ORDLIST_ERROR -1
#define ORDLIST_EQUAL 0
#define ORDLIST_LEFT_LESS 1
#define ORDLIST_RIGHT_LESS 2
typedef void * HCONTAINER;
typedef HCONTAINER HSTACK;
typedef HCONTAINER HQUEUE;
typedef HCONTAINER HLIST;
typedef HCONTAINER HORDLIST;
//***********************************************
//
// Function Prototypes
//
//***********************************************
#ifdef __cplusplus
extern "C" {
#endif
// call these functions to initialize and shutdown the debug messages for
// containers
extern void InitializeContainers(void);
extern void ShutdownContainers(void);
// Stack Functions
// CreateStack(estimated number of items in stack, size of each item
// Push(handle to container returned from CreateStack, data to be passed in (must be void *)
// : returns handle to new stack
// Pop(handle to container returned from CreateStack, data to be passed in (must be void *)
// : returns BOOLEAN
// DeleteStack deletes the stack container
// StackSize returns size of stack
extern HSTACK CreateStack(UINT32 num_of_elem , UINT32 siz_of_each);
extern HSTACK Push(HSTACK hStack, void *data);
extern BOOLEAN Pop(HSTACK hStack, void *data);
extern UINT32 StackSize(HSTACK hStack);
extern BOOLEAN DeleteStack(HSTACK hStack);
extern BOOLEAN PeekStack(HSTACK hStack, void *data);
// Queue Functions
// CreateQueue(estimated number of items in queue, size of each item
// AddtoQueue(handle to container returned from CreateQueue, data to be passed in (must be void *))
// : returns handle to queue
// RemfromQueue(handle to container returned from CreateQueue, variable where data is stored (must be void *))
// : returns BOOLEAN
// PeekQueue(handle to the queue, variable where peeked data is stored). Item is not deleted.
// : returns BOOLEAN
// QueueSize(handle to the queue) returns the queue size
// DeleteQueue(handle to container) Delete the queue container
// : returns BOOLEAN
extern HQUEUE CreateQueue(UINT32 num_of_elem, UINT32 siz_of_each);
extern HQUEUE AddtoQueue(HQUEUE hQueue, void *data);
extern BOOLEAN RemfromQueue(HQUEUE hQueue,void *data);
extern BOOLEAN PeekQueue(HQUEUE hQueue, void *data);
extern UINT32 QueueSize(HQUEUE hQueue);
extern BOOLEAN DeleteQueue(HQUEUE hQueue);
// List Functions
// CreateList(estimated number of items in queue, size of each item
// AddtoList(handle to container returned from CreateQueue, data to be passed in (must be void *)
// position where data is to be added (0...sizeof(list))
// : returns handle to new list
// RemfromList(handle to container returned from CreateList, variable where data is stored (must be void *)
// position where data is to be deleted (0...sizeof(list)-1)
// PeekList(handle to the list, variable where peeked data is stored). Item is not deleted.
// position where data is to be peeked (0...sizeof(list)-1)
// ListSize(handle to the list) returns the list size
// DeleteList(handle to the list) Delete the list container
extern HLIST CreateList(UINT32 num_of_elem, UINT32 siz_of_each);
extern HLIST AddtoList(HLIST hList, void *data, UINT32 position);
extern BOOLEAN RemfromList(HLIST hList,void *data, UINT32 position);
extern BOOLEAN PeekList(HLIST hList, void *data, UINT32 position);
extern UINT32 ListSize(HLIST hList);
extern BOOLEAN DeleteList(HLIST hList);
extern BOOLEAN SwapListNode(HLIST hList, void *pdata, UINT32 uiPos);
extern BOOLEAN StoreListNode(HLIST hList, void *pdata, UINT32 uiPos);
// Ordered List Functions
// CreateOrdList(estimated number of items in ordered list, size of each item,
// pointer to a compare function that returns info on whether the data in the ordered stack
// is < or > the new data to be added into the ordered list.
// AddtoOrdList(handle to container returned from CreateOrdList, data to be passed in (must be void *)
// RemfromOrdList(handle to container returned from CreateList, variable where data is stored (must be void *)
// position where data is to be deleted (0...sizeof(list)-1)
// PeekOrdList(handle to the list, variable where peeked data is stored). Item is not deleted.
// position where data is to be peeked (0...sizeof(list)-1)
// OrdListSize(handle to the list) returns the ordered list size
// DeleteOrdList(handle to the list) Delete the ordered list container
extern HLIST CreateOrdList(UINT32 num_of_elem, UINT32 siz_of_each, INT8 (*compare)(void *,void *, UINT32));
extern HLIST AddtoOrdList(HLIST hList, void *data);
extern BOOLEAN RemfromOrdList(HLIST hList,void *data, UINT32 position);
extern BOOLEAN PeekOrdList(HLIST hList, void *data, UINT32 position);
extern UINT32 OrdListSize(HLIST hList);
extern BOOLEAN DeleteOrdList(HLIST hList);
#ifdef __cplusplus
}
#endif
#endif
-166
View File
@@ -36,7 +36,6 @@
#include "MemMan.h"
#include "Debug.h"
#include "RegInst.h"
#include "Container.h"
#include "LibraryDataBase.h"
#include "io.h"
#include "sgp_logger.h"
@@ -149,8 +148,6 @@ void W32toSGPFileFind( GETFILESTRUCT *pGFStruct, WIN32_FIND_DATA *pW32Struct );
HANDLE GetHandleToRealFile( HWFILE hFile, BOOLEAN *pfDatabaseFile );
HWFILE CreateFileHandle( HANDLE hRealFile, BOOLEAN fDatabaseFile );
void DestroyFileHandle( HWFILE hFile );
void BuildFileDirectory( void );
INT32 GetFilesInDirectory( HCONTAINER hStack, CHAR *, HANDLE hFile, WIN32_FIND_DATA *pFind );
//**************************************************************************
//
@@ -950,169 +947,6 @@ void DestroyFileHandle( HWFILE hFile )
*/
//**************************************************************************
//
// BuildFileDirectory
//
//
//
// Parameter List :
// Return Value :
// Modification history :
//
// ??nov96:HJH ->creation
//
//**************************************************************************
void BuildFileDirectory( void )
{
return; // temporary until container stuff is fixed
/*
INT32 i, iNumFiles = 0;
HANDLE hFile, hFileIn;
WIN32_FIND_DATA find, inFind;
BOOLEAN fMore = TRUE;
CHAR cName[FILENAME_LENGTH], cDir[FILENAME_LENGTH], cSubDir[FILENAME_LENGTH];
HCONTAINER hStack;
//
// First, push all the file names in the directory (and subdirectories)
// onto the stack.
//
GetProfileChar( "Startup", "InstPath", "", cDir );
if ( strlen( cDir ) == 0 )
return;
hStack = CreateStack( 100, FILENAME_LENGTH );
if (hStack == NULL)
{
FastDebugMsg(String("BuildFileDirectory: CreateStack Failed for the filename stack"));
return;
}
find.dwFileAttributes = FILE_ATTRIBUTE_NORMAL | FILE_ATTRIBUTE_DIRECTORY;
strcpy( &(cDir[strlen(cDir)]), "\\*.*\0" );
hFile = FindFirstFile( cDir, &find );
while ( fMore )
{
if ( find.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY )
{
if ( strcmp( find.cFileName, "." ) != 0 && strcmp( find.cFileName, ".." ) != 0 )
{
// a valid directory
inFind.dwFileAttributes = FILE_ATTRIBUTE_NORMAL | FILE_ATTRIBUTE_DIRECTORY;
strcpy( cSubDir, cDir );
strcpy( &(cSubDir[strlen(cDir)-3]), find.cFileName );
strcpy( &(cSubDir[strlen(cSubDir)]), "\\*.*\0" );
hFileIn = FindFirstFile( cSubDir, &inFind );
iNumFiles += GetFilesInDirectory( hStack, cSubDir, hFileIn, &inFind );
FindClose( hFileIn );
}
}
else
{
iNumFiles++;
strcpy( cName, cDir );
strcpy( &(cName[strlen(cName)-3]), find.cFileName );
CharLower( cName );
hStack = Push( hStack, cName );
}
find.dwFileAttributes = FILE_ATTRIBUTE_NORMAL | FILE_ATTRIBUTE_DIRECTORY;
fMore = FindNextFile( hFile, &find );
}
FindClose( hFile );
//
// Okay, we have all the files in the stack, now put them in place.
//
gfs.uiNumFilesInDirectory = iNumFiles;
gfs.pcFileNames = (STR8)MemAlloc( iNumFiles * FILENAME_LENGTH );
if ( gfs.pcFileNames )
{
for ( i=0 ; i<iNumFiles ; i++ )
{
Pop( hStack, (void *)(&gfs.pcFileNames[i*FILENAME_LENGTH]) );
}
}
//
// Clean up.
//
DeleteStack( hStack );
*/
}
//**************************************************************************
//
// GetFilesInDirectory
//
// Gets the files in a directory and the subdirectories.
//
// Parameter List :
// Return Value :
// Modification history :
//
// ??nov96:HJH ->creation
//
//**************************************************************************
INT32 GetFilesInDirectory( HCONTAINER hStack, CHAR *pcDir, HANDLE hFile, WIN32_FIND_DATA *pFind )
{
INT32 iNumFiles;
WIN32_FIND_DATA inFind;
BOOLEAN fMore;
CHAR cName[FILENAME_LENGTH], cDir[FILENAME_LENGTH];
HANDLE hFileIn;
fMore = TRUE;
iNumFiles = 0;
while ( fMore )
{
if ( pFind->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY )
{
if ( strcmp( pFind->cFileName, "." ) != 0 && strcmp( pFind->cFileName, ".." ) != 0 )
{
// a valid directory - recurse and find the files in that directory
inFind.dwFileAttributes = FILE_ATTRIBUTE_NORMAL | FILE_ATTRIBUTE_DIRECTORY;
strcpy( cDir, pcDir );
strcpy( &(cDir[strlen(cDir)-3]), pFind->cFileName );
strcpy( &(cDir[strlen(cDir)]), "\\*.*\0" );
hFileIn = FindFirstFile( cDir, &inFind );
iNumFiles += GetFilesInDirectory( hStack, cDir, hFileIn, &inFind );
FindClose( hFileIn );
}
}
else
{
iNumFiles++;
strcpy( cName, pcDir );
strcpy( &(cName[strlen(cName)-3]), pFind->cFileName );
CharLower( cName );
hStack = Push( hStack, cName );
}
pFind->dwFileAttributes = FILE_ATTRIBUTE_NORMAL | FILE_ATTRIBUTE_DIRECTORY;
fMore = FindNextFile( hFile, pFind );
}
return(iNumFiles);
}
BOOLEAN SetFileManCurrentDirectory( STR pcDirectory )
{
try
-4
View File
@@ -25,7 +25,6 @@
#include "FileCat.h"
#include "Container.h"
//**************************************************************************
//
@@ -163,9 +162,6 @@ BOOLEAN FileCheckEndOfFile( HWFILE hFile );
BOOLEAN GetFileManFileTime( HWFILE hFile, SGP_FILETIME *pCreationTime, SGP_FILETIME *pLastAccessedTime, SGP_FILETIME *pLastWriteTime );
INT32 GetFilesInDirectory( HCONTAINER hStack, CHAR *pcDir, HANDLE hFile, WIN32_FIND_DATA *pFind );
// CompareSGPFileTimes() returns...
// -1 if the First file time is less than second file time. ( first file is older )
-4
View File
@@ -453,9 +453,6 @@ BOOLEAN InitializeStandardGamingPlatform(HINSTANCE hInstance, int sCommandShow)
return FALSE;
}
FastDebugMsg("Initializing Containers Manager");
InitializeContainers();
FastDebugMsg("Initializing Input Manager");
// Initialize the Input Manager
if (InitializeInputManager() == FALSE)
@@ -656,7 +653,6 @@ void ShutdownStandardGamingPlatform(void)
ShutdownVideoManager();
ShutdownInputManager();
ShutdownContainers();
ShutdownFileManager();
#ifdef EXTREME_MEMORY_DEBUGGING
-1
View File
@@ -2,7 +2,6 @@
#define __VOBJECT_H
#include "types.h"
#include "container.h"
#include "himage.h"
// ************************************************************************************
-1
View File
@@ -2,7 +2,6 @@
#define __VSURFACE_H
#include "types.h"
#include "container.h"
#include "himage.h"
#include "vobject.h"
#include <vector>
-1
View File
@@ -8,7 +8,6 @@
#include "vsurface.h"
#include "Render Dirty.h"
#include "sysutil.h"
#include "container.h"
#include "wcheck.h"
#include "video.h"
#include "vobject_blitters.h"
-1
View File
@@ -18,7 +18,6 @@
#include "Animation Cache.h"
#include "Animation Data.h"
#include "Animation Control.h"
#include "container.h"
#include "interface.h"
#include <math.h>
-1
View File
@@ -12,7 +12,6 @@
#include "Animation Cache.h"
#include "Animation Data.h"
#include "Animation Control.h"
#include "container.h"
#define _USE_MATH_DEFINES // for C
#include <math.h>
#include "pathai.h"
-1
View File
@@ -10,7 +10,6 @@
#include "Animation Cache.h"
#include "Animation Data.h"
#include "Animation Control.h"
#include "container.h"
#include "pathai.h"
#include "Random.h"
#include "worldman.h"
-1
View File
@@ -7,7 +7,6 @@
#include "renderworld.h"
#include "vsurface.h"
#include "sysutil.h"
#include "container.h"
#include "wcheck.h"
#include "video.h"
#include "vobject_blitters.h"
-1
View File
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <time.h>
#include "sgp.h"
#include "container.h"
#include "wcheck.h"
#include "Event Pump.h"
#include "Timer.h"
+1 -2
View File
@@ -30,7 +30,6 @@
#include <stdio.h>
#include <stdarg.h>
#include <time.h>
#include "container.h"
#include "wcheck.h"
#include "Event Manager.h"
#include "Event Pump.h"
@@ -108,4 +107,4 @@
//#include <windowsx.h>
//#include <mmsystem.h>
//#include <dsound.h>
#endif
#endif
-1
View File
@@ -11,7 +11,6 @@
#include "input.h"
#include "font.h"
#include "screenids.h"
#include "container.h"
#include "overhead.h"
#include "sysutil.h"
#include "Font Control.h"