Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
#include <stdio.h>
#include <assert.h>
#include <stdarg.h>
#include <unistd.h>
#include <pwd.h>
#include <sys/types.h>
#include <dirent.h>
#include <sys/stat.h>
#include "config.h"
#include "configxml.h"
#include "vsfilesystem.h"
#include "vs_globals.h"
#include "vegastrike.h"
#include "common/common.h"
#include "galaxy_gen.h"
#include "pk3.h"
#include "gnuhash.h"
Go to the source code of this file.
Namespaces | |
VSFileSystem | |
Constant Groups | |
VSFileSystem | |
Macros | |
#define | CASE(a) |
#define | CASE(a) |
#define | CASE(a) |
Functions | |
int | VSFS_DEBUG () |
void | usedSerial (ObjSerial ser, bool used) |
ObjSerial | getUniqueSerial () |
string | GetUnitDir (string filename) |
int | selectdirs (const struct dirent *entry) |
int | selectpk3s (const struct dirent *entry) |
int | selectbigpk3s (const struct dirent *entry) |
void | VSFileSystem::ChangeToProgramDirectory (char *argv0) |
VSError | VSFileSystem::CachedFileLookup (FileLookupCache &cache, const string &file, VSFileType type) |
void | VSFileSystem::DisplayType (VSFileSystem::VSFileType type) |
void | VSFileSystem::DisplayType (VSFileSystem::VSFileType type, std::ostream &ostr) |
int | VSFileSystem::GetReadBytes (char *fmt, va_list ap) |
string | VSFileSystem::HOMESUBDIR (".vegastrike") |
std::string | VSFileSystem::GetHashName (const std::string &name) |
std::string | VSFileSystem::GetHashName (const std::string &name, const Vector &scale, int faction) |
std::string | VSFileSystem::GetSharedMeshHashName (const std::string &name, const Vector &scale, int faction) |
std::string | VSFileSystem::GetSharedTextureHashName (const std::string &name) |
std::string | VSFileSystem::GetSharedSoundHashName (const std::string &name) |
std::string | VSFileSystem::MakeSharedPathReturnHome (const std::string &newpath) |
std::string | VSFileSystem::MakeSharedPath (const std::string &s) |
std::string | VSFileSystem::MakeSharedStarSysPath (const std::string &s) |
std::string | VSFileSystem::GetCorrectStarSysPath (const std::string &name, bool &autogenerated) |
FILE * | VSFileSystem::vs_open (const char *filename, const char *mode) |
size_t | VSFileSystem::vs_read (void *ptr, size_t size, size_t nmemb, FILE *fp) |
size_t | VSFileSystem::vs_write (const void *ptr, size_t size, size_t nmemb, FILE *fp) |
void | VSFileSystem::vs_close (FILE *fp) |
int | VSFileSystem::vs_fprintf (FILE *fp, const char *format,...) |
void | VSFileSystem::vs_dprintf (char level, const char *format,...) |
int | VSFileSystem::vs_fseek (FILE *fp, long offset, int whence) |
long | VSFileSystem::vs_ftell (FILE *fp) |
void | VSFileSystem::vs_rewind (FILE *fp) |
bool | VSFileSystem::vs_feof (FILE *fp) |
long | VSFileSystem::vs_getsize (FILE *fp) |
void | VSFileSystem::InitHomeDirectory () |
void | VSFileSystem::InitDataDirectory () |
void | VSFileSystem::LoadConfig (string subdir) |
void | VSFileSystem::InitMods () |
void | VSFileSystem::InitPaths (string conf, string subdir) |
void | VSFileSystem::CreateDirectoryAbs (const char *filename) |
void | VSFileSystem::CreateDirectoryAbs (const string &filename) |
void | VSFileSystem::CreateDirectoryHome (const char *filename) |
void | VSFileSystem::CreateDirectoryHome (const string &filename) |
void | VSFileSystem::CreateDirectoryData (const char *filename) |
void | VSFileSystem::CreateDirectoryData (const string &filename) |
bool | VSFileSystem::DirectoryExists (const char *filename) |
bool | VSFileSystem::DirectoryExists (const string &filename) |
int | VSFileSystem::FileExists (const string &root, const char *filename, VSFileType type, bool lookinvolume) |
int | VSFileSystem::FileExists (const string &root, const string &filename, VSFileType type, bool lookinvolume) |
int | VSFileSystem::FileExistsData (const char *filename, VSFileType type) |
int | VSFileSystem::FileExistsData (const string &filename, VSFileType type) |
int | VSFileSystem::FileExistsHome (const char *filename, VSFileType type) |
int | VSFileSystem::FileExistsHome (const string &filename, VSFileType type) |
VSError | VSFileSystem::GetError (const char *str) |
VSError | VSFileSystem::LookForFile (const string &file, VSFileType type, VSFileMode mode) |
VSError | VSFileSystem::LookForFile (VSFile &f, VSFileType type, VSFileMode mode) |
static void | VSFileSystem::pathAppend (string &dest, string &suffix) |
std::ostream & | operator<< (std::ostream &ostr, VSFileSystem::VSError err) |
std::ostream & | operator<< (std::ostream &ostr, VSFileSystem::VSFileType type) |
std::string | nameof (VSFileSystem::VSFileType type) |
#define CASE | ( | a) |
Definition at line 1965 of file vsfilesystem.cpp.
#define CASE | ( | a) |
Definition at line 1965 of file vsfilesystem.cpp.
#define CASE | ( | a) |
Definition at line 1965 of file vsfilesystem.cpp.
ObjSerial getUniqueSerial | ( | ) |
Definition at line 61 of file vsfilesystem.cpp.
References fprintf, MAXSERIAL, serial_seed, SERVER, usedSerial(), and usedSerials.
Referenced by Mission::call_unit_launch(), UniverseUtil::ComputeSystemSerials(), Unit::EjectCargo(), and Unit::Fire().
string GetUnitDir | ( | string | filename) |
Definition at line 38 of file accountserver.cpp.
Referenced by Unit::FilterDowngradeList(), VSFileSystem::LookForFile(), makeFinalBlankUpgrade(), makeTemplateUpgrade(), BaseComputer::SellUpgradeOperation::start(), and Unit::Upgrade().
std::string nameof | ( | VSFileSystem::VSFileType | type) |
Definition at line 1999 of file vsfilesystem.cpp.
References VSFileSystem::AccountFile, VSFileSystem::AiFile, VSFileSystem::AnimFile, CASE, VSFileSystem::CockpitFile, VSFileSystem::CommFile, VSFileSystem::MeshFile, VSFileSystem::MissionFile, VSFileSystem::MusicFile, VSFileSystem::PythonFile, VSFileSystem::SaveFile, VSFileSystem::SoundFile, VSFileSystem::SystemFile, VSFileSystem::TextureFile, VSFileSystem::UnitFile, VSFileSystem::UniverseFile, VSFileSystem::UnknownFile, VSFileSystem::VSSpriteFile, and VSFileSystem::ZoneBuffer.
Referenced by VSFileSystem::FileExists().
std::ostream& operator<< | ( | std::ostream & | ostr, |
VSFileSystem::VSError | err | ||
) |
Definition at line 1968 of file vsfilesystem.cpp.
References VSFileSystem::BadFormat, CASE, VSFileSystem::DownloadInterrupted, VSFileSystem::EndOfFile, VSFileSystem::FileNotFound, VSFileSystem::IncompleteRead, VSFileSystem::IncompleteWrite, VSFileSystem::IsDirectory, VSFileSystem::LocalPermissionDenied, VSFileSystem::Ok, VSFileSystem::RemotePermissionDenied, VSFileSystem::Shared, VSFileSystem::SocketError, and VSFileSystem::Unspecified.
std::ostream& operator<< | ( | std::ostream & | ostr, |
VSFileSystem::VSFileType | type | ||
) |
Definition at line 1993 of file vsfilesystem.cpp.
References VSFileSystem::DisplayType().
int selectbigpk3s | ( | const struct dirent * | entry) |
Definition at line 123 of file vsfilesystem.cpp.
int selectdirs | ( | const struct dirent * | entry) |
Definition at line 91 of file vsfilesystem.cpp.
References selectcurrentdir.
Referenced by VSFileSystem::InitMods().
int selectpk3s | ( | const struct dirent * | entry) |
Definition at line 110 of file vsfilesystem.cpp.
Definition at line 57 of file vsfilesystem.cpp.
References usedSerials.
Referenced by getUniqueSerial().
int VSFS_DEBUG | ( | ) |
Definition at line 41 of file vsfilesystem.cpp.
References VegaConfig::getVariable(), XMLSupport::parse_int(), and vs_config.
Referenced by VSFileSystem::VSFile::Close(), VSFileSystem::FileExists(), VSFileSystem::LookForFile(), VSFileSystem::VSFile::OpenReadOnly(), VSFileSystem::VSFile::ReadLine(), and VSFileSystem::vs_open().
char* CONFIGFILE |
Definition at line 49 of file vsfilesystem.cpp.
Referenced by cleanup(), main(), ParseCommandLine(), AccountServer::start(), and NetServer::start().
string curmodpath = "" |
Definition at line 52 of file vsfilesystem.cpp.
Referenced by VSFileSystem::InitMods().
VSVolumeType isin_bigvolumes = VSFSNone |
Definition at line 51 of file vsfilesystem.cpp.
Referenced by VSFileSystem::FileExists(), and VSFileSystem::LookForFile().
char pwd[65536] |
Definition at line 50 of file vsfilesystem.cpp.
Referenced by VSFileSystem::ChangeToProgramDirectory(), F0rkProcess(), GameUniverse::Init(), and main().
string selectcurrentdir |
Definition at line 86 of file vsfilesystem.cpp.
Referenced by VSFileSystem::InitMods(), and selectdirs().
ObjSerial serial_seed = 0 |
Definition at line 54 of file vsfilesystem.cpp.
Referenced by AccountServer::AccountServer(), getUniqueSerial(), and NetServer::NetServer().
Definition at line 55 of file vsfilesystem.cpp.
Referenced by getUniqueSerial(), and usedSerial().