/* * Copyright 1995, 1997 Perforce Software. All rights reserved. * * This file is part of Perforce - the FAST SCM System. */ /* * enviro.h - get/set environment variables/registry entries * * Note that there is no longer a global environment. If * multiple threads wish to share the same enviroment, they'll * have to call Reload() to see any changes. On UNIX, there * is no setting the environment so that isn't an issue. * * Public methods: * * Enviro::BeServer() - get and set "system level"/service(NT) variables * Enviro::Get() - get a variable from the environment * Enviro::Set() - set a variable in the environment (NT only) * Enviro::Config() - load $P4CONFIG file (if set) * Enviro::List() - list variables in the environment * Enviro::Reload() - flush values cached from NT registry * Enviro::GetConfig() - get the name of the $P4CONFIG file (if set) */ class EnviroTable; struct EnviroItem; class Error; class StrBuf; class StrPtr; class FileSys; struct KeyPair; class Enviro { public: Enviro(); ~Enviro(); enum ItemType { NEW, // not looked up yet UNSET, // looked up and is empty UPDATE, // set via the Update call ENV, // set in environment CONFIG, // via P4CONFIG ENVIRO, // P4ENVIRO file SVC, // set in service-specific registry USER, // set in user registry SYS // set is machine registry }; int BeServer( const StrPtr *name = 0, int checkName = 0 ); const char *ServiceName(); static const StrPtr *GetCachedServerName(); void OsServer(); void List(); int FormatVariable( int i, StrBuf *sb ); int HasVariable( int i ); static int IsKnown( const char *nm ); void GetVarName( int i, StrBuf &sb ); void GetVarValue( int i, StrBuf &sb ); void Format( const char *var, StrBuf *sb ); void Print( const char *var ); char *Get( const char *var ); void Set( const char *var, const char *value, Error *e ); void Update( const char *var, const char *value ); ItemType GetType( const char *var ); int FromRegistry( const char *var ); void Config( const StrPtr &cwd ); void LoadConfig( const StrPtr &cwd, int checkSyntax = 1 ); void LoadEnviro( int checkSyntax = 1 ); void Reload(); void SetCharSet( int ); // for i18n support int GetCharSet(); const StrPtr &GetConfig(); void SetEnviroFile( const char * ); const StrPtr *GetEnviroFile(); private: EnviroTable *symbolTab; EnviroItem *GetItem( const char *var ); void ReadConfig( FileSys *, Error *, int, ItemType ); void Setup(); bool ReadItemPlatform( ItemType type, const char *var, EnviroItem * item ); int SetEnviro( const char *var, const char *value, Error *e ); StrBuf configFile; StrBuf enviroFile; StrBuf serviceName; // used for netsslcredentials to get at service name static const StrPtr *sServiceNameStrP; # ifdef OS_NT KeyPair *setKey; KeyPair *serviceKey; StrBuf serviceKeyName; int charset; # elif defined ( OS_MACOSX ) || defined ( OS_DARWIN ) ItemType domain; // set to Enviro::USER or Enviro::SYS #endif /* OS_NT, OS_MACOSX, OS_DARWIN */ } ;
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 15071 | alan_petersen |
Populate -o //guest/perforce_software/piper/... //guest/alan_petersen/piper/.... |
||
//guest/perforce_software/piper/mac/main/Perforce/p4api/Headers/enviro.h | |||||
#2 | 13625 | alan_petersen |
UPDATE: - updated p4api to p4api-2015.1.1054991 - included in OpenSSL 1.0.2a ssl and crypto libraries The benefit of these are that Piper now supports connecting to 15.1 servers, and also supports ssl: connections. Woo hoo! |
||
#1 | 11252 | alan_petersen | Rename/move file(s) | ||
//guest/perforce_software/piper/mac/Perforce/p4api/Headers/enviro.h | |||||
#1 | 10744 | alan_petersen | Rename/move file(s) | ||
//guest/perforce_software/piper/Perforce/p4api/Headers/enviro.h | |||||
#1 | 8919 | Matt Attaway | Initial add of Piper, a lightweight Perforce client for artists and designers. |