Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
2.8 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // SYS_UTILS.H
  4. //
  5. // System Utilities.
  6. //=====================================================================================//
  7. #pragma once
  8. #include "vxconsole.h"
  9. #pragma warning(disable : 4100) // warning C4100: unreferenced formal parameter
  10. #define MAX_SYSPRINTMSG 1024
  11. #define MAX_SYSTOKENCHARS 1024
  12. #define MAKEINT64( hiword, loword ) ( ( __int64 )( ( ( ( __int64 )( hiword ) ) << 32 ) | ( __int64 )( loword ) ) )
  13. extern void Sys_MessageBox( const CHAR *title, const CHAR *format, ... );
  14. extern void Sys_Error( const CHAR *format, ... );
  15. extern void *Sys_Alloc( int size );
  16. extern void Sys_Free( void *ptr );
  17. extern CHAR *Sys_CopyString( const CHAR *str );
  18. extern int Sys_LoadFile( const CHAR *filename, void **bufferptr, bool bText = false );
  19. extern bool Sys_SaveFile( const CHAR *filename, void *buffer, long count, bool bText = false );
  20. extern long Sys_FileLength( const CHAR *filename, bool bText = false );
  21. extern long Sys_FileLength( int handle );
  22. extern BOOL Sys_FileTime( CHAR *filename, FILETIME *time );
  23. extern void Sys_CreatePath( const char* pInPath );
  24. extern void Sys_AddFileSeperator( CHAR *path, int outPathLen );
  25. extern void Sys_NormalizePath( CHAR *path, bool forceToLower );
  26. extern void Sys_StripFilename( const CHAR *path, CHAR *outpath, int outPathLen );
  27. extern void Sys_StripExtension( const CHAR *path, CHAR *outpath, int outPathLen );
  28. extern void Sys_StripPath( const CHAR *path, CHAR *outpath, int outPathLen );
  29. extern void Sys_GetExtension( const CHAR *path, CHAR *outpath, int outPathLen );
  30. extern void Sys_AddExtension( const CHAR *extension, CHAR *outpath, int outPathLen );
  31. extern void Sys_TempFilename( CHAR *outpath, int outPathLen );
  32. extern BOOL Sys_Exists( const CHAR *filename );
  33. extern CHAR *Sys_GetToken( CHAR **dataptr, BOOL crossline, int *numlines );
  34. extern CHAR *Sys_SkipWhitespace( CHAR *data, BOOL *hasNewLines, int *numlines );
  35. extern void Sys_SkipBracedSection( CHAR **dataptr, int *numlines );
  36. extern void Sys_SkipRestOfLine( CHAR **dataptr, int *numlines );
  37. extern void Sys_SetRegistryPrefix( const CHAR *pPrefix );
  38. extern BOOL Sys_SetRegistryString( const CHAR *key, const CHAR *value );
  39. extern BOOL Sys_GetRegistryString( const CHAR *key, CHAR *value, const CHAR *defValue, int valueLen );
  40. extern BOOL Sys_SetRegistryInteger( const CHAR *key, int value );
  41. extern BOOL Sys_GetRegistryInteger( const CHAR *key, int defValue, int &value );
  42. extern DWORD Sys_GetSystemTime( void );
  43. extern COLORREF Sys_ColorScale( COLORREF color, float scale );
  44. extern bool Sys_IsWildcardMatch( const CHAR *wildcardString, const CHAR *stringToCheck, bool caseSensitive );
  45. extern char *Sys_NumberToCommaString( __int64 number, char *buffer, int bufferSize );