stuffy/include/stuffy.h
2022-11-12 01:25:08 -06:00

35 lines
1.0 KiB
C

#ifndef STUFFY_H
#define STUFFY_H
#include <sys/stat.h>
typedef struct HeaderStruct
{
char moduleName[50];
struct stat moduleInfo;
} HeaderStruct;
typedef struct ModuleStruct
{
HeaderStruct moduleHeader;
void* moduleData;
} ModuleStruct;
int ReadSingleModuleFromArchive(int fd, ModuleStruct* module);
int WriteSingleModuleToArchive(int fd, ModuleStruct* module);
int OpenArchive(char* archiveName, int flags);
void PrintModuleHeader(ModuleStruct* module);
void SafetyCheck(int status, char* message);
char* StripFilename(char* filename);
void Stuffy(int argc, char* argv[]);
int StuffyArgument(int argc, char** argv);
void StuffyAction(int argc, char* argv[], int archiveAction);
int IsFileArchived(char* archiveName, char* filename);
void AddToArchive(char* archiveName, char* filename);
void RemoveFromArchive(char* archiveName, char* filename);
void ListArchive(char* archiveName);
int Test_ListArchive(char* archiveName);
void ExtractArchive(int argc, char* argv[]);
int _ExtractArchive(char* archiveName, char* filenameIn);
#endif