diff --git a/.gitignore b/.gitignore
index d8f0ba0..b945119 100644
--- a/.gitignore
+++ b/.gitignore
@@ -37,3 +37,9 @@ server.pid
# JetBrains IDEs files
.idea/
+
+# macOS file information
+**.DS_Store
+
+# Object files
+***.o
\ No newline at end of file
diff --git a/.yamato/osx-build.yml b/.yamato/osx-build.yml
index 52e54a4..77aec6d 100644
--- a/.yamato/osx-build.yml
+++ b/.yamato/osx-build.yml
@@ -1,15 +1,17 @@
name: Mac - Build & Test VCS plugins
agent:
type: Unity::VM::osx
- image: desktop/unity-macos-10.15-xcode-12.2:stable
- flavor: b1.large
+ image: build-system/unity-macos-13-arm64-unity:v2.4499056
+ flavor: b1.xlarge
+ model: M1
commands:
# Build PerforcePlugin and TestServer
- perl build.pl
# Perforce CLI and server
- - chmod +x PerforceBinaries/OSX/p4 PerforceBinaries/OSX/p4d
+ - chmod +x PerforceBinaries/OSX/arm64/p4 PerforceBinaries/OSX/arm64/p4d
+ - chmod +x PerforceBinaries/OSX/x86_64/p4 PerforceBinaries/OSX/x86_64/p4d
# Run Perforce integration tests with the TestServer
- perl build.pl -test
@@ -17,4 +19,4 @@ commands:
artifacts:
builds:
paths:
- - "Build/OSXx64/PerforcePlugin"
+ - "Build/OSX/PerforcePlugin"
diff --git a/.yamato/zipVCSPlugins.yml b/.yamato/zipVCSPlugins.yml
index 10b82da..d678658 100644
--- a/.yamato/zipVCSPlugins.yml
+++ b/.yamato/zipVCSPlugins.yml
@@ -1,29 +1,30 @@
name: Zip VCS plugins
agent:
type: Unity::VM
- image: core-kaunas/win10-vs2010:latest
+ image: slough-ops/ubuntu-22.04-base:latest
flavor: b1.small
-interpreter: powershell
commands:
- mkdir linux64
- - mkdir OSXx64
+ - cp Build/linux64/* linux64
+
+ - mkdir OSX
+ - cp Build/OSX/* OSX
+
- mkdir Win32
- - Copy-Item Build/linux64/* linux64 -Recurse
- - Copy-Item Build/OSXx64/* OSXx64 -Recurse
- - Copy-Item Build/Win32/* Win32 -Recurse
+ - cp Build/Win32/* Win32
artifacts:
builds:
paths:
- "linux64/**"
- - "OSXx64/**"
+ - "OSX/**"
- "Win32/**"
dependencies:
- - .yamato/windows-build.yml
- .yamato/linux-build.yml
- .yamato/osx-build.yml
+ - .yamato/windows-build.yml
triggers:
branches:
diff --git a/Makefile.gnu b/Makefile.gnu
index 181c746..8e5ae51 100644
--- a/Makefile.gnu
+++ b/Makefile.gnu
@@ -8,7 +8,7 @@ GTK3_INCLUDE = -I/usr/include/gtk-3.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-
GTK3_LIBRARIES = -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0
CFLAGS += -O3 -g -fPIC -fexceptions -fvisibility=hidden -DLINUX
-CXXFLAGS += $(CFLAGS) -fpermissive -Wno-deprecated-declarations $(GTK3_INCLUDE) $(P4PLUGIN_INCLUDE)
+CXXFLAGS += $(CFLAGS) -fpermissive -Wno-deprecated-declarations $(GTK3_INCLUDE) $(P4PLUGIN_INCLUDE_OLD)
LDFLAGS += -g -pthread
LIBRARIES += -lstdc++ -lrt $(GTK3_LIBRARIES)
PLATFORM = linux64
@@ -45,7 +45,7 @@ Test/Source/%.o : Test/Source/%.cpp $(TESTSERVER_INCLS)
$(CXX) $(CXXFLAGS) $(TESTSERVER_INCLUDE) -c $< -o $@
P4Plugin/Source/%.o : P4Plugin/Source/%.cpp $(COMMON_INCLS) $(P4PLUGIN_INCLS)
- $(CXX) $(CXXFLAGS) $(P4PLUGIN_INCLUDE) -D_LINUX -c $< -o $@
+ $(CXX) $(CXXFLAGS) $(P4PLUGIN_INCLUDE_OLD) -D_LINUX -c $< -o $@
$(TESTSERVER_TARGET): $(COMMON_MODULES) $(TESTSERVER_MODULES)
$(CXX) -g $(LDFLAGS) -o $@ $^
diff --git a/Makefile.osx b/Makefile.osx
index a0c5192..7906b62 100644
--- a/Makefile.osx
+++ b/Makefile.osx
@@ -1,12 +1,18 @@
include Makefile.srcs
-CC = gcc
-CXX = g++
+CC = clang
+CXX = clang
AR = ar
-CXXFLAGS = -O2 -arch x86_64 -mmacosx-version-min=10.11
-LDFLAGS = -arch x86_64 -lstdc++ -mmacosx-version-min=10.11
-PLATFORM = OSXx64
+ifeq ($(BUILD_TARGET),P4PluginX64)
+ PLATFORM = OSXx64
+ CXXFLAGS = -O2 -arch x86_64 -mmacosx-version-min=10.11
+ LDFLAGS = -L./P4Plugin/Source/p4api/lib/osx64 -L./P4Plugin/Source/openssl/lib/osx64 -arch x86_64 -lstdc++ -mmacosx-version-min=10.11
+else
+ PLATFORM = OSXarm64
+ CXXFLAGS = -O2 -arch arm64 -mmacosx-version-min=11.0
+ LDFLAGS = -L./P4Plugin/Source/p4api/lib/osxarm64 -L./P4Plugin/Source/openssl/lib/osxarm64 -arch arm64 -lstdc++ -mmacosx-version-min=11.0
+endif
COMMON_MODULES = $(COMMON_SRCS:.c=.o)
COMMON_MODULES := $(COMMON_MODULES:.cpp=.o)
@@ -53,7 +59,10 @@ $(TESTSERVER_TARGET): $(COMMON_MODULES) $(TESTSERVER_MODULES)
$(CXX) -g $(LDFLAGS) -o $@ $^
$(P4PLUGIN_TARGET): $(COMMON_MODULES) $(P4PLUGIN_MODULES)
- $(CXX) $(LDFLAGS) -o $@ -framework Cocoa -framework Security $^ -L./P4Plugin/Source/p4api/lib/osx64 -L./P4Plugin/Source/openssl/lib/osx64 $(P4PLUGIN_LINK)
+ $(CXX) $(LDFLAGS) -o $@ -framework Cocoa -framework Security $^ $(P4PLUGIN_LINK)
+
+clean-objs:
+ rm -f $(COMMON_MODULES) $(P4PLUGIN_MODULES) $(TESTSERVER_MODULES)
clean:
rm -f Build/*.* $(COMMON_MODULES) $(P4PLUGIN_MODULES) $(TESTSERVER_MODULES)
diff --git a/Makefile.srcs b/Makefile.srcs
index 99b2a6b..77f939c 100644
--- a/Makefile.srcs
+++ b/Makefile.srcs
@@ -79,3 +79,6 @@ P4PLUGIN_INCLS = ./P4Plugin/Source/P4Command.h \
P4PLUGIN_LINK = -lclient -lrpc -lsupp -lp4api -lp4script -lp4script_curl -lp4script_sqlite -lp4script_c -lssl -lcrypto
P4PLUGIN_INCLUDE = -I./Common -I./P4Plugin/Source/p4api/include/p4 -I./P4Plugin/Source
+
+# Temporarily use the old include_r21.2 for Linux build until we can find the time to update it to the newest API and validate it fully
+P4PLUGIN_INCLUDE_OLD = -I./Common -I./P4Plugin/Source/p4api/include_r21.2/p4 -I./P4Plugin/Source
diff --git a/P4Plugin/P4Plugin.vcxproj b/P4Plugin/P4Plugin.vcxproj
index e9662a0..4854ca6 100644
--- a/P4Plugin/P4Plugin.vcxproj
+++ b/P4Plugin/P4Plugin.vcxproj
@@ -146,7 +146,7 @@
_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NODEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;
_SCL_SECURE_NO_DEPRECATE
;_SECURE_SCL=0;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
- $(ProjectDir)..\Common;$(ProjectDir)Source\;$(ProjectDir)Source\p4api\include\P4;%(AdditionalIncludeDirectories)
+ $(ProjectDir)..\Common;$(ProjectDir)Source\;$(ProjectDir)Source\p4api\include_r21.2\P4;%(AdditionalIncludeDirectories)
MultiThreadedDebug
@@ -170,7 +170,7 @@ _SCL_SECURE_NO_DEPRECATE
_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NODEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;
_SCL_SECURE_NO_DEPRECATE
;_SECURE_SCL=0;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
- $(ProjectDir)..\Common;$(ProjectDir)Source\;$(ProjectDir)Source\p4api\include\P4;%(AdditionalIncludeDirectories)
+ $(ProjectDir)..\Common;$(ProjectDir)Source\;$(ProjectDir)Source\p4api\include_r21.2\P4;%(AdditionalIncludeDirectories)
MultiThreaded
diff --git a/P4Plugin/Source/P4PluginVersion.h b/P4Plugin/Source/P4PluginVersion.h
index 99699a4..371cbce 100644
--- a/P4Plugin/Source/P4PluginVersion.h
+++ b/P4Plugin/Source/P4PluginVersion.h
@@ -13,5 +13,6 @@
// 2021.3.38f1, 2023.2.19f1, 6000.0.0b14
// 1.3.0 2025/07/29 P4 API 2021.2 for Perforce Cloud
// 1.4.0 build with Visual Studio 2022 and Windows 10 SDK for long path names
+// add support for macOS arm64 using P4 API 2024.1 (for macOS only)
#define PERFORCE_PLUGIN_VERSION "1.4.0"
diff --git a/P4Plugin/Source/openssl/lib/osx64/libcrypto.a b/P4Plugin/Source/openssl/lib/osx64/libcrypto.a
index fe11017..6e97bdd 100644
--- a/P4Plugin/Source/openssl/lib/osx64/libcrypto.a
+++ b/P4Plugin/Source/openssl/lib/osx64/libcrypto.a
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:b01905a3a24fdafd6b0f7f77aa32a436521e4ff40c39b8f4e95fd281332ff7d1
-size 3153152
+oid sha256:f2d1b7f6b4ea2853b3925c9959f17057ea675d91c206e77e41e0df3c0fa9bd12
+size 8622264
diff --git a/P4Plugin/Source/openssl/lib/osx64/libssl.a b/P4Plugin/Source/openssl/lib/osx64/libssl.a
index bc85874..a064295 100644
--- a/P4Plugin/Source/openssl/lib/osx64/libssl.a
+++ b/P4Plugin/Source/openssl/lib/osx64/libssl.a
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:e61a50ceea2648f74c1122075cb628e3489cc7b3ab18c193b8144ea2dbe2b94a
-size 510136
+oid sha256:c38b0e7228dac81cbb3e4787cb0d47021f24954bc5747851574e64ab64f73990
+size 1419904
diff --git a/P4Plugin/Source/openssl/lib/osxarm64/libcrypto.a b/P4Plugin/Source/openssl/lib/osxarm64/libcrypto.a
new file mode 100644
index 0000000..de71958
--- /dev/null
+++ b/P4Plugin/Source/openssl/lib/osxarm64/libcrypto.a
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f80abc55cf2a78d4d0f3c04bbe1e8566df9c8f4b5fe5260e639e0ed90b980102
+size 8315896
diff --git a/P4Plugin/Source/openssl/lib/osxarm64/libssl.a b/P4Plugin/Source/openssl/lib/osxarm64/libssl.a
new file mode 100644
index 0000000..e961144
--- /dev/null
+++ b/P4Plugin/Source/openssl/lib/osxarm64/libssl.a
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:37a81d0f3bde7512c84c57deb7167ab5992867d17039023f4aa1ef805f3cfef6
+size 1456608
diff --git a/P4Plugin/Source/p4api/README.md b/P4Plugin/Source/p4api/README.md
index 4099f35..1adb888 100644
--- a/P4Plugin/Source/p4api/README.md
+++ b/P4Plugin/Source/p4api/README.md
@@ -1,14 +1,16 @@
Document the links from where the P4 C++ API (include files and static libraries) where downloaded:
https://filehost.perforce.com/perforce/r21.2/ p4api-2021.2.2536545
+https://filehost.perforce.com/perforce/r24.1/ p4api-2024.1.2805613
Notes: see also download_perforce_binaries.ps1
# linux64
- https://filehost.perforce.com/perforce/r21.2/bin.linux26x86_64/p4api-glibc2.3-openssl1.0.2.tgz
-# osx64
-- https://filehost.perforce.com/perforce/r21.2/bin.macosx105x86_64/p4api-openssl1.0.2.tgz
+# osx
+- https://filehost.perforce.com/perforce/r24.1/bin.macosx105x86_64/p4api-openssl3.tgz
+- https://filehost.perforce.com/perforce/r24.1/bin.macosx12arm64/p4api-openssl3.tgz
# Win32
- https://filehost.perforce.com/perforce/r21.2/bin.ntx86/p4api_vs2019_static_openssl1.0.2.zip
diff --git a/P4Plugin/Source/p4api/include/p4/clientapi.h b/P4Plugin/Source/p4api/include/p4/clientapi.h
index 339a1d9..7eef4ca 100644
--- a/P4Plugin/Source/p4api/include/p4/clientapi.h
+++ b/P4Plugin/Source/p4api/include/p4/clientapi.h
@@ -255,6 +255,7 @@ class ClientApi : public StrDict {
const StrArray *GetConfigs();
const StrPtr &GetBuild();
const StrPtr &GetVersion();
+ Error * GetTransError();
Enviro * GetEnviro();
Ignore * GetIgnore();
@@ -270,7 +271,7 @@ class ClientApi : public StrDict {
bool ExtensionsEnabled();
void SetExtension( ClientScript* cs, Error* e,
const bool callerOwns = false );
-
+ void EnableDebugHooks();
public:
// The old interface, where ui was held from the start
@@ -288,6 +289,7 @@ class ClientApi : public StrDict {
StrPtr *VGetVar( const StrPtr &var );
void VSetVar( const StrPtr &var, const StrPtr &val );
+ int VGetCount();
private:
Client *client; // wrapped up RPC
diff --git a/P4Plugin/Source/p4api/include/p4/clientprog.h b/P4Plugin/Source/p4api/include/p4/clientprog.h
index 3272649..e072627 100644
--- a/P4Plugin/Source/p4api/include/p4/clientprog.h
+++ b/P4Plugin/Source/p4api/include/p4/clientprog.h
@@ -16,6 +16,7 @@
#define CPU_FILES 2
#define CPU_KBYTES 3
#define CPU_MBYTES 4
+#define CPU_DELTAS 5
class ClientProgress
{
@@ -49,5 +50,6 @@ class ClientProgressText : public ClientProgress
int backup;
StrBuf desc;
bool done;
+ int units;
};
diff --git a/P4Plugin/Source/p4api/include/p4/clientscript.h b/P4Plugin/Source/p4api/include/p4/clientscript.h
index 9834c74..faac2fc 100644
--- a/P4Plugin/Source/p4api/include/p4/clientscript.h
+++ b/P4Plugin/Source/p4api/include/p4/clientscript.h
@@ -6,12 +6,18 @@
# ifdef HAS_EXTENSIONS
+// This enum represents the result of a client-side Extension function.
+
enum class ClientScriptAction
{
- UNKNOWN,
- FAIL,
- PASS,
- REPLACE
+ UNKNOWN, // Script misbehaving / crashed / etc.
+ FAIL, // Script says 'no'.
+ PASS, // Script says 'ok'.
+ REPLACE, // Script does something instead of what would happen.
+ PRE_DEBUG, // Non-functional divider between normal user-facing
+ // scripts and internal debug code.
+ ABORT, // Tell the caller to abort or otherwise exit immediately.
+ EARLY_RETURN // Tell the caller to return control to its parent func.
};
class ClientScript
diff --git a/P4Plugin/Source/p4api/include/p4/clientuser.h b/P4Plugin/Source/p4api/include/p4/clientuser.h
index 964f549..01e9178 100644
--- a/P4Plugin/Source/p4api/include/p4/clientuser.h
+++ b/P4Plugin/Source/p4api/include/p4/clientuser.h
@@ -106,6 +106,10 @@ class ClientTransfer;
class ClientSSO;
class ClientApi;
+# ifdef HAS_CPP11
+# include
+# endif
+
class ClientUser {
public:
@@ -163,6 +167,9 @@ class ClientUser {
virtual void Finished() {}
+ void SetVarList( StrDict *l );
+ void SetEnviro( Enviro *env );
+
StrDict *varList; // (cheesy) access to RPC buffer
Enviro *enviro; // (cheesy) access to Client's env
@@ -210,6 +217,8 @@ class ClientUser {
int quiet; // OutputInfo does nothing.
int autoLogin; // Can this implementation autoprompt
+ void* setterGuard; // Setter mutex when built with C++11+
+
protected:
int outputCharset; // P4CHARSET for output
StrBuf editFile;
diff --git a/P4Plugin/Source/p4api/include/p4/datetime.h b/P4Plugin/Source/p4api/include/p4/datetime.h
index 6e7824b..5ae6968 100644
--- a/P4Plugin/Source/p4api/include/p4/datetime.h
+++ b/P4Plugin/Source/p4api/include/p4/datetime.h
@@ -24,11 +24,11 @@ class DateTime {
DateTime( const char *date, Error *e ) { Set( date, e ); }
void Set( const char *date, Error *e );
- void Set( const int date ) { wholeDay = 0; tval = (time_t)date; }
+ void Set( const P4INT64 date ) { wholeDay = 0; tval = (time_t)date; }
void SetNow() { Set( (int)Now() ); }
- int Compare( const DateTime &t2 ) const {
- return (int)(tval - t2.tval); };
+ P4INT64 Compare( const DateTime &t2 ) const {
+ return (tval - t2.tval); };
void Fmt( char *buf ) const;
void FmtDay( char *buf ) const;
@@ -38,31 +38,34 @@ class DateTime {
void FmtElapsed( char *buf, const DateTime &t2 );
void FmtUnifiedDiff( char *buf ) const;
void FmtISO8601( char *buf ) const;
+ void FmtISO8601Min( char *buf ) const;
+
+ void SetRFC5322( const char *date, Error *e );
+ void FmtRFC5322( char *buf ) const;
void SetGit( const StrPtr &gitDate, Error *e );
void FmtGit( StrBuf &buf ) const;
- int Value() const { return (int)tval; }
- int Tomorrow() const { return (int)tval + 24*60*60; }
+ P4INT64 Value() const { return tval; }
+ P4INT64 Tomorrow() const { return tval + 24*60*60; }
int IsWholeDay() const { return wholeDay; }
- static int Never() { return 0; }
- static int Forever() { return 2147483647; }
+ static P4INT64 Never() { return 0; }
// for stat() and utime() conversion
- static time_t Localize( time_t centralTime );
- static time_t Centralize( time_t localTime );
- int TzOffset( int *isdst = 0 ) const;
+ static P4INT64 Localize( time_t centralTime );
+ static P4INT64 Centralize( time_t localTime );
+ P4INT64 TzOffset( int *isdst = 0 ) const;
protected:
- time_t Now();
+ P4INT64 Now();
private:
- time_t tval;
+ P4INT64 tval;
int wholeDay;
- int ParseOffset( const char *s, const char *odate, Error *e );
+ P4INT64 ParseOffset( const char *s, const char *odate, Error *e );
};
class DateTimeNow : public DateTime {
@@ -84,7 +87,7 @@ class DateTimeHighPrecision
public:
// Orthodox Canonical Form (OCF) methods (we don't need a dtor)
- DateTimeHighPrecision(time_t secs = 0, int nsecs = 0)
+ DateTimeHighPrecision(P4INT64 secs = 0, int nsecs = 0)
: seconds( secs ), nanos( nsecs ) { }
DateTimeHighPrecision(const DateTimeHighPrecision &rhs)
@@ -125,9 +128,10 @@ class DateTimeHighPrecision
void Now();
void Fmt( char *buf ) const;
+ void FmtISO8601( char *buf ) const;
- time_t Seconds() const;
- int Nanos() const;
+ P4INT64 Seconds() const;
+ P4INT64 Nanos() const;
bool IsZero() const { return seconds == 0 && nanos == 0; }
@@ -138,11 +142,12 @@ class DateTimeHighPrecision
// return < 0, = 0, or > 0 if *this < rhs, *this == rhs, or *this > rhs, respectively
int Compare( const DateTimeHighPrecision &rhs ) const;
- private:
-
P4INT64 ToNanos() const;
+ P4INT64 ToMs() const;
+
+ private:
- time_t seconds; // Since 1/1/1970, natch
+ P4INT64 seconds; // Since 1/1/1970, natch
int nanos;
} ;
diff --git a/P4Plugin/Source/p4api/include/p4/debug.h b/P4Plugin/Source/p4api/include/p4/debug.h
index 44e5b4a..74c9405 100644
--- a/P4Plugin/Source/p4api/include/p4/debug.h
+++ b/P4Plugin/Source/p4api/include/p4/debug.h
@@ -19,6 +19,7 @@ class StrPtr;
class StrBuf;
class ErrorLog;
class Error;
+struct ErrorId;
enum P4DebugType {
DT_DB, // DbOpen
@@ -58,7 +59,12 @@ enum P4DebugType {
DT_HEARTBEAT, // Heartbeat related
DT_SHELVE, // Shelving related
DT_SQW, // StreamQWorker related
+ DT_STM, // Stream materialize for fstat,files,dirs
+ DT_PCHECK, // Parallel checkpoint
DT_TOPOLOGY, // Topology
+ DT_RESOURCE, // OS resources
+ DT_S3, // S3 cURL client
+ DT_SUPTOOLS, // Support Tools
DT_LAST
} ;
@@ -66,13 +72,90 @@ enum P4TunableType {
DTT_NONE, // Unknown tuneable
DTT_INT, // Numeric tuneable
DTT_STR, // String tuneable
-};
+} ;
+
+enum P4TunableApplicability {
+ CONFIG_APPLY_NONE = 0x0000,
+ CONFIG_APPLY_CLIENT = 0x0001,
+ CONFIG_APPLY_SERVER = 0x0002,
+ CONFIG_APPLY_PROXY = 0x0004,
+ CONFIG_APPLY_BROKER = 0x0008
+ // When you add new types, update the string array in userconfig.cc
+} ;
+
+enum P4TunableRestart {
+ CONFIG_RESTART_NONE,
+ CONFIG_RESTART_NO_RESTART,
+ CONFIG_RESTART_RESTART,
+ CONFIG_RESTART_STOP,
+ CONFIG_RESTART_REF_DOC
+ // When you add new types, update the string array in userconfig.cc
+} ;
+
+enum P4TunableSupport {
+ CONFIG_SUPPORT_NONE,
+ CONFIG_SUPPORT_NODOC,
+ CONFIG_SUPPORT_UNDOC,
+ CONFIG_SUPPORT_DOC
+ // When you add new types, update the string array in userconfig.cc
+} ;
+
+enum P4TunableCategory {
+ CONFIG_CAT_NONE = 0x0000,
+ CONFIG_CAT_MISC = 0x0001,
+ CONFIG_CAT_SECURITY = 0x0002,
+ CONFIG_CAT_STREAMS = 0x0004,
+ CONFIG_CAT_REPLICATION = 0x0008,
+ CONFIG_CAT_NETWORK = 0x0010,
+ CONFIG_CAT_PERFORMANCE = 0x0020,
+ CONFIG_CAT_MONITORING = 0x0040,
+ CONFIG_CAT_TRIGGERS = 0x0080,
+ CONFIG_CAT_EXTENSIONS = 0x0100,
+ CONFIG_CAT_LICENSING = 0x0200,
+ CONFIG_CAT_ARCHIVE_MANAGEMENT = 0x0400,
+ CONFIG_CAT_DVCS = 0x0800
+ // When you add new types, update the string array in userconfig.cc
+} ;
extern P4MT int list2[];
class P4Tunable {
public:
+ struct tunable {
+ const char *name;
+ int isSet;
+ int value;
+ int minVal;
+ int maxVal;
+ int modVal;
+ int k; // what's 1k? 1000 or 1024?
+ int original;
+ int sensitive;
+
+ const ErrorId *description;
+ const char *recVal; // Recommended value
+ int svr; // Applicability - server/client/proxy/broker
+ int restart; // Restart requirement
+ int support; // Support level
+ int cat; // Category
+ };
+
+ struct stunable {
+ const char *name;
+ int isSet;
+ const char *def;
+ char *value;
+ int sensitive;
+
+ const ErrorId *description;
+ const char *recVal; // Recommended value
+ int svr; // Applicability - server/client/proxy/broker
+ int restart; // Restart requirement
+ int support; // Support level
+ int cat; // Category
+ const char *accepted; // Comma separated accepted values
+ };
void Set( const char *set );
void SetTLocal( const char *set );
@@ -81,6 +164,14 @@ class P4Tunable {
return t < DT_LAST && list2[t] != -1 && list2[t] > list[t].value ?
list2[t] : list[t].value;
}
+
+ const tunable *GetTunable( int i ) const;
+
+ const stunable *GetStringTunable( int i ) const;
+
+ int GetOriginalValue( int t ) const {
+ return list[t].original;
+ }
int GetLevel( const char *n ) const;
StrBuf GetString( const char *n ) const;
StrBuf GetString( int t ) const;
@@ -105,25 +196,8 @@ class P4Tunable {
protected:
- static struct tunable {
- const char *name;
- int isSet;
- int value;
- int minVal;
- int maxVal;
- int modVal;
- int k; // what's 1k? 1000 or 1024?
- int original;
- int sensitive;
- } list[];
-
- static struct stunable {
- const char *name;
- int isSet;
- const char *def;
- char *value;
- int sensitive;
- } slist[];
+ static tunable list[];
+ static stunable slist[];
} ;
typedef void (*DebugOutputHook)( void *context, const StrPtr *buffer );
@@ -135,12 +209,14 @@ class P4DebugConfig {
virtual void Output();
virtual StrBuf *Buffer();
virtual int Alloc( int );
+ virtual P4DebugConfig *Clone();
void Install();
void SetErrorLog( ErrorLog *e ) { elog = e; }
void SetOutputHook( void *ctx, DebugOutputHook hk )
{ hook = hk; context = ctx; }
static void TsPid2StrBuf( StrBuf &prefix );
+ static P4DebugConfig *ThreadClone();
protected:
StrBuf *buf;
@@ -148,6 +224,7 @@ class P4DebugConfig {
ErrorLog *elog;
DebugOutputHook hook;
void *context;
+ int cloned;
};
class P4Debug : private P4Tunable {
@@ -160,6 +237,8 @@ class P4Debug : private P4Tunable {
int GetLevel( P4DebugType t ) const { return Get(t); }
+ int IsSet( P4DebugType t ) const { return P4Tunable::IsSet( t ); }
+
void ShowLevels( int showAll, StrBuf &buf );
void Event();
diff --git a/P4Plugin/Source/p4api/include/p4/dmextension.h b/P4Plugin/Source/p4api/include/p4/dmextension.h
index 8bf5418..2351014 100644
--- a/P4Plugin/Source/p4api/include/p4/dmextension.h
+++ b/P4Plugin/Source/p4api/include/p4/dmextension.h
@@ -84,7 +84,8 @@ class Extension : public p4script
void LoadFile( const char* file, Error *e );
virtual void doBindings( Error* e );
- ExtensionCallerData* GetECD();
+ ExtensionCallerData* GetECD()
+ { return ecd ? &**ecd : nullptr; }
p4_std_any::p4_any RunCallBack( const char* name, Error* e );
diff --git a/P4Plugin/Source/p4api/include/p4/error.h b/P4Plugin/Source/p4api/include/p4/error.h
index 4b5d819..bc4aa7a 100644
--- a/P4Plugin/Source/p4api/include/p4/error.h
+++ b/P4Plugin/Source/p4api/include/p4/error.h
@@ -56,6 +56,23 @@
# ifndef __ERROR_H__
# define __ERROR_H__
+// Need P4INT64 if not already defined
+// Usually expected to be defined by stdhdrs.h (duplicated from there)
+# ifndef P4INT64
+# if !defined( OS_MVS ) && \
+ !defined( OS_OS2 ) && \
+ !defined( OS_QNX )
+# define HAVE_INT64
+# ifdef OS_NT
+# define P4INT64 __int64
+# else
+# define P4INT64 long long
+# endif
+# else
+# define P4INT64 int
+# endif
+# endif
+
class StrBuf;
class StrDict;
class StrPtr;
@@ -127,7 +144,8 @@ class Error {
virtual ~Error();
void operator =( const Error &source );
- Error & Merge( const Error &source );
+ Error & Merge( const Error &source, int igndups = 0 );
+
virtual void Clear() { severity = E_EMPTY; }
const ErrorId *MapError( const struct ErrorIdMap map[] );
@@ -159,7 +177,10 @@ class Error {
Error & operator <<( const StrPtr &arg );
Error & operator <<( const StrPtr *arg );
Error & operator <<( const char *arg );
+ Error & operator <<( P4INT64 arg );
Error & operator <<( int arg );
+ Error & operator <<( unsigned int arg );
+ Error & operator <<( long int arg );
// Save system errors
diff --git a/P4Plugin/Source/p4api/include/p4/errornum.h b/P4Plugin/Source/p4api/include/p4/errornum.h
index acd9ce2..c3ec3e0 100644
--- a/P4Plugin/Source/p4api/include/p4/errornum.h
+++ b/P4Plugin/Source/p4api/include/p4/errornum.h
@@ -57,4 +57,5 @@ enum ErrorSubsystem {
ES_SCRIPT = 17, // scripting
ES_SERVER2 = 18, // server overflow
ES_DM2 = 19, // dm overflow
+ ES_CONFIG = 20, // help for configurables
} ;
diff --git a/P4Plugin/Source/p4api/include/p4/filesys.h b/P4Plugin/Source/p4api/include/p4/filesys.h
index 22e8a3d..a3a4625 100644
--- a/P4Plugin/Source/p4api/include/p4/filesys.h
+++ b/P4Plugin/Source/p4api/include/p4/filesys.h
@@ -67,11 +67,14 @@
* FileSys::Chmod() - change permissions
* FileSys::Compare() - compare file against target
* FileSys::Copy - copy one file to another
+ * FileSys::CopyRange - copy a range of a file (possibly optimized)
* FileSys::Digest() - return a fingerprint of the file contents
* FileSys::Chmod2() - copy a file to get ownership and set perms
* FileSys::Fsync() - sync file state to disk
*
* FileSys::CheckType() - look at the file and see if it is binary, etc
+ * FileSys::SetAtomicRename() - set atomic rename on this instance
+ * FielSys::CheckForAtomicRename() - Qualify Windows OS atomic support
*/
# ifdef OS_NT
@@ -178,14 +181,6 @@ enum FilePerm {
FPM_RWXO // set file read-write-execute (owner)
} ;
-enum LFNModeFlags {
- LFN_ENABLED = 0x01,
- LFN_UNCPATH = 0x02,
- LFN_UTF8 = 0x04,
- LFN_MOVEBUSY = 0x08,
- LFN_CSENSITIVE = 0x10,
-} ;
-
enum FileDigestType
{
FS_DIGEST_UNKNOWN = 0,
@@ -199,6 +194,7 @@ class StrArray;
class CharSetCvt;
class MD5;
class StrBuf;
+class StrBufDict;
class DateTimeHighPrecision; // for the high-precision modtime calls
@@ -215,6 +211,7 @@ class DiskSpaceInfo {
P4INT64 freeBytes;
int pctUsed;
StrBuf *fsType;
+ StrBuf *mountpoint;
} ;
# ifdef HAS_CPP11
@@ -223,30 +220,31 @@ class DiskSpaceInfo {
class FileSys;
-// Specialization to the std::default_delete template class so we can store
-// a std::unique_pointer to the FileSys* returned from FileSys::Create without
-// having to know which inherited class it's actually using and without having
-// to use a custom deleter everywhere.
+using FileSysUPtr = std::unique_ptr< FileSys >;
+
+# endif
-namespace std
+class FileSysBuffer
{
- template<> class default_delete< FileSys* >
- {
- public:
- void operator()( FileSys **ptr );
- };
-}
+ public:
+ virtual ~FileSysBuffer() {}
+ virtual void Release() = 0;
-using FileSysUPtr = std::unique_ptr< FileSys* >;
+ virtual void Open( StrPtr *path, FileOpenMode mode, Error *e ) = 0;
+ virtual void Write( const char *buf, int len, Error *e ) = 0;
+ virtual int Read( char *buf, int len, Error *e ) = 0;
+ virtual void Close( Error *e ) = 0;
-# endif
+ virtual void Seek( offL_t /* offset */, Error* /* e */ ) {}
+ virtual void SizeHint( offL_t /* size */ ) {}
+} ;
class FileSys {
public:
// Creators
-
- static FileSys *Create( FileSysType type );
+
+ static FileSys *Create( FileSysType type, FileSysBuffer *buf = 0 );
static FileSys *CreateTemp( FileSysType type ) {
FileSys *f = Create( type );
@@ -279,6 +277,9 @@ class FileSys {
static bool IsRelative( const StrPtr &p );
+ static bool MakePathWriteable( const StrPtr &oldFile,
+ StrBuf &newFile, Error *e );
+
# ifdef OS_NT
static bool IsUNC( const StrPtr &p );
# endif
@@ -302,8 +303,8 @@ class FileSys {
void Perms( FilePerm p ) { perms = p; }
void ModTime( StrPtr *u ) { modTime = u->Atoi(); }
- void ModTime( time_t t ) { modTime = (int)t; }
- time_t GetModTime() { return modTime; }
+ void ModTime( P4INT64 t) { modTime = t; }
+ P4INT64 GetModTime() { return modTime; }
// Set filesize hint for NT fragmentation avoidance
@@ -317,10 +318,12 @@ class FileSys {
// RmDir() should not erase your cwd (mainly for DVCS)
void PreserveCWD() { preserveCWD = 1; }
+ void PreserveRoot( StrPtr root ) { preserveRoot = root; }
// Initialize digest
virtual void SetDigest( MD5 *m );
+ virtual MD5 *GetDigest();
// Get type info
@@ -351,6 +354,8 @@ class FileSys {
virtual void SetLFN( const StrPtr &name );
virtual int GetLFN( ) {return LFN;}
# endif
+ // Enable atomic rename support
+ virtual void SetAtomicRename();
virtual void Set( const StrPtr &name );
virtual void Set( const StrPtr &name, Error *e );
virtual StrPtr *Path() { return &path; }
@@ -365,16 +370,22 @@ class FileSys {
virtual int Stat() = 0;
virtual int LinkCount();
- virtual int StatModTime() = 0;
+ virtual P4INT64 StatModTime() = 0;
+ virtual P4INT64 StatAccessTime() = 0;
virtual void StatModTimeHP(DateTimeHighPrecision *modTime);
virtual void Truncate( Error *e ) = 0;
virtual void Truncate( offL_t offset, Error *e ) = 0;
virtual void Unlink( Error *e = 0 ) = 0;
+ virtual void UnlinkNoRetry( Error* e = 0 ) { Unlink( e ); }
virtual void Rename( FileSys *target, Error *e ) = 0;
virtual void Chmod( FilePerm perms, Error *e ) = 0;
virtual void ChmodTime( Error *e ) = 0;
virtual void ChmodTimeHP( const DateTimeHighPrecision & /* modTime */, Error * /* e */ ) {};
virtual void SetAttribute( FileSysAttr, Error * ) { };
+ virtual void SetExtendedAttribute( StrPtr * /* name */, StrPtr * /* val */, Error * ) {};
+ virtual void SetExtendedAttributes( StrDict * /* vals */, Error * ) {};
+ virtual void GetExtendedAttribute( StrPtr * /* name */, StrBuf * /* val */, Error * ) {};
+ virtual void GetExtendedAttributes( StrBufDict * /* attrs */, Error * ) {};
virtual void Fsync( Error * ) { }
@@ -427,6 +438,9 @@ class FileSys {
virtual void RmDir( const StrPtr &p, Error *e );
void RmDir( Error *e = 0 ) { RmDir( path, e ); }
+ // Determine if this Windows OS supports atomic rename
+ static void CheckForAtomicRename( Error *e );
+
FileSysType CheckType( int scan = -1 );
# if defined ( OS_MACOSX ) && OS_VER < 1010
@@ -444,6 +458,12 @@ class FileSys {
void WriteFile( const StrPtr *buf, Error *e );
int Compare( FileSys *other, Error *e );
void Copy( FileSys *targetFile, FilePerm perms, Error *e );
+ // Copy a range of content from one FileSys to another.
+ // This is intended to be used with uncompressed binary files
+ // (FST_BINARY) so it can use fast low-level OS operations on disk files.
+ void CopyRange( offL_t offIn, size_t len,
+ FileSys *targetFile, offL_t offOut,
+ Error *e );
virtual void Digest( StrBuf *digest, Error *e );
void Chmod2( FilePerm perms, Error *e );
void Chmod2( const char *p, Error *e )
@@ -456,6 +476,8 @@ class FileSys {
StrBuf *digest,
Error *e );
+ void SetDelegate( FileSysBuffer *buf ) { delegate = buf; }
+
// Character Set operations
void SetCharSetPriv( int x = 0 ) { charSet = x; }
@@ -471,12 +493,13 @@ class FileSys {
FileOpenMode mode; // read or write
FilePerm perms; // leave read-only or read-write
- int modTime; // stamp file mod date on close
+ P4INT64 modTime; // stamp file mod date on close
offL_t sizeHint; // how big will the file get ?
StrBuf path;
FileSysType type;
MD5 *checksum; // if verifying file transfer
int cacheHint; // don't pollute cache
+ FileSysBuffer* delegate; // don't read/write from/to disk
# ifdef OS_NT
int LFN;
@@ -486,6 +509,7 @@ class FileSys {
int isTemp;
int preserveCWD;
+ StrBuf preserveRoot;
int charSet;
int content_charSet;
diff --git a/P4Plugin/Source/p4api/include/p4/ignore.h b/P4Plugin/Source/p4api/include/p4/ignore.h
index 373ae03..983e6fe 100644
--- a/P4Plugin/Source/p4api/include/p4/ignore.h
+++ b/P4Plugin/Source/p4api/include/p4/ignore.h
@@ -6,10 +6,13 @@
# define DEBUG_MATCH ( p4debug.GetLevel( DT_MAP ) >= 3 )
# define DEBUG_LIST ( p4debug.GetLevel( DT_MAP ) >= 4 )
+# define DEBUG_BUILD ( p4debug.GetLevel( DT_MAP ) >= 5 )
class IgnoreTable;
class IgnoreItem;
+class IgnorePtrArray;
+class IgnoreArray;
class StrArray;
class FileSys;
@@ -38,18 +41,21 @@ class Ignore {
void BuildIgnoreFiles( const StrPtr &ignoreName );
int Build( const StrPtr &path, const StrPtr &ignoreName,
const char *configName );
- void InsertDefaults( StrArray *list, const char *cfgName );
+ void InsertDefaults( IgnorePtrArray *newList );
void Insert( StrArray *subList, const char *ignore,
const char *cwd, int lineno );
int ParseFile( FileSys *f, const char *cwd,
- StrArray *list );
+ IgnoreArray *list );
IgnoreTable *ignoreTable;
- StrArray *ignoreList;
+ IgnorePtrArray *ignoreList;
+ IgnoreArray *defaultList;
StrBuf dirDepth;
StrBuf foundDepth;
+ StrBuf configName;
StrArray *ignoreFiles;
StrBuf ignoreStr;
+ int relatives;
};
diff --git a/P4Plugin/Source/p4api/include/p4/malloc_override.h b/P4Plugin/Source/p4api/include/p4/malloc_override.h
index 1ef1925..6c9def5 100644
--- a/P4Plugin/Source/p4api/include/p4/malloc_override.h
+++ b/P4Plugin/Source/p4api/include/p4/malloc_override.h
@@ -22,11 +22,15 @@ built with a memory manager.
# define MI_STATIC_LIB
# ifndef NDEBUG
# define NDEBUG
+# define DEFINED_NDEBUG
# endif
# define MI_STAT 1
-# define MI_NO_ENVIRO 1
+# define MI_NO_GETENV
# include
-
+# if defined(NDEBUG) && defined(DEFINED_NDEBUG)
+# undef NDEBUG
+# undef DEFINED_NDEBUG
+# endif
# define HAS_MIMALLOC
# define P4_MALLOC mi_malloc
# define P4_CALLOC mi_calloc
diff --git a/P4Plugin/Source/p4api/include/p4/md5.h b/P4Plugin/Source/p4api/include/p4/md5.h
index e2b0cc2..496e95e 100644
--- a/P4Plugin/Source/p4api/include/p4/md5.h
+++ b/P4Plugin/Source/p4api/include/p4/md5.h
@@ -115,6 +115,7 @@ class MD5 {
public:
MD5();
+ MD5( Error *e );
void Update( const StrPtr &buf );
void Final( StrBuf &output );
@@ -122,6 +123,7 @@ class MD5 {
private:
+ void Init( Error *e );
void Transform();
count64 bits; // total
@@ -145,16 +147,20 @@ class MD5 {
public:
MD5();
+ MD5( Error *e );
~MD5();
MD5& operator=( const MD5& rhs );
void Update( const StrPtr &buf );
+ void Update( const unsigned char* buf, const size_t len );
void Final( StrBuf &output );
void Final( unsigned char digest[ 16 ] );
P4INT64 Count();
private:
+ void Init( Error *e );
+
void* ctx;
P4INT64 bits;
};
diff --git a/P4Plugin/Source/p4api/include/p4/msgclient.h b/P4Plugin/Source/p4api/include/p4/msgclient.h
index 3788da0..3dcea07 100644
--- a/P4Plugin/Source/p4api/include/p4/msgclient.h
+++ b/P4Plugin/Source/p4api/include/p4/msgclient.h
@@ -63,6 +63,7 @@ class MsgClient {
static ErrorId UnknownCharset;
static ErrorId FileKept;
+ static ErrorId DataOutOfBounds;
static ErrorId ChdirFail;
static ErrorId LockCheckFail;
@@ -122,6 +123,19 @@ class MsgClient {
static ErrorId DirectoryNotEmpty;
static ErrorId CantRevertDirectoryNotEmpty;
+ static ErrorId BadFiletype;
+ static ErrorId BadLineEndingFlag;
+ static ErrorId BadUncompressFlag;
+
+ static ErrorId AltSyncBadJSON;
+ static ErrorId AltSyncNoResult;
+ static ErrorId AltSyncBadResult;
+ static ErrorId AltSyncErr;
+ static ErrorId AltSyncUnhandledPass;
+ static ErrorId AltSyncNotSupported;
+ static ErrorId AltSyncFailStart;
+
+
// Retired ErrorIds. We need to keep these so that clients
// built with newer apis can commnunicate with older servers
// still sending these.
diff --git a/P4Plugin/Source/p4api/include/p4/msgdb.h b/P4Plugin/Source/p4api/include/p4/msgdb.h
index 76329d7..3bb7a8e 100644
--- a/P4Plugin/Source/p4api/include/p4/msgdb.h
+++ b/P4Plugin/Source/p4api/include/p4/msgdb.h
@@ -11,6 +11,7 @@
class MsgDb {
public:
+ static ErrorId DevErr;
static ErrorId JnlEnd;
static ErrorId JnlWord2Big;
@@ -49,6 +50,7 @@ class MsgDb {
static ErrorId DelNoLock;
static ErrorId Delete;
static ErrorId Locking;
+ static ErrorId LockingLoop;
static ErrorId EndXact;
static ErrorId GetNoGet;
static ErrorId TableUnknown;
@@ -87,10 +89,13 @@ class MsgDb {
static ErrorId MustExpire;
static ErrorId Checksum;
static ErrorId WrongApp;
+ static ErrorId LicenseWrongService;
static ErrorId PlatPre972;
static ErrorId LicenseRead;
static ErrorId LicenseBad;
static ErrorId AddressChanged;
+ static ErrorId AddressInvalid;
+ static ErrorId AddressInvalidRecommend;
static ErrorId LicenseNeedsApplication;
static ErrorId BadIPservice;
static ErrorId BadXCapLine;
@@ -107,12 +112,23 @@ class MsgDb {
static ErrorId TreeNewerVersion;
static ErrorId TreeOlderVersion;
static ErrorId DoNotBlameTheDb;
+ static ErrorId NoPartitionedDb;
+ static ErrorId NotPartitionedTable;
+ static ErrorId PartitionedDbUsage;
+ static ErrorId FailedValidation;
+ static ErrorId PartitionedVerify;
+ static ErrorId CannotUseSpecificPTable;
static ErrorId MapCheckFail;
static ErrorId CaseMismatch;
static ErrorId GenNumPageTooNew;
+ static ErrorId BadRecoverTbl;
+
+ static ErrorId DbTreeDuplicate;
+ static ErrorId DbTreeNotFound;
+ static ErrorId DbIntVBit;
// Retired ErrorIds. We need to keep these so that clients
// built with newer apis can commnunicate with older servers
diff --git a/P4Plugin/Source/p4api/include/p4/msgdm2.h b/P4Plugin/Source/p4api/include/p4/msgdm2.h
index da82301..6c3b0ad 100644
--- a/P4Plugin/Source/p4api/include/p4/msgdm2.h
+++ b/P4Plugin/Source/p4api/include/p4/msgdm2.h
@@ -3,18 +3,27 @@
*
* This file is part of Perforce - the FAST SCM System.
*/
-
/*
* msgdm2.h - overflow definitions of errors for data manager core subsystem.
*/
-
class MsgDm2 {
public:
static ErrorId ExistingStorage;
static ErrorId ConfigHistData;
static ErrorId LbrScanBadState;
static ErrorId LbrScanCtlNotFound;
+
+ static ErrorId IntegIntoReadOnlyOverlay;
+ static ErrorId IntegRequiresStream;
+ static ErrorId IntegStreamSyntaxHint;
+
+ static ErrorId OpenReadOnlyOverlay;
+ static ErrorId OpenWarnOverlay;
+ static ErrorId OpenUndoConflict;
+
+ static ErrorId UnshelveBadOverlay;
static ErrorId UnshelveStreamResolve;
+
static ErrorId RequiresAutoIdCode;
static ErrorId SpecMissingBuiltin;
static ErrorId StreamSpecIntegOkay;
@@ -37,6 +46,7 @@ class MsgDm2 {
static ErrorId GblLockIndexMismatch;
static ErrorId GblLockIndexMissing;
static ErrorId GblLockMissing;
+ static ErrorId GblUnlockMissing;
static ErrorId StreamlogInteg;
static ErrorId RemoteAutoGenSpecFailed;
static ErrorId StreamParentViewMustBeOpen;
@@ -63,9 +73,104 @@ class MsgDm2 {
static ErrorId StreamViewMatchData;
static ErrorId NoTopologyRecord;
static ErrorId NoServerIDSet;
- static ErrorId NoPartitionedToReadonly;
+ static ErrorId TopologyRecDeleted;
+ static ErrorId TopologyRecNotFound;
static ErrorId LockNameNull;
static ErrorId WorkRecNotFound;
+ static ErrorId StreamDeletedInChange;
+ static ErrorId DomainObliterate;
+ static ErrorId StreamNotModifiedAtChange;
+ static ErrorId PurgeStreamSpec;
+ static ErrorId CannotDeleteShelvedStream;
+ static ErrorId RmtArchiveDeleteFailed;
+ static ErrorId RmtDeleteEdgeArchiveFailed;
+ static ErrorId ComponentStreamInvalid;
+ static ErrorId ComponentTypeNotAvailable;
+ static ErrorId TopologyDelPreview;
+ static ErrorId StreamHasComponentsDelete;
+ static ErrorId StreamHasComponentsOblit;
+ static ErrorId ComponentInvalidIsStream;
+ static ErrorId ComponentInvalidIsConsumer;
+ static ErrorId ComponentInvalidIsRelative;
+ static ErrorId ReparentFailedParentIsComponent;
+ static ErrorId ReparentFailedParentIsCompOfChild;
+ static ErrorId ReparentFailedFamilyIsComponent;
+ static ErrorId ReparentFailedFamilyIsCompOfChild;
+ static ErrorId ReparentFailedParentHasComponent;
+ static ErrorId ReparentFailedFamilyHasComponent;
+ static ErrorId StreamDeletedInChangeWarn;
+ static ErrorId StreamLoopFound;
+ static ErrorId ComponentInvalidIsDependent;
+ static ErrorId TopologyThresholdOutOfRange;
static ErrorId ProtectsMismatch;
+ static ErrorId DirsDataStreamViews;
+ static ErrorId FilesDataStreamViews;
+ static ErrorId FilesDataTrait;
+ static ErrorId MaxMem;
+ static ErrorId GroupsDataVerbose222;
+ static ErrorId TopologyDelRecMarker;
+ static ErrorId TopologyMoveRecMarker;
+ static ErrorId TopologyAmbiguity;
+ static ErrorId TopologyTargetDeleted;
+ static ErrorId TopologyRecAlreadyDeleted;
+ static ErrorId ComponentWritableNoChange;
+ static ErrorId NoChangeOnDistribution;
+ static ErrorId TopologyRecAlreadyMoved;
+ static ErrorId TopologyRecMoved;
+ static ErrorId TopologyMoveSame;
+ static ErrorId TopologyFailedToMark;
+ static ErrorId TopologyMarkedMoveTo;
+ static ErrorId NoAltSyncChangeWithHave;
+ static ErrorId MaxMemOS;
+ static ErrorId BadLazyPipeCount;
+ static ErrorId StreamFieldValueError;
static ErrorId StreamViewGenAtChangeSkip;
+ static ErrorId DepotTraitDup;
+ static ErrorId NoTraitDepot;
+
+ static ErrorId ComponentStreamInvalidSparse;
+ static ErrorId NoReparentSparse;
+ static ErrorId NoSparseChildren;
+ static ErrorId NoStreamTypeChangeToNonSparse;
+ static ErrorId NoStreamTypeChangeToSparse;
+ static ErrorId NoVirtualParentSparseChild;
+ static ErrorId SparseStreamCmdChangeSpecifierOnly;
+ static ErrorId SparseStreamCmdMustIncludeAll;
+ static ErrorId SparseStreamCmdMustIncludeAll2;
+ static ErrorId SparseStreamCmdWrongStream;
+ static ErrorId SparseStreamCmdNoRevRange;
+ static ErrorId SparseStreamCopyOutOfDate;
+ static ErrorId SparseStreamCopyLatestOnly;
+ static ErrorId SparseStreamNoPin;
+ static ErrorId SparseStreamNotSupported;
+ static ErrorId SparseStreamOpNotAllowed;
+ static ErrorId SparseStreamPinChangeDown;
+ static ErrorId SparseStreamPinChangeUp;
+ static ErrorId SparseStreamPinUpdate;
+ static ErrorId VirtChildSparseParentOpNotAllowed;
+ static ErrorId UnsubmitNoStreamSpec;
+ static ErrorId NoTopologyActiveRec;
+
+ static ErrorId OnlyOneClientReload;
+ static ErrorId UnknownParam;
+ static ErrorId BadS3Mode;
+ static ErrorId DepotBadAddress;
+ static ErrorId DepotBadRemoteAddress;
+ static ErrorId NoConfigHistory;
+ static ErrorId SyncToRemove;
+ static ErrorId DomainNoViewCmtClientBadSave;
+ static ErrorId ConfigNotFound;
+
+ static ErrorId ChunkMapFormat;
+ static ErrorId SparseStreamNoCreateMaxCommit0;
+ static ErrorId SparseStreamNoUnshelvePinLower;
+ static ErrorId UpgradeToCreatePJnlClient;
+ static ErrorId DbBodTextCxEntryMissing;
+ static ErrorId StreamSpecIntegrationNoFrmChange;
+
+ // Retired ErrorIds. We need to keep these so that clients
+ // built with newer apis can commnunicate with older servers
+ // still sending these.
+
+ static ErrorId NoPartitionedToReadonly; // DEPRECATED
} ;
diff --git a/P4Plugin/Source/p4api/include/p4/msggraph.h b/P4Plugin/Source/p4api/include/p4/msggraph.h
index 449b99a..4da8c51 100644
--- a/P4Plugin/Source/p4api/include/p4/msggraph.h
+++ b/P4Plugin/Source/p4api/include/p4/msggraph.h
@@ -375,6 +375,8 @@ class MsgGraph {
static ErrorId RefcntInProgress;
static ErrorId NoOrphanedObj;
static ErrorId ObjectRecNotFound;
+ static ErrorId RefCntAdjustNotFound;
+
// Retired ErrorIds. We need to keep these so that clients
// built with newer apis can commnunicate with older servers
// still sending these.
diff --git a/P4Plugin/Source/p4api/include/p4/msghelp.h b/P4Plugin/Source/p4api/include/p4/msghelp.h
index e535544..f375198 100644
--- a/P4Plugin/Source/p4api/include/p4/msghelp.h
+++ b/P4Plugin/Source/p4api/include/p4/msghelp.h
@@ -35,6 +35,7 @@ class MsgHelp {
static ErrorId HelpAnnotate;
static ErrorId HelpAdmin;
static ErrorId HelpAdministration;
+ static ErrorId HelpAdminResourceMonitor;
static ErrorId HelpArchive;
static ErrorId HelpAttribute;
static ErrorId HelpBackup;
@@ -52,7 +53,6 @@ class MsgHelp {
static ErrorId HelpConfigure;
static ErrorId HelpConfigurables;
static ErrorId HelpCopy;
- static ErrorId HelpCopyshelf;
static ErrorId HelpCounter;
static ErrorId HelpCounters;
static ErrorId HelpCstat;
@@ -78,6 +78,8 @@ class MsgHelp {
static ErrorId HelpExtension;
static ErrorId HelpClientExtensionIntro;
static ErrorId HelpServerExtensionIntro;
+ static ErrorId HelpFailback;
+ static ErrorId HelpFailbackintro;
static ErrorId HelpFailover;
static ErrorId HelpFiles;
static ErrorId HelpFilelog;
@@ -156,6 +158,7 @@ class MsgHelp {
static ErrorId HelpRemote;
static ErrorId HelpRemotes;
static ErrorId HelpRename;
+ static ErrorId HelpRenameClient;
static ErrorId HelpRenameUser;
static ErrorId HelpReconcile;
static ErrorId HelpReopen;
@@ -178,6 +181,7 @@ class MsgHelp {
static ErrorId HelpSearch;
static ErrorId HelpServer;
static ErrorId HelpServerid;
+ static ErrorId HelpServerResources;
static ErrorId HelpServers;
static ErrorId HelpSet;
static ErrorId HelpShelve;
diff --git a/P4Plugin/Source/p4api/include/p4/msglbr.h b/P4Plugin/Source/p4api/include/p4/msglbr.h
index 684adb5..bccfdba 100644
--- a/P4Plugin/Source/p4api/include/p4/msglbr.h
+++ b/P4Plugin/Source/p4api/include/p4/msglbr.h
@@ -45,13 +45,12 @@ class MsgLbr {
static ErrorId RevLess;
static ErrorId TooBig;
static ErrorId RcsTooBig;
- static ErrorId FmtLbrStat;
- static ErrorId FmtLbrStat2;
static ErrorId FmtLbrStat3;
static ErrorId FmtLbrStat4;
static ErrorId FmtLbrStat5;
static ErrorId LbrOpenFail;
static ErrorId AlreadyOpen;
+ static ErrorId NotOpen;
static ErrorId BadKeyword;
static ErrorId KeywordUnterminated;
static ErrorId ObjectReadError;
@@ -59,8 +58,21 @@ class MsgLbr {
static ErrorId LbrTypeInsane;
static ErrorId LbrTrackInsane;
+ static ErrorId S3UploadFailed;
+ static ErrorId S3DownloadFailed;
+ static ErrorId S3CopyFailed;
+ static ErrorId S3StatFailed;
+ static ErrorId S3DeleteFailed;
+ static ErrorId S3UnsupportedOpen;
+ static ErrorId S3LbrLockLoop;
+
+ static ErrorId ChunkingCreateNewLbr;
+
+
// Retired ErrorIds. We need to keep these so that clients
// built with newer apis can commnunicate with older servers
// still sending these.
+ static ErrorId FmtLbrStat;
+ static ErrorId FmtLbrStat2;
} ;
diff --git a/P4Plugin/Source/p4api/include/p4/msgos.h b/P4Plugin/Source/p4api/include/p4/msgos.h
index 408b579..b386a64 100644
--- a/P4Plugin/Source/p4api/include/p4/msgos.h
+++ b/P4Plugin/Source/p4api/include/p4/msgos.h
@@ -42,6 +42,9 @@ class MsgOs {
static ErrorId ZlibDeflateInit;
static ErrorId ZlibInflateInitSeek;
+ static ErrorId NoAtomicRename;
+ static ErrorId AtomicRenameFailed;
+
// Retired ErrorIds. We need to keep these so that clients
// built with newer apis can commnunicate with older servers
// still sending these.
diff --git a/P4Plugin/Source/p4api/include/p4/msgrpc.h b/P4Plugin/Source/p4api/include/p4/msgrpc.h
index df02f92..cb14cc7 100644
--- a/P4Plugin/Source/p4api/include/p4/msgrpc.h
+++ b/P4Plugin/Source/p4api/include/p4/msgrpc.h
@@ -40,7 +40,12 @@ class MsgRpc {
static ErrorId NameResolve;
static ErrorId SslAccept;
+ static ErrorId SslAcceptFailed;
+ static ErrorId SslAcceptTimeout;
static ErrorId SslConnect;
+ static ErrorId SslConnectFailed;
+ static ErrorId SslConnectTimeout;
+ static ErrorId SslCloseEOF;
static ErrorId SslListen;
static ErrorId SslRecv;
static ErrorId SslSend;
diff --git a/P4Plugin/Source/p4api/include/p4/msgserver2.h b/P4Plugin/Source/p4api/include/p4/msgserver2.h
index 5e6e716..e6866dc 100644
--- a/P4Plugin/Source/p4api/include/p4/msgserver2.h
+++ b/P4Plugin/Source/p4api/include/p4/msgserver2.h
@@ -40,6 +40,10 @@ class MsgServer2 {
static ErrorId FailoverUnCfgCommit;
static ErrorId FailoverDetails;
static ErrorId FailoverNeedYOK;
+ static ErrorId FailoverWriteFConfigs;
+ static ErrorId FailoverDeleteFConfigs;
+ static ErrorId FailoverFConfigsBad;
+ static ErrorId FailoverFBackOldWarn;
static ErrorId ServerIDReused;
static ErrorId StorageRestoreDigest;
static ErrorId xuUpstream;
@@ -185,9 +189,126 @@ class MsgServer2 {
static ErrorId UseStreams2;
static ErrorId UnknownContext;
static ErrorId RplTooBig;
+ static ErrorId RplReduced;
+ static ErrorId FailbackStandbyRestrict;
+ static ErrorId UseP4dF;
+ static ErrorId P4dFBadMaster;
+ static ErrorId P4dFRefuseMissing;
+ static ErrorId P4dFFConfigsMissing;
+ static ErrorId P4dFStandbyNotStandby;
+ static ErrorId P4dFBadRplFrom;
+ static ErrorId P4dFPreview;
+ static ErrorId P4dFStarting;
+ static ErrorId P4dFOK;
+ static ErrorId P4dFSuccess;
+ static ErrorId P4dFFailbackNotRun;
+ static ErrorId P4dFRestrictedStart;
static ErrorId IntegTaskNoDirect;
+ static ErrorId ExtraPxcIDUsage;
+ static ErrorId BadPxcExtraFlag;
+ static ErrorId FailbackWriteServerID;
+ static ErrorId UseFailback;
+ static ErrorId FailbackMasterTooOld;
+ static ErrorId FailbackFConfigsMissing;
+ static ErrorId UseFailoverB;
+ static ErrorId FailbackStandbyNotRestricted;
+ static ErrorId FailbackNeedsFm;
+ static ErrorId FailbackNeedsFs;
+ static ErrorId FailbackStandbyBad;
+ static ErrorId FailoverRunFailback;
static ErrorId LbrDeletionFailed;
+ static ErrorId ThreadMustBeNumeric;
+ static ErrorId ThreadBiggerMinusTwo;
+ static ErrorId NoStdoutPDump;
+ static ErrorId NoDirPDump;
+ static ErrorId BadJournalSubOpt;
+ static ErrorId LicenseExpiryWarning;
static ErrorId InfoProxyCacheRoot;
static ErrorId InfoProxyRoot;
static ErrorId UpgradeFeatureUnknown;
-};
+ static ErrorId NoParallelMflag;
+ static ErrorId NoParallelCflag;
+ static ErrorId NoParallelSflag;
+ static ErrorId BadRecoverDir;
+ static ErrorId BadRecoverFileName;
+ static ErrorId NoStorageMflag;
+ static ErrorId NoParallelSSflag;
+ static ErrorId SyncWStreamViewChange;
+ static ErrorId SyncWStreamViewHeadChange;
+ static ErrorId StreamAtChangeVsStreamViewChange;
+ static ErrorId UseRenameClient;
+ static ErrorId FromToSame;
+ static ErrorId ClientNotExist;
+ static ErrorId NewClientExists;
+ static ErrorId RenameClientUnloaded;
+ static ErrorId RenameClientPartitioned;
+ static ErrorId ClientOpenStream;
+ static ErrorId RenameNeedsMaster;
+ static ErrorId RenameNeedsCommit;
+ static ErrorId RenameNoPromoted;
+ static ErrorId ClientRenamed;
+ static ErrorId ClientNeedsRecover;
+ static ErrorId ClientRenameFailed;
+ static ErrorId ClientNotLocal;
+ static ErrorId RenameCommitOld;
+ static ErrorId UseRenameWorkspace;
+ static ErrorId MultiFilePara;
+ static ErrorId PasswordChangeSU;
+ static ErrorId RenameClientNotAllowed;
+ static ErrorId RenameClientAdminSuper;
+ static ErrorId RenameClientSuper;
+ static ErrorId RenameClientNotOwner;
+ static ErrorId PreserveChangeNumberConflict;
+ static ErrorId DistributionBlockSubmit;
+ static ErrorId DistributionServerOverrides;
+ static ErrorId MissingParallelFile;
+ static ErrorId AltSyncNoSupport;
+ static ErrorId AltSyncNotConfigured;
+ static ErrorId AltSyncNoVersion;
+ static ErrorId AltSyncBadVersion;
+ static ErrorId AltSyncActive;
+ static ErrorId UpgradeAuthDown;
+ static ErrorId UpgradeAuth;
+ static ErrorId UpgradeAuthNoLicense;
+ static ErrorId UpgradeAuthMaintenance;
+ static ErrorId UpgradeAuthRestricted;
+ static ErrorId LowResourceTerm;
+ static ErrorId ImpatientPauseTerm;
+ static ErrorId TooManyPausedTerm;
+ static ErrorId TooMuchResourceMonitor;
+ static ErrorId UseAdminResourceMonitor;
+ static ErrorId StartupCapabilities;
+ static ErrorId BadPressureThresholds;
+ static ErrorId PopulateSparseStreamDesc;
+ static ErrorId NonResidentOpenMustSync;
+ static ErrorId BadJField;
+ static ErrorId TooManySparseStreamFiles;
+ static ErrorId TraitDepotNotConfigured;
+ static ErrorId TraitDepotNotForCommit;
+ static ErrorId NoValidIPOrMACAddresses;
+ static ErrorId ValidIPv4Address;
+ static ErrorId ValidIPv6Address;
+ static ErrorId ValidMACAddress;
+ static ErrorId NoTraitValueInDepot;
+ static ErrorId AttributeNoWild;
+ static ErrorId AttributeNotFound;
+ static ErrorId AttributeFileEmpty;
+ static ErrorId UseTraitI;
+ static ErrorId Types64Warn;
+ static ErrorId Types64Err;
+ static ErrorId ConfigureSetComment;
+ static ErrorId ProxyClearCacheNotSet;
+ static ErrorId StreamMustBeSparse;
+ static ErrorId InvalidDestStreamType;
+ static ErrorId UseStreamConvertSparse;
+ static ErrorId ConfigureMandatoryComment;
+ static ErrorId NoJournalRotateWarning;
+ static ErrorId CommitVerifyNoExternalAddress;
+ static ErrorId SwitchStreamFailedReconcile;
+ static ErrorId MissingConfigDbFile;
+ static ErrorId MissingPcdir;
+ static ErrorId NoStreamSpecEditStreamAtChangeClient;
+ static ErrorId NoStreamSpecUnshelveStreamAtChangeClient;
+ static ErrorId SparseStreamOperationNotAllowed;
+ static ErrorId MustSetPasswordRequireSU;
+} ;
diff --git a/P4Plugin/Source/p4api/include/p4/msgsupp.h b/P4Plugin/Source/p4api/include/p4/msgsupp.h
index af96242..b7c3252 100644
--- a/P4Plugin/Source/p4api/include/p4/msgsupp.h
+++ b/P4Plugin/Source/p4api/include/p4/msgsupp.h
@@ -18,6 +18,7 @@ class MsgSupp {
static ErrorId InvalidCharset;
static ErrorId TooMany;
+ static ErrorId MissingCmd;
static ErrorId Invalid;
static ErrorId NeedsArg;
static ErrorId Needs2Arg;
@@ -51,6 +52,7 @@ class MsgSupp {
static ErrorId Inflate;
static ErrorId InflateInit;
static ErrorId MagicHeader;
+ static ErrorId DigestInitFailed;
static ErrorId RegexError;
@@ -127,6 +129,7 @@ class MsgSupp {
static ErrorId OptionUnloadLimit;
static ErrorId OptionOmitLazy;
static ErrorId OptionLeaveKeywords;
+ static ErrorId OptionLeaveKeywords2;
static ErrorId OptionOutputFile;
static ErrorId OptionExists;
static ErrorId OptionContent;
@@ -356,6 +359,10 @@ class MsgSupp {
static ErrorId OptionFailoverid;
static ErrorId OptionFailoverQuiesce;
static ErrorId OptionFailoverVerification;
+ static ErrorId OptionFailbackYes;
+ static ErrorId OptionFailbackQuiesce;
+ static ErrorId OptionPreFailback;
+ static ErrorId OptionPostFailback;
static ErrorId OptionInstall;
static ErrorId OptionCreateSampleExt;
static ErrorId OptionUndo;
@@ -398,11 +405,17 @@ class MsgSupp {
static ErrorId JsmnBadSyn;
static ErrorId JsmnTooFew;
static ErrorId JsmnKeyNotFound;
+
static ErrorId ManifestKeyNotFound;
static ErrorId ManifestValueEmpty;
static ErrorId ManifestValueTypeInvalid;
static ErrorId ManifestParseError;
static ErrorId InvalidIntegerRange;
+
+ static ErrorId CurlPerformFailed;
+ static ErrorId AwsRejected;
+ static ErrorId XmlParseFailed;
+
static ErrorId FatalLockError;
static ErrorId MissingKeyCert;
static ErrorId InternalSSLerror;
@@ -418,6 +431,41 @@ class MsgSupp {
static ErrorId RenameDirNotEmpty;
static ErrorId OptionCleanPurge;
static ErrorId OptionViewMatch;
+ static ErrorId OptionObliterate;
+ static ErrorId OptionOffset;
+ static ErrorId OptionSize;
+ static ErrorId OptionCompressed;
+ static ErrorId OptionStreamViews;
+ static ErrorId OptionUseStreamChange;
+ static ErrorId OptionHasStream;
+ static ErrorId OptionNoStream;
+ static ErrorId OptionPreserveChangeNumbers;
+ static ErrorId OptionLimit;
+ static ErrorId OptionType;
+ static ErrorId OptionResult;
+ static ErrorId OptionJNum;
+ static ErrorId OptionJField;
+ static ErrorId OptionIntervalMillis;
+ static ErrorId OptionThreshold;
+ static ErrorId OptionDatedEarlier;
+ static ErrorId OptionDeleteMarker;
+ static ErrorId OptionDeletePurge;
+ static ErrorId OptionMoveTopology;
+ static ErrorId OptionServerAddress;
+ static ErrorId OptionServerID;
+ static ErrorId OptionTargetAddress;
+ static ErrorId OptionNewServerAddress;
+ static ErrorId OptionNewServerID;
+ static ErrorId OptionNewTargetAddress;
+ static ErrorId OptionCreationDate;
+ static ErrorId OptionLastSeenDate;
+ static ErrorId OptionTraitStorage;
+ static ErrorId OptionIteration;
+ static ErrorId OptionListAddresses;
+ static ErrorId OptionTrait;
+ static ErrorId OptionTraitFile;
+
+ static ErrorId AmbiguousArgs;
// Retired ErrorIds. We need to keep these so that clients
// built with newer apis can commnunicate with older servers
diff --git a/P4Plugin/Source/p4api/include/p4/netbuffer.h b/P4Plugin/Source/p4api/include/p4/netbuffer.h
index 372ee4d..b9b5a6a 100644
--- a/P4Plugin/Source/p4api/include/p4/netbuffer.h
+++ b/P4Plugin/Source/p4api/include/p4/netbuffer.h
@@ -111,6 +111,7 @@ class NetBuffer : public NetTransport {
void Flush( Error *e ) { Flush( e, e ); }
+ void Shutdown( Error *e ) { Shutdown( e, e ); }
void Close()
{ transport->Close(); }
@@ -137,6 +138,7 @@ class NetBuffer : public NetTransport {
int Receive( char *buf, int len, Error *re, Error *se );
void Send( const char *buf, int len, Error *re, Error *se );
void Flush( Error *re, Error *se );
+ void Shutdown( Error *re, Error *se );
int Fill( Error *re, Error *se );
void SetBufferSizes( int recvSize, int sendSize );
diff --git a/P4Plugin/Source/p4api/include/p4/netconnect.h b/P4Plugin/Source/p4api/include/p4/netconnect.h
index 38770f6..ddebb9a 100644
--- a/P4Plugin/Source/p4api/include/p4/netconnect.h
+++ b/P4Plugin/Source/p4api/include/p4/netconnect.h
@@ -146,6 +146,9 @@ class NetTransport : public KeepAlive {
virtual void SetBreak( KeepAlive *breakCallback ) = 0;
virtual int GetSendBuffering() = 0;
virtual int GetRecvBuffering() = 0;
+ virtual void Shutdown( Error *re, Error *se)
+ {
+ }
virtual void GetEncryptionType(StrBuf &value)
{
value.Clear();
diff --git a/P4Plugin/Source/p4api/include/p4/options.h b/P4Plugin/Source/p4api/include/p4/options.h
index b371cb6..551ff50 100644
--- a/P4Plugin/Source/p4api/include/p4/options.h
+++ b/P4Plugin/Source/p4api/include/p4/options.h
@@ -141,6 +141,7 @@ class Options
LabelName , // list -l
RunOnMaster , // list -M
LeaveKeywords , // print -k
+ LeaveKeywords2 , // sync -K, revert -K, integ -K...
OutputFile , // print -o
Content , // filelog -h
OmitPromoted , // filelog -p
@@ -232,6 +233,8 @@ class Options
Name , // attribute -n, property -n
Value , // attribute -v, property -v
Propagating , // attribute -p
+ Storage , // attribute -T
+ TraitFile , // attribute -I
OpenAdd , // reconcile -a
OpenEdit , // reconcile -e
OpenDelete , // reconcile -d
@@ -299,6 +302,8 @@ class Options
ForceFailover , // failover -F
IgnoreMaster , // failover -i
RequireMaster , // failover -m
+ FailbackYes , // failback -y
+ FailbackQuiesce, // failback -w
FailoverYes , // failover -y
Failoverid , // failover -s
FailoverQuiesce, // failover -w
@@ -313,14 +318,30 @@ class Options
MissingCount , // heartbeat -c
LocalLicense , // license -u -l
AutoReload , // labels -R
+ IntervalMillis , // --interval-ms | -I
+ Threshold , // topology -t
+ DatedEarlier , // topology -e
+ DeleteMarker , // topology -d
+ DeletePurge , // topology -D
+ MoveTopology , // topology -m
+ ServerAddress , // topology -s
+ ServerID , // topology -i
+ TargetAddress , // topology -p
+ NewServerAddress, // topology -S
+ NewServerID , // topology -I
+ NewTargetAddress, // topology -P
+ CreationDate , // topology -c
+ LastSeenDate , // topology -l
+ ListAddresses , // license -L
+ Trait , // print -T
// options which have only long-form option names go here:
LongFormOnlyOptions = 2000,
NoRejournal , // pull --no-rejournal
- From , // renameuser --from
- To , // renameuser --to
+ From , // renameuser or renameclient --from
+ To , // renameuser or renameclient --to
Parallel , // sync --parallel
ParallelSubmit , // submit --parallel
InputFile , // reload --input-file
@@ -380,6 +401,7 @@ class Options
Script , // --script
ScriptMaxMem , // --script-MaxMem
ScriptMaxTime , // --script-MaxTime
+ ScriptEnableDbg, // --script-enable-debug
Path , // --path (extension)
NoSync , // --no-sync
NoScript , // --no-script
@@ -404,6 +426,25 @@ class Options
ShowRealtime , // --show-realtime
CleanPurge , // --purged-only
ViewMatch , // --viewmatch
+ Obliterate , // stream --obliterate
+ Offset , // print --offset
+ Size , // print --size
+ Compressed , // verify --compressed=0/1
+ PreFailback , // p4d --pre-failback
+ PostFailback , // p4d --post-failback
+ StreamViews , // --streamviews
+ UseStreamChange , // --use-stream-change
+ HasStream , // --stream
+ NoStream , // --nostream
+ PreserveChangeNumbers, // --preserve-change-numbers
+ Limit , // --limit #
+ Type , // --type checkpoint|dump....
+ Result , // --result pass|fail
+ JNum , // --num #
+ JField , // --jfield f1,f2,f3
+ ControlTweaks , // --control-tweaks
+ CachePurge , // --cache-purge (p4p)
+ Iteration , // --iteration
#ifdef _DEBUG
DebugBreak, // --debugbreak
#endif
@@ -445,6 +486,8 @@ class Options
static int FindCode( const int code, Error *e );
static int GetShortForm( const int ilist, Error *e );
static const char * GetLongForm( const int ilist, Error *e );
+ void Discard( int opt, char flag2 = 0, int subopt = 0 );
+ void Dump( StrPtr * );
private:
int optc;
diff --git a/P4Plugin/Source/p4api/include/p4/p4libs.h b/P4Plugin/Source/p4api/include/p4/p4libs.h
index 44bed11..fbb7ab8 100644
--- a/P4Plugin/Source/p4api/include/p4/p4libs.h
+++ b/P4Plugin/Source/p4api/include/p4/p4libs.h
@@ -59,13 +59,11 @@ class P4Libraries
static void Initialize( const int libraries, Error* e );
static void Shutdown( const int libraries, Error* e );
- static void DisableZlibOptimization();
- static void DisableFileSysCreateOnIntr();
- static void EnableFileSysCreateOnIntr();
- // Note that these are internal routines for Perforce products
- // and are not necessary to call for general P4API use.
static void InitializeThread( const int libraries, Error* e );
static void ShutdownThread( const int libraries, Error* e );
+ static void DisableZlibOptimization();
+ static void DisableFileSysCreateOnIntr();
+ static void EnableFileSysCreateOnIntr();
};
diff --git a/P4Plugin/Source/p4api/include/p4/p4tags.h b/P4Plugin/Source/p4api/include/p4/p4tags.h
index 5b860bb..d7450a2 100644
--- a/P4Plugin/Source/p4api/include/p4/p4tags.h
+++ b/P4Plugin/Source/p4api/include/p4/p4tags.h
@@ -21,12 +21,14 @@ struct P4Tag {
static const char l_proxy[];
static const char l_server[];
static const char l_server2[];
+ static const char l_altSync[];
// client service methods
static const char c_Ack[];
static const char c_AckMatch[];
static const char c_ActionResolve[];
+ static const char c_AltSync[];
static const char c_CheckFile[];
static const char c_ReconcileEdit[];
static const char c_ChmodFile[];
@@ -71,6 +73,7 @@ struct P4Tag {
static const char c_WriteFile[];
static const char c_WriteMatch[];
static const char c_WriteMerge[];
+ static const char c_WriteVarPartial[];
// protocol service methods
@@ -89,6 +92,13 @@ struct P4Tag {
static const char v_actionOwner[];
static const char v_action[];
+ static const char v_add[];
+ static const char v_added[];
+ static const char v_agentProgram[];
+ static const char v_altSync[];
+ static const char v_altSyncResults[];
+ static const char v_altSyncVars[];
+ static const char v_altSyncVersion[];
static const char v_api[];
static const char v_app[];
static const char v_appliedJnl[];
@@ -97,9 +107,12 @@ struct P4Tag {
static const char v_associatedChange[];
static const char v_attack[];
static const char v_attr[];
+ static const char v_attrName[];
+ static const char v_attrStorage[];
static const char v_authServer[];
static const char v_autoLogin[];
static const char v_autoTune[];
+ static const char v_badAlloc[];
static const char v_baseName[];
static const char v_behindBytes[];
static const char v_behindJnls[];
@@ -118,21 +131,35 @@ struct P4Tag {
static const char v_changeImportedBy[];
static const char v_changeServer[];
static const char v_changeType[];
+ static const char v_changeView[];
static const char v_charset[];
+ static const char v_check[];
+ static const char v_checkFile[];
static const char v_checkpoint[];
static const char v_checkLinks[];
static const char v_checkLinksN[];
+ static const char v_chmod[];
+ static const char v_chunking[];
+ static const char v_chunkMap[];
+ static const char v_chunkMapHandle[];
+ static const char v_chunkWrite[];
+ static const char v_chunkMapWrite[];
+ static const char v_chunkToken[];
static const char v_clientAddress[];
static const char v_clientCase[];
static const char v_clientCwd[];
+ static const char v_clientDepotFile[];
+ static const char v_clientDepotRev[];
static const char v_clientFile[];
static const char v_clientHost[];
static const char v_clientName[];
static const char v_clientRoot[];
+ static const char v_clientStatsFunc[];
static const char v_clientStream[];
static const char v_client[];
static const char v_cmpfile[];
static const char v_code[];
+ static const char v_commandGroup[];
static const char v_commit[];
static const char v_commitAuthor[];
static const char v_commitAuthorEmail[];
@@ -142,6 +169,7 @@ struct P4Tag {
static const char v_committerDate[];
static const char v_compare[];
static const char v_compCksum[];
+ static const char v_componentDir[];
static const char v_configurableName[];
static const char v_configurableValue[];
static const char v_configurables[];
@@ -149,8 +177,10 @@ struct P4Tag {
static const char v_conflict[];
static const char v_copied[];
static const char v_cumulative[];
+ static const char v_count[];
static const char v_counter[];
static const char v_laddr[];
+ static const char v_compression[];
static const char v_current[];
static const char v_cwd[];
static const char v_daddr[];
@@ -159,6 +189,8 @@ struct P4Tag {
static const char v_date[];
static const char v_dbstat[];
static const char v_decline[];
+ static const char v_depotChange[];
+ static const char v_depotRev[];
static const char v_depotTime[];
static const char v_desc[];
static const char v_descKey[]; // original CL#
@@ -172,6 +204,7 @@ struct P4Tag {
static const char v_digestTypeSHA256[];
static const char v_dir[];
static const char v_disabled[];
+ static const char v_effectiveComponentType[];
static const char v_enableStreams[];
static const char v_enableGraph[];
static const char v_endFromChange[];
@@ -179,19 +212,23 @@ struct P4Tag {
static const char v_endToChange[];
static const char v_endToRev[];
static const char v_erev[];
+ static const char v_executable[];
static const char v_expandAndmaps[];
static const char v_extensionsEnabled[];
static const char v_externalAuth[];
static const char v_extraTag[];
static const char v_extraTagType[];
static const char v_failoverSeen[];
+ static const char v_false[];
static const char v_fatal[];
static const char v_field[];
static const char v_fileCount[];
static const char v_fileNum[];
static const char v_fileSize[];
+ static const char v_fileType[];
static const char v_file[];
static const char v_filter[];
+ static const char v_flushHard[];
static const char v_fmt[];
static const char v_forceType[];
static const char v_fromFile[];
@@ -205,6 +242,8 @@ struct P4Tag {
static const char v_func[];
static const char v_func2[];
static const char v_handle[];
+ static const char v_hash[];
+ static const char v_hashType[];
static const char v_haveRev[];
static const char v_headAction[];
static const char v_headChange[];
@@ -214,29 +253,40 @@ struct P4Tag {
static const char v_headRev[];
static const char v_headTime[];
static const char v_headType[];
+ static const char v_hidden[];
static const char v_himark[];
static const char v_host[];
static const char v_how[];
static const char v_ignore[];
static const char v_initroot[];
+ static const char v_interface[];
+ static const char v_ipv4Address[];
+ static const char v_ipv6Address[];
static const char v_isgroup[];
+ static const char v_isMapped[];
+ static const char v_isSparse[];
+ static const char v_isTask[];
static const char v_journalcopyFlags[];
static const char v_job[];
static const char v_jobstat[];
static const char v_jnlBatchSize[];
static const char v_journal[];
static const char v_key[];
+ static const char v_keywords[];
static const char v_language[];
+ static const char v_lazyCopyFile[];
+ static const char v_lazyCopyRev[];
static const char v_lbrFile[]; // also remote depot
- static const char v_lbrChange[];
+ static const char v_lbrChange[];
+ static const char v_lbrIsLazy[];
static const char v_lbrPath[];
+ static const char v_lbrRefCount[];
static const char v_lbrRelPath[];
static const char v_lbrRelTo[];
static const char v_lbrRelToPath[];
+ static const char v_lbrReplication[];
static const char v_lbrRev[]; // also remote depot
static const char v_lbrType[]; // also remote depot
- static const char v_lbrRefCount[];
- static const char v_lbrReplication[];
static const char v_leof_num[];
static const char v_leof_sequence[];
static const char v_ldap[];
@@ -244,18 +294,22 @@ struct P4Tag {
static const char v_level[];
static const char v_lfmt[];
static const char v_line[];
+ static const char v_lineEnd[];
static const char v_locale[];
static const char v_lower[];
static const char v_lockGlobal[];
static const char v_lockId[];
static const char v_lockOnCommit[];
static const char v_lockStatus[];
+ static const char v_macAddress[];
static const char v_mangle[];
static const char v_matchedLine[];
static const char v_matchBegin[];
static const char v_matchEnd[];
static const char v_maxLockTime[];
static const char v_maxOpenFiles[];
+ static const char v_maxPauseTime[];
+ static const char v_maxMem[];
static const char v_maxResults[];
static const char v_maxScanRows[];
static const char v_maxValue[];
@@ -267,6 +321,7 @@ struct P4Tag {
static const char v_minClient[];
static const char v_mode[];
static const char v_monitor[];
+ static const char v_move[];
static const char v_name[];
static const char v_newServerId[];
static const char v_noBase[];
@@ -274,6 +329,7 @@ struct P4Tag {
static const char v_noclobber[];
static const char v_noecho[];
static const char v_noneFound[];
+ static const char v_nonsequential[];
static const char v_noprompt[];
static const char v_offset[];
static const char v_oid[];
@@ -289,9 +345,12 @@ struct P4Tag {
static const char v_ourLock[];
static const char v_packName[];
static const char v_parent[];
+ static const char v_passFunc[];
static const char v_password[];
static const char v_path[];
static const char v_path2[];
+ static const char v_pathSource[];
+ static const char v_pathType[];
static const char v_peeking[];
static const char v_perm[];
static const char v_permmax[];
@@ -336,6 +395,8 @@ struct P4Tag {
static const char v_rMoveReaddIntegConflictSkip[];
static const char v_rcvbuf[];
static const char v_reason[];
+ static const char v_recvFileBytes[];
+ static const char v_recvFileCount[];
static const char v_ref[];
static const char v_remap[];
static const char v_remoteFunc[];
@@ -346,7 +407,13 @@ struct P4Tag {
static const char v_repoName[];
static const char v_reresolvable[];
static const char v_resolved[];
+ static const char v_resolveAction[];
+ static const char v_resolveBaseFile[];
+ static const char v_resolveBaseRev[];
+ static const char v_resolveEndFromRev[];
static const char v_resolveFlag[];
+ static const char v_resolveFromFile[];
+ static const char v_resolveStartFromRev[];
static const char v_resolveType[];
static const char v_rev[];
static const char v_rev2[];
@@ -359,6 +426,8 @@ struct P4Tag {
static const char v_scope[];
static const char v_secondFactor[];
static const char v_security[];
+ static const char v_sendFileBytes[];
+ static const char v_sendFileCount[];
static const char v_skipped[];
static const char v_snapped[];
static const char v_sndbuf[];
@@ -400,11 +469,16 @@ struct P4Tag {
static const char v_stat[];
static const char v_status[];
static const char v_svrname[];
+ static const char v_svrRecType[];
+ static const char v_symlink[];
static const char v_symref[];
static const char v_tableexcludelist[];
static const char v_tag[];
static const char v_tagJnl[];
+ static const char v_targetAddr[];
+ static const char v_targetDestAddr[];
static const char v_targetSha[];
+ static const char v_targetSvrID[];
static const char v_targetType[];
static const char v_theirName[];
static const char v_theirTime[];
@@ -419,6 +493,7 @@ struct P4Tag {
static const char v_track[];
static const char v_trans[];
static const char v_tree[];
+ static const char v_true[];
static const char v_truncate[];
static const char v_type[];
static const char v_type2[];
@@ -433,6 +508,7 @@ struct P4Tag {
static const char v_user[];
static const char v_userChanged[];
static const char v_userName[];
+ static const char v_utf8bom[];
static const char v_version[];
static const char v_warning[];
static const char v_wingui[];
@@ -460,6 +536,7 @@ struct P4Tag {
static const char v_baseDepotRec[]; // p4 resolve
static const char v_changeNo[]; // p4 submit
static const char v_checkSum[]; // p4 submit
+ static const char v_checkTooFar[]; // auth license check
static const char v_clientEntity[];
static const char v_confirm2[];
static const char v_dataHandle[];
@@ -493,9 +570,12 @@ struct P4Tag {
static const char v_movedRev[];
static const char v_needsFlushTransport[];
static const char v_noretry[]; // p4 specs
+ static const char v_pathPermissions[]; // readonly or writable status
static const char v_peer[];
static const char v_peerAddress[];
+ static const char v_preserveCNums[];
static const char v_propigate[]; // proxy chaining test
+ static const char v_readonly[];
static const char v_remoteFetch[]; // no on-demand fetch bg submit
static const char v_reopen[]; // submit
static const char v_replace[]; // shelve
@@ -513,13 +593,18 @@ struct P4Tag {
static const char v_shelvedStream[]; // stream is shelved
static const char v_state[];
static const char v_stream[]; // stream name
+ static const char v_streamDir[];
+ static const char v_streamFile[];
static const char v_stream2[]; // other stream name
+ static const char v_streamViewChange[]; // stream view change used
+ static const char v_submitted[];
static const char v_table[]; // remote depot
static const char v_traitCount[]; // submit
static const char v_tzoffset[]; // server tz offset for proxy
static const char v_output[]; // proxy print kind
static const char v_unloadInterval[]; // unused client unload interval
static const char v_value[]; // p4 index
+ static const char v_writable[];
static const char v_workRec[];
static const char v_workRec2[];
static const char v_workGRec[];
@@ -536,6 +621,7 @@ struct P4Tag {
static const char u_changes[];
static const char u_client[];
static const char u_clients[];
+ static const char u_copy[];
static const char u_counter[];
static const char u_counters[];
static const char u_delete[];
@@ -561,6 +647,7 @@ struct P4Tag {
static const char u_info[];
static const char u_integrate[];
static const char u_integrated[];
+ static const char u_interchanges[];
static const char u_job[];
static const char u_jobs[];
static const char u_jobspec[];
@@ -568,6 +655,7 @@ struct P4Tag {
static const char u_labels[];
static const char u_labelsync[];
static const char u_lock[];
+ static const char u_merge[];
static const char u_obliterate[];
static const char u_opened[];
static const char u_passwd[];
diff --git a/P4Plugin/Source/p4api/include/p4/pathsys.h b/P4Plugin/Source/p4api/include/p4/pathsys.h
index da5cce9..afacc5e 100644
--- a/P4Plugin/Source/p4api/include/p4/pathsys.h
+++ b/P4Plugin/Source/p4api/include/p4/pathsys.h
@@ -41,22 +41,7 @@
# include
class PathSys;
-
-// Specialization to the std::default_delete template class so we can store
-// a std::unique_pointer to the PathSys* returned from PathSys::Create without
-// having to know which inherited class it's actually using and without having
-// to use a custom deleter everywhere.
-
-namespace std
-{
- template<> class default_delete< PathSys* >
- {
- public:
- void operator()( PathSys **ptr );
- };
-}
-
-using PathSysUPtr = std::unique_ptr< PathSys* >;
+using PathSysUPtr = std::unique_ptr< PathSys >;
# endif
diff --git a/P4Plugin/Source/p4api/include/p4/runcmd.h b/P4Plugin/Source/p4api/include/p4/runcmd.h
index 14fa782..016c333 100644
--- a/P4Plugin/Source/p4api/include/p4/runcmd.h
+++ b/P4Plugin/Source/p4api/include/p4/runcmd.h
@@ -222,8 +222,10 @@ class RunCommandIo : public RunCommand {
int Read( const StrPtr &out, Error *e );
StrPtr *ReadError( Error *e );
+ int ReadLine( StrBuf &out, StrBuf &buf, Error *e );
+
private:
- int Read( char *buf, int length, Error *e );
+ int Read( char *buf, int length, Error *e, int closeIn = 1 );
int fds[2];
StrBuf errBuf;
diff --git a/P4Plugin/Source/p4api/include/p4/sanitizers.h b/P4Plugin/Source/p4api/include/p4/sanitizers.h
index 5e3a378..67cda5d 100644
--- a/P4Plugin/Source/p4api/include/p4/sanitizers.h
+++ b/P4Plugin/Source/p4api/include/p4/sanitizers.h
@@ -7,25 +7,34 @@
# ifndef P4SANITIZERS_H
# define P4SANITIZERS_H
-// NO-OP definitions
-# define NO_SANITIZE_ADDRESS_UNDEFINED
-# define NO_SANITIZE_ADDRESS
-# define NO_SANITIZE_UNDEFINED
-
-# ifdef __has_feature
// There's no feature test for UBSAN, so assume that if we've got one,
// we've got the other.
+
+// Clang.
+# if defined(__has_feature)
# if __has_feature(address_sanitizer)
-# undef NO_SANITIZE_ADDRESS_UNDEFINED
-# undef NO_SANITIZE_ADDRESS
-# undef NO_SANITIZE_UNDEFINED
+# define CAN_SANITIZE
+# endif
+# endif
+
+// GCC
+# if defined(__GNUG__) && defined(__SANITIZE_ADDRESS__)
+# define CAN_SANITIZE
+# endif
+
+# ifdef CAN_SANITIZE
+# undef CAN_SANITIZE
// Note that it's possible to specify specific parts of the sanitizers to disable,
// so if a function is only offending a particular check, we can disable them
// more selectively if necessary.
# define NO_SANITIZE_ADDRESS_UNDEFINED __attribute__((no_sanitize("address","undefined")))
# define NO_SANITIZE_ADDRESS __attribute__((no_sanitize("address")))
# define NO_SANITIZE_UNDEFINED __attribute__((no_sanitize("undefined")))
-# endif
-# endif
+# else
+// NO-OP definitions
+# define NO_SANITIZE_ADDRESS_UNDEFINED
+# define NO_SANITIZE_ADDRESS
+# define NO_SANITIZE_UNDEFINED
+# endif // CAN_SANITIZE
# endif // P4SANITIZERS_H
diff --git a/P4Plugin/Source/p4api/include/p4/sha1.h b/P4Plugin/Source/p4api/include/p4/sha1.h
index fbe4bde..f08a40c 100644
--- a/P4Plugin/Source/p4api/include/p4/sha1.h
+++ b/P4Plugin/Source/p4api/include/p4/sha1.h
@@ -53,6 +53,7 @@ class Sha1Digester
public:
Sha1Digester();
+ Sha1Digester( Error *e );
~Sha1Digester();
void Update( const StrPtr &buf );
void Final( StrBuf &output );
@@ -60,6 +61,7 @@ class Sha1Digester
void Final( Sha1 &sha );
private:
+ void Init( Error *e );
void *ctx;
};
diff --git a/P4Plugin/Source/p4api/include/p4/sha256.h b/P4Plugin/Source/p4api/include/p4/sha256.h
index 09feb09..9d0c631 100644
--- a/P4Plugin/Source/p4api/include/p4/sha256.h
+++ b/P4Plugin/Source/p4api/include/p4/sha256.h
@@ -53,6 +53,7 @@ class Sha256Digester
public:
Sha256Digester();
+ Sha256Digester( Error *e );
~Sha256Digester();
void Update( const StrPtr &buf );
void Final( StrBuf &output );
@@ -60,6 +61,7 @@ class Sha256Digester
void Final( Sha256 &sha );
private:
+ void Init( Error *e );
void *ctx;
};
diff --git a/P4Plugin/Source/p4api/include/p4/stdhdrs.h b/P4Plugin/Source/p4api/include/p4/stdhdrs.h
index 53d50d8..ebfffe1 100644
--- a/P4Plugin/Source/p4api/include/p4/stdhdrs.h
+++ b/P4Plugin/Source/p4api/include/p4/stdhdrs.h
@@ -1,6 +1,5 @@
/*
- * Copyright 1995, 1996 Perforce Software. All rights reserved.
- *
+ * Copyright 1995, 1996 Perforce Software. All rights reserved. *
* This file is part of Perforce - the FAST SCM System.
*/
@@ -32,6 +31,7 @@
# include
# include
# include
+# include // needed by datetime.h
# if !defined( OS_QNX ) && !defined( OS_VMS )
# include
@@ -77,6 +77,7 @@
* NEED_TYPES - off_t, etc (always set)
* NEED_UTIME - utime()
* NEED_WIN32FIO - Native Windows file I/O
+ * NEED_XATTRS - getxattr() setxattr()
*/
# if defined( NEED_ACCESS ) || \
@@ -353,6 +354,10 @@ extern "C" int __stdcall gethostname( char * name, int namelen );
# include
+# ifdef OS_LINUX
+# include
+# endif
+
# ifndef S_ISLNK /* NCR */
# define S_ISLNK(m) (((m)&S_IFMT)==S_IFLNK)
# endif
@@ -517,6 +522,10 @@ extern "C" int socketpair(int, int, int, int*);
# include
# endif
+# if defined(NEED_TIMER) && !defined(OS_NT)
+# include
+# endif
+
# if defined(NEED_TIME_HP)
# if defined( OS_LINUX )
# define HAVE_CLOCK_GETTIME
@@ -568,8 +577,8 @@ using namespace std;
# endif
# endif
-# define HAVE_UTIMES
# ifdef NEED_UTIMES
+# define HAVE_UTIMES
# if ( defined( OS_NT ) || defined( OS_OS2 ) ) && !defined(__BORLANDC__)
# include
# else
@@ -579,6 +588,13 @@ using namespace std;
# endif
# endif
+# ifdef NEED_XATTRS
+# if defined( OS_LINUX ) || defined( OS_DARWIN ) || defined( OS_MACOSX )
+# define HAVE_XATTRS
+# include
+# endif
+# endif
+
# ifdef NEED_SLEEP
# ifdef OS_NT
# define WIN32_LEAN_AND_MEAN
@@ -722,23 +738,30 @@ enum LineType { LineTypeRaw, LineTypeCr, LineTypeCrLf, LineTypeLfcrlf };
/*
* P4INT64 - a 64 bit int
+ * Duplicated in error.h in case external includes including error.h first
*/
-# if !defined( OS_MVS ) && \
- !defined( OS_OS2 ) && \
- !defined( OS_QNX )
-# define HAVE_INT64
-# ifdef OS_NT
-# define P4INT64 __int64
-# else
-# define P4INT64 long long
-# endif
-# endif
-
# ifndef P4INT64
-# define P4INT64 int
+# if !defined( OS_MVS ) && \
+ !defined( OS_OS2 ) && \
+ !defined( OS_QNX )
+# define HAVE_INT64
+# ifdef OS_NT
+# define P4INT64 __int64
+# else
+# define P4INT64 long long
+# endif
+# else
+# define P4INT64 int
+# endif
# endif
+/*
+ * P4UINT64 - an unsigned 64 bit int.
+ */
+
+# define P4UINT64 unsigned P4INT64
+
/*
* offL_t - size of files or offsets into files
*/
@@ -795,6 +818,11 @@ typedef unsigned int p4size_t;
# define HAS_BROKEN_CPP11
# endif
+# if defined(_MSC_VER) && _MSC_VER < 1915
+// C2970
+# define HAS_BROKEN_CPP11_TEMPLATE_INTERNAL_LINKAGE
+# endif
+
# ifdef HAS_CPP11
# define HAS_PARALLEL_SYNC_THREADS
# endif
@@ -858,7 +886,11 @@ typedef struct P4_FD
{
HANDLE fh;
int flags;
- int isStd;
+ int mode;
+ int lock;
+ int dounicode;
+ int lfn;
+ int fdFlags;
unsigned char *ptr;
DWORD rcv;
int iobuf_siz;
@@ -873,6 +905,23 @@ typedef struct P4_FD* FD_TYPE;
# define FD_ERR NULL
typedef void* FD_PTR;
+# define FD_INIT NULL
+# define FD_ERR NULL
+typedef void* FD_PTR;
+
+# define FD_IsSTD 0x001
+# define FD_LOCKED 0x002
+# define FD_REOPEN 0x004
+# define FD_CLOSED 0x008
+
+enum LFNModeFlags {
+ LFN_ENABLED = 0x01,
+ LFN_UNCPATH = 0x02,
+ LFN_UTF8 = 0x04,
+ LFN_ATOMIC_RENAME = 0x08,
+ LFN_CSENSITIVE = 0x10,
+} ;
+
# else // OS_NT
# define FD_INIT -1
@@ -882,9 +931,49 @@ typedef int FD_PTR;
# endif // !OS_NT
+
# if !defined( HAS_CPP11 ) && !defined( LLONG_MIN )
# define LLONG_MIN (-9223372036854775807LL - 1)
# define LLONG_MAX 9223372036854775807LL
# endif
+# if defined( HAS_CPP11 )
+# if defined( NEED_THREAD ) && ( defined( OS_NT ) || !defined( USE_SMARTHEAP ) )
+# define HAVE_THREAD
+# include
+# include
+# endif
+# endif
+
+
+// endian defines.
+# undef P4_LITTLE_ENDIAN
+# undef P4_BIG_ENDIAN
+
+# if defined( OS_LINUX ) || defined(OS_MACOSX) || defined(OS_DARWIN)
+# if defined( __BYTE_ORDER) && defined(__LITTLE_ENDIAN)
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+# define P4_LITTLE_ENDIAN 1
+# endif
+# if __BYTE_ORDER == __BIG_ENDIAN
+# define P4_BIG_ENDIAN 1
+# endif
+# else
+// If there are no defines to tell us, then guess.
+# define P4_LITTLE_ENDIAN 1
+# endif
+# endif
+
+# if defined( OS_NT )
+
+# define P4_LITTLE_ENDIAN 1
+
+# endif
+
+# if !defined( P4_LITTLE_ENDIAN ) && !defined( P4_BIG_ENDIAN )
+// Endian defines not working on builds (php) that
+// do not define OS type. Disable this guard until fixed.
+//# error "Unable to determine the endianess of the platform"
+# endif
+
# endif // P4STDHDRS_H
diff --git a/P4Plugin/Source/p4api/include/p4/strarray.h b/P4Plugin/Source/p4api/include/p4/strarray.h
index 35aaecc..31aa3a4 100644
--- a/P4Plugin/Source/p4api/include/p4/strarray.h
+++ b/P4Plugin/Source/p4api/include/p4/strarray.h
@@ -22,6 +22,7 @@ class StrArray {
public:
StrArray();
+ StrArray( int max );
~StrArray();
StrBuf * Put();
@@ -33,6 +34,7 @@ class StrArray {
void Remove( int i );
int Search( const StrBuf *key );
const StrBuf * Find( const StrBuf *key );
+ int GetIndex( const StrBuf *key );
void Copy( const StrArray *other );
private:
diff --git a/P4Plugin/Source/p4api/include/p4/strbuf.h b/P4Plugin/Source/p4api/include/p4/strbuf.h
index 177c8b0..be59c28 100644
--- a/P4Plugin/Source/p4api/include/p4/strbuf.h
+++ b/P4Plugin/Source/p4api/include/p4/strbuf.h
@@ -51,6 +51,7 @@
* StrPtr::[] - get a single character
* StrPtr::XCompare() - case exact string compare
* StrPtr::CCompare() - case folding string compare
+ * StrPtr::CCompareN() - case folding string compare, length-limited
* StrPtr::SCompare() - case aware string compare -- see strbuf.cc
* StrPtr::SEqual() - case aware character compare -- see strbuf.cc
* StrPtr::Contains() - finds a substring
@@ -134,6 +135,7 @@ class StrPtr {
{ return Atoi64( buffer ); }
static bool Atoi64( const char *p, P4INT64 *result );
+ static bool Atoi64Lite( const char *p, P4INT64 *result );
bool Atoi64( P4INT64 *result ) const
{ return Atoi64( buffer, result ); }
@@ -160,6 +162,9 @@ class StrPtr {
int CCompare( const StrPtr &s ) const
{ return CCompare( buffer, s.buffer ); }
+ int CCompareN( const StrPtr &s, p4size_t len ) const
+ { return CCompareN( buffer, s.buffer, len ); }
+
int SCompare( const StrPtr &s ) const
{ return SCompare( buffer, s.buffer ); }
@@ -167,6 +172,7 @@ class StrPtr {
{ return NCompare( buffer, s.buffer ); }
static int CCompare( const char *a, const char *b );
+ static int CCompareN( const char *a, const char *b, p4size_t len );
static int SCompare( const char *a, const char *b );
static int NCompare( const char *a, const char *b );
@@ -261,6 +267,7 @@ class StrPtr {
static P4INT64 Atoi64( const char *buffer );
static char *Itoa64( P4INT64 v, char *endbuf );
static char *Itox( unsigned int v, char *endbuf );
+ static char *Itox64( P4UINT64 v, char *endbuf );
friend class StrBuf;
friend class StrRef;
@@ -522,8 +529,16 @@ class StrBuf : public StrPtr {
StrBuf& operator <<( const StrNum &s )
{ UAppend( (const StrPtr *)&s ); return *this; }
+ StrBuf& operator <<( P4INT64 v );
+
StrBuf& operator <<( int v );
+ StrBuf& operator <<( long int v ); /* time_t */
+
+ StrBuf& operator <<( unsigned int v ); /* p4size_t */
+
+ StrBuf& operator <<( long unsigned int v );
+
private:
p4size_t size;
@@ -557,25 +572,43 @@ class StrNum : public StrPtr {
public:
StrNum() {}
+ StrNum( P4INT64 v )
+ { Set( v ); }
+
+ StrNum( long int v )
+ { Set( ( P4INT64 ) v ); }
+
StrNum( int v )
{ Set( v ); }
- StrNum( int ok, int v )
+ StrNum( int ok, P4INT64 v )
{ if( ok ) Set( v ); else buffer = buf, length = 0; }
+ void Set( P4INT64 v )
+ {
+ buffer = Itoa64( v, buf + sizeof( buf ) );
+ length = (p4size_t)(buf + sizeof( buf ) - buffer - 1);
+ }
+
void Set( int v )
{
buffer = Itoa( v, buf + sizeof( buf ) );
length = (p4size_t)(buf + sizeof( buf ) - buffer - 1);
}
+ void SetHex( P4INT64 v )
+ {
+ buffer = Itox64( v, buf + sizeof( buf ) );
+ length = (p4size_t)(buf + sizeof( buf ) - buffer - 1);
+ }
+
void SetHex( int v )
{
buffer = Itox( v, buf + sizeof( buf ) );
length = (p4size_t)(buf + sizeof( buf ) - buffer - 1);
}
- void Set( int v, int digits )
+ void Set( P4INT64 v, int digits )
{
Set( v );
@@ -583,21 +616,6 @@ class StrNum : public StrPtr {
*--buffer = '0', ++length;
}
-# ifdef HAVE_INT64
-
- StrNum( long v ) { Set( (P4INT64)v ); }
-
- StrNum( P4INT64 v )
- { Set( v ); }
-
- void Set( P4INT64 v )
- {
- buffer = Itoa64( v, buf + sizeof( buf ) );
- length = (p4size_t)(buf + sizeof( buf ) - buffer - 1);
- }
-
-# endif
-
private:
char buf[24];
} ;
@@ -625,8 +643,32 @@ class StrHuman : public StrPtr
char buf[24];
} ;
+inline StrBuf &
+StrBuf::operator <<( P4INT64 v )
+{
+ return operator <<( StrNum( v ) );
+}
+
inline StrBuf &
StrBuf::operator <<( int v )
{
return operator <<( StrNum( v ) );
}
+
+inline StrBuf &
+StrBuf::operator <<( long int v )
+{
+ return operator <<( StrNum( ( P4INT64 ) v ) );
+}
+
+inline StrBuf &
+StrBuf::operator <<( unsigned int v )
+{
+ return operator <<( StrNum( ( P4INT64 ) v ) );
+}
+
+inline StrBuf &
+StrBuf::operator <<( long unsigned int v )
+{
+ return operator <<( StrNum( ( P4INT64 ) v ) );
+}
diff --git a/P4Plugin/Source/p4api/include/p4/strdict.h b/P4Plugin/Source/p4api/include/p4/strdict.h
index fbf7ef7..507e459 100644
--- a/P4Plugin/Source/p4api/include/p4/strdict.h
+++ b/P4Plugin/Source/p4api/include/p4/strdict.h
@@ -36,10 +36,19 @@ class StrVarName : public StrRef {
char varName[64];
} ;
+class StrDictIterator {
+ public:
+ virtual ~StrDictIterator(){};
+ virtual int Get( StrRef &var, StrRef &val ) = 0;
+ virtual void Next() = 0;
+ virtual void Reset() = 0;
+} ;
+
class StrDict {
public:
+ StrDict() : iterator( 0 ) {}
virtual ~StrDict();
// Handy wrappers
@@ -76,6 +85,8 @@ class StrDict {
int GetVarCCompare( const char *var, StrBuf &val );
int GetVarCCompare( const StrPtr &var, StrBuf &val );
+ int GetCount()
+ { return VGetCount(); };
void ReplaceVar( const char *var, const char *value );
void ReplaceVar( const StrPtr &var, const StrPtr &value );
@@ -89,7 +100,9 @@ class StrDict {
int Save( FILE * out );
int Load( FILE * out );
-
+
+ virtual StrDictIterator *GetIterator();
+
protected:
// Get/Set vars, provided by subclass
@@ -101,5 +114,24 @@ class StrDict {
virtual void VSetError( const StrPtr &var, Error *e );
virtual void VClear();
virtual void VReset();
+ virtual int VGetCount() = 0;
+ StrDictIterator *iterator;
} ;
+
+class StrDictBasicIterator : public StrDictIterator {
+ public:
+ StrDictBasicIterator( StrDict *dict ) { i = 0; this->dict = dict; }
+
+ virtual int Get(StrRef &var, StrRef &val) {
+ return dict->GetVar( i, var, val ); }
+
+ virtual void Next() { i++; }
+
+ virtual void Reset() { i = 0; }
+
+ private:
+ int i;
+ StrDict *dict;
+} ;
+
diff --git a/P4Plugin/Source/p4api/include/p4/strops.h b/P4Plugin/Source/p4api/include/p4/strops.h
index da51ead..54f41be 100644
--- a/P4Plugin/Source/p4api/include/p4/strops.h
+++ b/P4Plugin/Source/p4api/include/p4/strops.h
@@ -146,6 +146,7 @@ class StrOps {
static void PackInt( StrBuf &o, int v );
static void PackIntA( StrBuf &o, int v );
static void PackInt64( StrBuf &o, P4INT64 v );
+ static void PackIntV( StrBuf &o, P4INT64 v );
static void PackChar( StrBuf &o, const char *c, int len );
static void PackOctet( StrBuf &o, const StrPtr &s );
static void PackString( StrBuf &o, const StrPtr &s );
@@ -154,6 +155,7 @@ class StrOps {
static int UnpackInt( StrRef &o );
static int UnpackIntA( StrRef &o );
static P4INT64 UnpackInt64( StrRef &o );
+ static P4INT64 UnpackIntV( StrRef &o );
static void UnpackChar( StrRef &o, char *c, int length );
static void UnpackOctet( StrRef &o, const StrPtr &s );
static void UnpackString( StrRef &o, StrBuf &s );
diff --git a/P4Plugin/Source/p4api/include/p4/strtable.h b/P4Plugin/Source/p4api/include/p4/strtable.h
index 052ade7..4997c25 100644
--- a/P4Plugin/Source/p4api/include/p4/strtable.h
+++ b/P4Plugin/Source/p4api/include/p4/strtable.h
@@ -39,6 +39,7 @@ class StrPtrDict : public StrDict {
void VRemoveVar( const StrPtr &var );
int VGetVarX( int x, StrRef &var, StrRef &val );
void VClear() { tabLength = 0; }
+ int VGetCount() { return tabLength; }
private:
@@ -56,11 +57,6 @@ class StrBufDict : public StrDict {
StrBufDict & operator =( StrDict & dict );
~StrBufDict();
- int GetCount()
- {
- return tabLength;
- }
-
// virtuals of StrDict
StrPtr * VGetVar( const StrPtr &var );
@@ -68,6 +64,7 @@ class StrBufDict : public StrDict {
void VRemoveVar( const StrPtr &var );
int VGetVarX( int x, StrRef &var, StrRef &val );
void VClear() { tabLength = 0; }
+ int VGetCount() { return tabLength; }
StrPtr * GetVarN( const StrPtr &var );
StrBuf * KeepOne( const StrPtr &var );
@@ -96,6 +93,7 @@ class BufferDict : public StrDict {
void VSetVar( const StrPtr &var, const StrPtr &val );
void VClear() { buf.Clear(); count = 0; }
void VRemoveVar( const StrPtr &var );
+ int VGetCount() { return count; }
protected:
StrPtr * GetBuffer() { return &buf; }
diff --git a/P4Plugin/Source/p4api/include/p4/threading.h b/P4Plugin/Source/p4api/include/p4/threading.h
index 8637fba..e921610 100644
--- a/P4Plugin/Source/p4api/include/p4/threading.h
+++ b/P4Plugin/Source/p4api/include/p4/threading.h
@@ -100,6 +100,9 @@ class Process {
virtual void Child() = 0;
virtual void Cancel() = 0;
+# ifndef OS_NT
+ virtual void Cleanup ( pid_t pid ) {}
+# endif
} ;
class Threader {
@@ -120,6 +123,9 @@ class Threader {
virtual void Quiesce();
virtual void Reap();
+# ifndef OS_NT
+ virtual void Cleanup( pid_t pid );
+# endif
virtual int GetThreadCount(); // varies on each system
int cancelled;
@@ -156,6 +162,10 @@ class Threading {
{ return current ? current->GetThreadCount() : -1; }
static void LaunchCurrentThread( Thread *t ) { if( current ) current->Launch( t ); }
+# ifndef OS_NT
+ static void Cleanup( pid_t pid ) { if( current ) current->Cleanup( pid ); }
+# endif
+
private:
Threader *threader;
diff --git a/P4Plugin/Source/p4api/include/p4/vararray.h b/P4Plugin/Source/p4api/include/p4/vararray.h
index 8e9318e..a82a5da 100644
--- a/P4Plugin/Source/p4api/include/p4/vararray.h
+++ b/P4Plugin/Source/p4api/include/p4/vararray.h
@@ -24,7 +24,9 @@
* VarArray::Put(v) - set a new slot to v
* VarArray::WillGrow(i) - returns size of new vararray if it
* would have to grow in the next i rows.
- *
+ * VarArray::Capacity() - returns the maximum number of elements
+ * that can be stored before growing.
+ *
* VVarArray::Diff() - subtract/compare/add to VarArrays
* OpDiff - substract two VarArrays and drop duplicates
* OpIntersect - compare VarArrays to find matches
@@ -56,6 +58,7 @@ class VarArray {
void * Put( void *v ) { return *New() = v; }
void SetCount( int i ) { numElems = i; }
int WillGrow( int interval );
+ int Capacity() const { return maxElems; }
void * Replace( int i, void *newValue );
void Exchange( int i, int j )
@@ -98,6 +101,8 @@ class VVarArray : public VarArray {
void Uniq();
private:
+ friend class DbArray;
+
void Sort( int l, int u );
int Med3( int i, int j, int k ) const;
diff --git a/P4Plugin/Source/p4api/include/p4/web822.h b/P4Plugin/Source/p4api/include/p4/web822.h
index 2bc236e..c76540d 100644
--- a/P4Plugin/Source/p4api/include/p4/web822.h
+++ b/P4Plugin/Source/p4api/include/p4/web822.h
@@ -44,6 +44,9 @@ class Web822 : public StrDict {
int VGetVarX( int x, StrRef &var, StrRef &val )
{ return recvHeaders.VGetVarX( x, var, val ); }
+
+ int VGetCount()
+ { return recvHeaders.GetCount(); }
// Send a response
diff --git a/P4Plugin/Source/p4api/include_r21.2/p4/base64.h b/P4Plugin/Source/p4api/include_r21.2/p4/base64.h
new file mode 100644
index 0000000..ddde21c
--- /dev/null
+++ b/P4Plugin/Source/p4api/include_r21.2/p4/base64.h
@@ -0,0 +1,18 @@
+/*
+ * Copyright 1995, 1996 Perforce Software. All rights reserved.
+ *
+ * This file is part of Perforce - the FAST SCM System.
+ */
+
+
+/*
+ * BASE64 - decode base64 strings
+ *
+ */
+
+class Base64
+{
+ public:
+ static int Decode( StrPtr &in, StrBuf &out );
+ static void Encode( StrPtr &in, StrBuf &out );
+} ;
diff --git a/P4Plugin/Source/p4api/include_r21.2/p4/charcvt.h b/P4Plugin/Source/p4api/include_r21.2/p4/charcvt.h
new file mode 100644
index 0000000..26e6afe
--- /dev/null
+++ b/P4Plugin/Source/p4api/include_r21.2/p4/charcvt.h
@@ -0,0 +1,517 @@
+/*
+ * Copyright 2001 Perforce Software. All rights reserved.
+ *
+ * This file is part of Perforce - the FAST SCM System.
+ */
+
+class CharSetUTF8Valid;
+class CharStep;
+class StrPtr;
+class StrBuf;
+class StrDict;
+class CharSetCvtCache;
+
+/*
+ * CharSetCvt.h - Character set converters
+ */
+
+class CharSetCvt : public CharSetApi {
+public:
+ enum Errors {
+ NONE = 0, NOMAPPING, PARTIALCHAR
+ };
+
+ static CharSetCvt *FindCvt(CharSet from, CharSet to);
+
+ // do not delete CharSetCvt* returned by FindCachedCvt.
+ //They are kept in a cache
+ static CharSetCvt *FindCachedCvt(CharSetCvtCache *gCharSetCvtCache,
+ CharSet from, CharSet to);
+
+ virtual ~CharSetCvt();
+
+ // If you call reverse or clone you must delete the charset
+ virtual CharSetCvt *Clone();
+
+ virtual CharSetCvt *ReverseCvt();
+
+ virtual int Cvt(const char **sourcestart, const char *sourceend,
+ char **targetstart, char *targetend);
+
+ virtual int LastErr();
+
+ virtual void ResetErr();
+
+ /* convert buffer into an allocated buffer, caller must free result */
+ virtual char *CvtBuffer(const char *, int len, int *retlen = 0);
+
+ /* convert buffer into an managed buffer, caller must copy result
+ out before calling this again */
+ virtual const char *FastCvt(const char *, int len, int *retlen = 0);
+
+ /* convert buffer into an managed buffer, caller must copy result
+ out before calling this again - substitute '?' for bad mappings */
+ virtual const char *FastCvtQues(const char *, int len, int *retlen = 0);
+
+ virtual void IgnoreBOM();
+
+ void ResetCnt() { linecnt = 1; charcnt = 0; }
+ int LineCnt() { return linecnt; }
+ int CharCnt() { return charcnt; }
+
+ static int Utf8Fold( const StrPtr *, StrBuf * );
+
+ struct MapEnt {
+ unsigned short cfrom, cto;
+ };
+
+ static char bytesFromUTF8[];
+ static unsigned long offsetsFromUTF8[];
+ static unsigned long minimumFromUTF8[];
+
+ static void Init();
+
+protected:
+ friend class CharSetCvtCache; // for the following default constructor
+ CharSetCvt() : lasterr(0), linecnt(1), charcnt(0), fastbuf(0), fastsize(0){}
+
+ int lasterr;
+ int linecnt;
+ int charcnt;
+
+ void doverify( MapEnt *, int, MapEnt *, int );
+ void dodump( MapEnt *, int );
+ virtual void printmap( unsigned short, unsigned short, unsigned short );
+ virtual void printmap( unsigned short, unsigned short );
+ virtual CharStep *FromCharStep(char *);
+
+ static unsigned short MapThru( unsigned short, const MapEnt *,
+ int, unsigned short );
+private:
+ char *fastbuf;
+ int fastsize;
+
+ CharSetCvt(const CharSetCvt &); // to prevent copys
+ void operator =(const CharSetCvt &); // to prevent assignment
+};
+
+class CharSetCvtCache
+{
+public:
+ CharSetCvtCache()
+ {
+ fromUtf8To = 0;
+ toUtf8From = 0;
+ }
+
+ ~CharSetCvtCache();
+
+ CharSetCvt * FindCvt(CharSetCvt::CharSet from, CharSetCvt::CharSet to);
+ void InsertCvt(CharSetCvt::CharSet from, CharSetCvt::CharSet to, CharSetCvt * cvt);
+
+private:
+ CharSetCvt ** fromUtf8To;
+ CharSetCvt ** toUtf8From;
+};
+
+class CharSetCvtFromUTF8 : public CharSetCvt {
+ protected:
+ CharSetCvtFromUTF8() : checkBOM(0) {}
+
+ virtual void IgnoreBOM();
+
+ virtual CharStep *FromCharStep( char * );
+
+ int checkBOM;
+};
+
+class CharSetCvtUTF8UTF8 : public CharSetCvtFromUTF8 {
+ public:
+ CharSetCvtUTF8UTF8(int dir, int f);
+ ~CharSetCvtUTF8UTF8();
+
+// Direction 1 to client, -1 to server
+// flags are...
+#define UTF8_WRITE_BOM 1
+#define UTF8_VALID_CHECK 2
+
+ virtual CharSetCvt *Clone();
+
+ virtual CharSetCvt *ReverseCvt();
+
+ virtual int Cvt(const char **sourcestart, const char *sourceend,
+ char **targetstart, char *targetend);
+ private:
+ int direction;
+ int flags;
+ CharSetUTF8Valid *validator;
+};
+
+class CharSetCvtUTF16 : public CharSetCvtFromUTF8 {
+ protected:
+ CharSetCvtUTF16(int, int);
+
+ int invert, fileinvert;
+ int bom;
+
+ virtual void IgnoreBOM();
+};
+
+class CharSetCvtUTF816 : public CharSetCvtUTF16 {
+
+ public:
+ CharSetCvtUTF816(int i = -1, int b = 0) : CharSetCvtUTF16(i, b) {}
+
+ virtual CharSetCvt *Clone();
+
+ virtual CharSetCvt *ReverseCvt();
+
+ virtual int Cvt(const char **sourcestart, const char *sourceend,
+ char **targetstart, char *targetend);
+};
+
+class CharSetCvtUTF168 : public CharSetCvtUTF16 {
+
+ public:
+ CharSetCvtUTF168(int i = -1, int b = 0) : CharSetCvtUTF16(i, b) {}
+
+ virtual CharSetCvt *Clone();
+
+ virtual CharSetCvt *ReverseCvt();
+
+ virtual int Cvt(const char **sourcestart, const char *sourceend,
+ char **targetstart, char *targetend);
+};
+
+class CharSetCvtUTF832 : public CharSetCvtUTF16 {
+
+ public:
+ CharSetCvtUTF832(int i = -1, int b = 0) : CharSetCvtUTF16(i, b) {}
+
+ virtual CharSetCvt *Clone();
+
+ virtual CharSetCvt *ReverseCvt();
+
+ virtual int Cvt(const char **sourcestart, const char *sourceend,
+ char **targetstart, char *targetend);
+};
+
+class CharSetCvtUTF328 : public CharSetCvtUTF16 {
+
+ public:
+ CharSetCvtUTF328(int i = -1, int b = 0) : CharSetCvtUTF16(i, b) {}
+
+ virtual CharSetCvt *Clone();
+
+ virtual CharSetCvt *ReverseCvt();
+
+ virtual int Cvt(const char **sourcestart, const char *sourceend,
+ char **targetstart, char *targetend);
+};
+
+class CharSetCvtUTF8to8859_1 : public CharSetCvtFromUTF8 {
+ public:
+ virtual CharSetCvt *Clone();
+
+ virtual CharSetCvt *ReverseCvt();
+
+ virtual int Cvt(const char **sourcestart, const char *sourceend,
+ char **targetstart, char *targetend);
+};
+
+class CharSetCvt8859_1toUTF8 : public CharSetCvt {
+ public:
+ virtual CharSetCvt *Clone();
+
+ virtual CharSetCvt *ReverseCvt();
+
+ virtual int Cvt(const char **sourcestart, const char *sourceend,
+ char **targetstart, char *targetend);
+};
+
+class CharSetCvtUTF8toShiftJis : public CharSetCvtFromUTF8 {
+ public:
+ virtual CharSetCvt *Clone();
+
+ virtual CharSetCvt *ReverseCvt();
+
+ virtual int Cvt(const char **sourcestart, const char *sourceend,
+ char **targetstart, char *targetend);
+
+private:
+ static MapEnt UCS2toShiftJis[];
+
+ friend void verifymaps();
+ friend void dumpmaps();
+ void mapreport(MapEnt *, int);
+ void mapreport();
+ virtual void printmap( unsigned short, unsigned short, unsigned short );
+ virtual void printmap( unsigned short, unsigned short );
+ static int MapCount();
+};
+
+class CharSetCvtShiftJistoUTF8 : public CharSetCvt {
+ public:
+ virtual CharSetCvt *Clone();
+
+ virtual CharSetCvt *ReverseCvt();
+
+ virtual int Cvt(const char **sourcestart, const char *sourceend,
+ char **targetstart, char *targetend);
+
+ virtual CharStep *FromCharStep( char * );
+
+private:
+ static MapEnt ShiftJistoUCS2[];
+
+ friend void verifymaps();
+ friend void dumpmaps();
+ void mapreport(MapEnt *, int);
+ void mapreport();
+ virtual void printmap( unsigned short, unsigned short, unsigned short );
+ virtual void printmap( unsigned short, unsigned short );
+ static int MapCount();
+};
+
+class CharSetCvtUTF8toEUCJP : public CharSetCvtFromUTF8 {
+ public:
+ virtual CharSetCvt *Clone();
+
+ virtual CharSetCvt *ReverseCvt();
+
+ virtual int Cvt(const char **sourcestart, const char *sourceend,
+ char **targetstart, char *targetend);
+
+private:
+ static MapEnt UCS2toEUCJP[];
+
+ friend void verifymaps();
+ friend void dumpmaps();
+ void mapreport(MapEnt *, int);
+ void mapreport();
+ virtual void printmap( unsigned short, unsigned short, unsigned short );
+ virtual void printmap( unsigned short, unsigned short );
+ static int MapCount();
+};
+
+class CharSetCvtEUCJPtoUTF8 : public CharSetCvt {
+ public:
+ virtual CharSetCvt *Clone();
+
+ virtual CharSetCvt *ReverseCvt();
+
+ virtual int Cvt(const char **sourcestart, const char *sourceend,
+ char **targetstart, char *targetend);
+
+ virtual CharStep *FromCharStep( char * );
+
+private:
+ static MapEnt EUCJPtoUCS2[];
+
+ friend void verifymaps();
+ friend void dumpmaps();
+ void mapreport(MapEnt *, int);
+ void mapreport();
+ virtual void printmap( unsigned short, unsigned short, unsigned short );
+ virtual void printmap( unsigned short, unsigned short );
+ static int MapCount();
+};
+
+struct SimpleCharSet {
+ const CharSetCvt::MapEnt *toMap;
+ int toMapSize;
+ const unsigned short *fromMap;
+ int fromOffset;
+};
+
+class CharSetCvtUTF8toSimple : public CharSetCvtFromUTF8 {
+public:
+ CharSetCvtUTF8toSimple(int);
+ CharSetCvtUTF8toSimple(const SimpleCharSet *s) : charinfo(s) {}
+
+ virtual CharSetCvt *Clone();
+
+ virtual CharSetCvt *ReverseCvt();
+
+ virtual int Cvt(const char **sourcestart, const char *sourceend,
+ char **targetstart, char *targetend);
+private:
+ const SimpleCharSet *charinfo;
+};
+
+class CharSetCvtSimpletoUTF8 : public CharSetCvt {
+public:
+ CharSetCvtSimpletoUTF8(int);
+ CharSetCvtSimpletoUTF8(const SimpleCharSet *s) : charinfo(s) {}
+
+ virtual CharSetCvt *Clone();
+
+ virtual CharSetCvt *ReverseCvt();
+
+ virtual int Cvt(const char **sourcestart, const char *sourceend,
+ char **targetstart, char *targetend);
+private:
+ const SimpleCharSet *charinfo;
+};
+
+class CharSetCvtUTF8toCp : public CharSetCvtFromUTF8 {
+ protected:
+ CharSetCvtUTF8toCp( const MapEnt *tMap, int toSz )
+ : toMap(tMap), toMapSize(toSz) {}
+
+ public:
+ virtual int Cvt(const char **sourcestart, const char *sourceend,
+ char **targetstart, char *targetend);
+
+private:
+ const MapEnt *toMap;
+ int toMapSize;
+ virtual void printmap( unsigned short, unsigned short, unsigned short );
+ virtual void printmap( unsigned short, unsigned short );
+};
+
+class CharSetCvtUTF8toCp949 : public CharSetCvtUTF8toCp
+{
+ public:
+ CharSetCvtUTF8toCp949() : CharSetCvtUTF8toCp( UCS2toCp949, MapCount() ) {}
+
+ virtual CharSetCvt *Clone();
+
+ virtual CharSetCvt *ReverseCvt();
+
+ static int MapCount();
+
+ private:
+ static MapEnt UCS2toCp949[];
+
+ friend void verifymaps();
+ friend void dumpmaps();
+ void mapreport( MapEnt *, int );
+ void mapreport();
+};
+
+class CharSetCvtUTF8toCp936 : public CharSetCvtUTF8toCp
+{
+ public:
+ CharSetCvtUTF8toCp936() : CharSetCvtUTF8toCp( UCS2toCp936, MapCount() ) {}
+
+ virtual CharSetCvt *Clone();
+
+ virtual CharSetCvt *ReverseCvt();
+
+ static int MapCount();
+
+ private:
+ static MapEnt UCS2toCp936[];
+
+ friend void verifymaps();
+ friend void dumpmaps();
+ void mapreport( MapEnt *, int );
+ void mapreport();
+};
+
+class CharSetCvtUTF8toCp950 : public CharSetCvtUTF8toCp
+{
+ public:
+ CharSetCvtUTF8toCp950() : CharSetCvtUTF8toCp( UCS2toCp950, MapCount() ) {}
+
+ virtual CharSetCvt *Clone();
+
+ virtual CharSetCvt *ReverseCvt();
+
+ static int MapCount();
+
+ private:
+ static MapEnt UCS2toCp950[];
+
+ friend void verifymaps();
+ friend void dumpmaps();
+ void mapreport( MapEnt *, int );
+ void mapreport();
+};
+
+class CharSetCvtCptoUTF8 : public CharSetCvt {
+ protected:
+ CharSetCvtCptoUTF8( const MapEnt *tMap, int toSz )
+ : toMap(tMap), toMapSize(toSz) {}
+
+ public:
+ virtual int Cvt(const char **sourcestart, const char *sourceend,
+ char **targetstart, char *targetend);
+
+ private:
+ const MapEnt *toMap;
+ int toMapSize;
+ virtual int isDoubleByte( int leadByte ) = 0;
+ virtual void printmap( unsigned short, unsigned short, unsigned short );
+ virtual void printmap( unsigned short, unsigned short );
+};
+
+class CharSetCvtCp949toUTF8 : public CharSetCvtCptoUTF8
+{
+ public:
+ CharSetCvtCp949toUTF8() : CharSetCvtCptoUTF8( Cp949toUCS2, MapCount() ) {}
+
+ virtual CharSetCvt *Clone();
+
+ virtual CharSetCvt *ReverseCvt();
+
+ static int MapCount();
+
+ CharStep *FromCharStep( char * );
+
+ private:
+ static MapEnt Cp949toUCS2[];
+
+ friend void verifymaps();
+ friend void dumpmaps();
+ virtual int isDoubleByte( int leadByte );
+ void mapreport(MapEnt *, int);
+ void mapreport();
+};
+
+class CharSetCvtCp936toUTF8 : public CharSetCvtCptoUTF8
+{
+ public:
+ CharSetCvtCp936toUTF8() : CharSetCvtCptoUTF8( Cp936toUCS2, MapCount() ) {}
+
+ virtual CharSetCvt *Clone();
+
+ virtual CharSetCvt *ReverseCvt();
+
+ static int MapCount();
+
+ CharStep *FromCharStep( char * );
+
+ private:
+ static MapEnt Cp936toUCS2[];
+
+ friend void verifymaps();
+ friend void dumpmaps();
+ virtual int isDoubleByte( int leadByte );
+ void mapreport(MapEnt *, int);
+ void mapreport();
+};
+
+class CharSetCvtCp950toUTF8 : public CharSetCvtCptoUTF8
+{
+ public:
+ CharSetCvtCp950toUTF8() : CharSetCvtCptoUTF8( Cp950toUCS2, MapCount() ) {}
+
+ virtual CharSetCvt *Clone();
+
+ virtual CharSetCvt *ReverseCvt();
+
+ static int MapCount();
+
+ CharStep *FromCharStep( char * );
+
+ private:
+ static MapEnt Cp950toUCS2[];
+
+ friend void verifymaps();
+ friend void dumpmaps();
+ virtual int isDoubleByte( int leadByte );
+ void mapreport(MapEnt *, int);
+ void mapreport();
+};
diff --git a/P4Plugin/Source/p4api/include_r21.2/p4/charman.h b/P4Plugin/Source/p4api/include_r21.2/p4/charman.h
new file mode 100644
index 0000000..b8f9ace
--- /dev/null
+++ b/P4Plugin/Source/p4api/include_r21.2/p4/charman.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright 1995, 2001 Perforce Software. All rights reserved.
+ *
+ * This file is part of Perforce - the FAST SCM System.
+ */
+
+/*
+ * CharMan - Character manipulation support for i18n environments
+ */
+
+# include
+
+# define isAhighchar(x) ( (0x80 & *(x)) != 0 )
+
+# define isAcntrl(x) ( ! isAhighchar(x) && iscntrl(*(x)) )
+
+# define isAdigit(x) ( ! isAhighchar(x) && isdigit(*(x)) )
+
+# define isAprint(x) ( isAhighchar(x) || isprint(*(x)) )
+
+# define isAspace(x) ( ! isAhighchar(x) && isspace(*(x)) )
+
+# define isAalnum(x) ( isAhighchar(x) || isalnum(*(x)) )
+
+# define toAupper(x) ( isAhighchar(x) ? *(x) : toupper(*(x)) )
+
+# define toAlower(x) ( isAhighchar(x) ? *(x) : tolower(*(x)) )
+
+// isblank is a C++11 feature not supported by a number of our compilers
+# define isBlank(x) ((x)==' '||(x)=='\t')
+
+/*
+ * tolowerq -- quick version for NT that doesn't use SLOW locale stuff
+ * toupperq -- quick version for NT that doesn't use SLOW locale stuff
+ */
+
+# define tolowerq(x) ((x)>='A'&&(x)<='Z'?(x)-'A'+'a':(x))
+# define toupperq(x) ((x)>='a'&&(x)<='z'?(x)-'a'+'A':(x))
+
+class CharStep {
+public:
+ CharStep( char * p ) : ptr(p) {}
+ virtual ~CharStep() {}
+
+ virtual char *Next();
+ char *Next( int );
+
+ char *Ptr() const { return ptr; }
+
+ int CountChars( char *e );
+
+ static CharStep * Create ( char * p, int charset = 0 );
+protected:
+ char * ptr;
+};
+
+class CharStepUTF8 : public CharStep {
+public:
+ CharStepUTF8( char * p ) : CharStep( p ) {}
+ char *Next();
+};
+
+class CharStepShiftJis : public CharStep {
+public:
+ CharStepShiftJis( char * p ) : CharStep( p ) {}
+ char *Next();
+};
+
+class CharStepEUCJP : public CharStep {
+public:
+ CharStepEUCJP( char * p ) : CharStep( p ) {}
+ char *Next();
+};
+
+class CharStepCP949 : public CharStep {
+public:
+ CharStepCP949( char * p ) : CharStep( p ) {}
+ char *Next();
+};
+
+class CharStepCN : public CharStep {
+public:
+ CharStepCN( char * p ) : CharStep( p ) {}
+ char *Next();
+};
diff --git a/P4Plugin/Source/p4api/include_r21.2/p4/charset.h b/P4Plugin/Source/p4api/include_r21.2/p4/charset.h
new file mode 100644
index 0000000..3f55220
--- /dev/null
+++ b/P4Plugin/Source/p4api/include_r21.2/p4/charset.h
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2005 Perforce Software. All rights reserved.
+ *
+ * This file is part of Perforce - the FAST SCM System.
+ */
+
+/*
+ * GlobalCharSet -- a static charSet index across the process.
+ */
+
+class GlobalCharSet {
+
+ public:
+ static void Set( int x = 0 ) { globCharSet = x; }
+ static int Get() { return globCharSet; }
+
+ private:
+ static int globCharSet;
+} ;
diff --git a/P4Plugin/Source/p4api/include_r21.2/p4/clientapi.h b/P4Plugin/Source/p4api/include_r21.2/p4/clientapi.h
new file mode 100644
index 0000000..339a1d9
--- /dev/null
+++ b/P4Plugin/Source/p4api/include_r21.2/p4/clientapi.h
@@ -0,0 +1,299 @@
+/*
+ * Copyright 1995, 2000 Perforce Software. All rights reserved.
+ *
+ * This file is part of Perforce - the FAST SCM System.
+ */
+
+# ifndef P4_CLIENTAPI_H
+# define P4_CLIENTAPI_H
+
+# include "stdhdrs.h"
+
+# include "strbuf.h"
+# include "strdict.h"
+# include "error.h"
+# include "handler.h"
+
+# include "filesys.h"
+
+# include "p4tags.h"
+
+# include "clientmerge.h"
+# include "clientresolvea.h"
+# include "clientuser.h"
+
+# include "keepalive.h"
+
+/*
+ * ClientApi - the Perforce client API
+ *
+ * Basic flow:
+ *
+ * ClientUser ui;
+ * ClientApi client;
+ *
+ * // SetPort(), SetProtocol() must happen _before_ the Init().
+ *
+ * client.SetPort( somefunctionof( client.GetPort() ) ); //optional
+ * client.SetProtocol( "var", "value" ); //optional
+ *
+ * client.Init( e );
+ *
+ * // GetClient(), SetBreak(), SetProg() must happen _after_ the Init().
+ *
+ * client.SetBreak( &k ); // optional
+ *
+ * client.SetProg( "MyApp" ); // optional
+ *
+ * client.SetVersion( "version" ); // optional
+ *
+ * client.SetClient( somefunctionof( client.GetClient() ) ); //optional
+ * client.SetCwd( somefunctionof( client.GetCwd() ) ); //optional
+ * client.SetUser( somefunctionof( client.GetUser() ) ); //optional
+ *
+ * while( !client.Dropped() )
+ * {
+ * client.SetArgv( argc, argv )
+ * client.Run( func, &ui )
+ * }
+ *
+ * return client.Final( e );
+ *
+ * Public methods:
+ *
+ * ClientApi::SetUi() - reset the ClientUser object used
+ * ClientApi::SetProtocol() - ask for special server treatment
+ * ClientApi::GetProtocol() - get a protocol capability
+ * SetProtocol() is called before Init(); GetProtocol() after Run().
+ *
+ * ClientApi::Init() - establish connection and prepare to run commands.
+ *
+ * ClientApi::SetVar() - set variable
+ * ClientApi::SetVarV() - set variable using var=value syntax
+ * ClientApi::SetArgv() - set unnamed variables (args for Run())
+ * ClientApi::GetVar() - get variable
+ *
+ * ClientApi::Run() - run a single command
+ * ClientApi::Final() - clean up end of connection, returning error count.
+ * ClientApi::Dropped() - check if connection is no longer serviceable
+ * ClientApi::GetErrors() - get count of errors returned by server.
+ *
+ * ClientApi::RunTag() - run a single command (potentially) asynchronously.
+ * ClientApi::WaitTag() - wait for a RunTag()/all RunTag()s to complete.
+ *
+ * ClientApi::SetCharset()
+ * ClientApi::SetClient()
+ * ClientApi::SetCwd()
+ * ClientApi::SetHost()
+ * ClientApi::SetLanguage()
+ * ClientApi::SetPassword()
+ * ClientApi::SetPort()
+ * ClientApi::SetUser() - set client, current directory, host, port, or
+ * user, overridding all defaults. SetPort() must be called
+ * before Init() in order to take effect. The others must be
+ * set before Run() to take effect.
+ *
+ * SetCwd() additionally searches for a new P4CONFIG file.
+ *
+ * ClientApi::SetBreak() - set a subclassed KeepAlive object (only
+ * method IsAlive returns zero on dropped connection). Must
+ * be called after Init() it order to take affect.
+ *
+ * ClientApi::SetProg() - set the name of the application program,
+ * this will show up in 'p4 monitor' and server log output.
+ * Should be called before Init().
+ *
+ * ClientApi::SetVersion() - sets the version string of the application.
+ * If not called, the version defaults to protocolClient. This
+ * will be appended to the program name in 'p4 monitor' and
+ * server log output. It should be called after Init() and
+ * before each call to Run().
+ *
+ * ClientApi::SetTicketFile() - set the location of the users ticketfile,
+ * must be the full pathname to the file and not a directory.
+ *
+ * ClientApi::SetTrustFile() - set the location of the trustfile,
+ * must be the full pathname to the file and not a directory.
+ *
+ * ClientApi::SetExecutable() - set the location of the physical client
+ * executable program file. This is needed by the network
+ * parallelism features (parallel sync/submit etc.) so that they
+ * can spawn more copies of the program as needed.
+ *
+ * ClientApi::DefineCharset()
+ * ClientApi::DefineClient()
+ * ClientApi::DefineHost()
+ * ClientApi::DefineLanguage()
+ * ClientApi::DefinePassword()
+ * ClientApi::DefinePort()
+ * ClientApi::DefineUser() - sets client, port, or user in the registry
+ * and (so as to take permanent effect) then calls SetClient(),
+ * etc. to take immediate effect.
+ *
+ * ClientApi::GetBuild()
+ * ClientApi::GetCharset()
+ * ClientApi::GetClient()
+ * ClientApi::GetCwd()
+ * ClientApi::GetExecutable()
+ * ClientApi::GetHost()
+ * ClientApi::GetLanguage()
+ * ClientApi::GetOs()
+ * ClientApi::GetPassword()
+ * ClientApi::GetPort()
+ * ClientApi::GetUser() - get current directory, client, OS, port or user,
+ * as determined by defaults or by corresponding set value.
+ * GetClient()/GetHost() are not valid until after Init()
+ * establishes the connection, because the hostname of the
+ * local endpoint may serve as the default client name.
+ *
+ * Client::GetConfig() - get the filename pointed to by P4CONFIG, as
+ * determined by enviro::Config().
+ *
+ * ClientApi::SetIgnorePassword() - This function ignores passwords
+ * that are found in the registry (NT), host environments or
+ * configuration files. If this function is set then only
+ * passwords supplied through SetPassword() will be honored.
+ * Tickets continue to work as normal. Must be called before
+ * Init() in order to take affect.
+ */
+
+class Client;
+class ClientScript;
+class Ignore;
+
+class ClientApi : public StrDict {
+
+ public:
+ // caller's main interface
+
+ ClientApi();
+ ClientApi( Enviro *env );
+
+ virtual ~ClientApi();
+
+ void SetTrans( int output, int content = -2,
+ int fnames = -2, int dialog = -2 );
+
+ void SetProtocol( const char *p, const char *v );
+ void SetProtocol( const char *p );
+ void SetProtocolV( const char *p );
+ StrPtr * GetProtocol( const char *v );
+
+ void Init( Error *e );
+ void Run( const char *func, ClientUser *ui );
+ int Final( Error *e );
+ int Dropped();
+ int GetErrors();
+ int GetFatals();
+ int GetTrans();
+ int IsUnicode();
+
+ void RunTag( const char *func, ClientUser *ui );
+ void WaitTag( ClientUser *ui = 0 );
+
+ void SetArgv( int ac, char *const *av );
+ void SetCharset( const char *c );
+ void SetClient( const char *c );
+ void SetCwd( const char *c );
+ void SetCwdNoReload( const char *c );
+ void SetHost( const char *c );
+ void SetIgnoreFile( const char *c );
+ void SetLanguage( const char *c );
+ void SetPassword( const char *c );
+ void SetPort( const char *c );
+ void SetUser( const char *c );
+ void SetProg( const char *c );
+ void SetVersion( const char *c );
+ void SetTicketFile( const char *c );
+ void SetTrustFile( const char *c );
+ void SetEnviroFile( const char *c );
+
+ void SetCharset( const StrPtr *c );
+ void SetClient( const StrPtr *c );
+ void SetCwd( const StrPtr *c );
+ void SetCwdNoReload( const StrPtr *c );
+ void SetExecutable( const StrPtr *c );
+ void SetHost( const StrPtr *c );
+ void SetIgnoreFile( const StrPtr *c );
+ void SetLanguage( const StrPtr *c );
+ void SetPassword( const StrPtr *c );
+ void SetPort( const StrPtr *c );
+ void SetUser( const StrPtr *c );
+ void SetProg( const StrPtr *c );
+ void SetVersion( const StrPtr *c );
+ void SetTicketFile( const StrPtr *c );
+ void SetTrustFile( const StrPtr *c );
+ void SetEnviroFile( const StrPtr *c );
+
+ void SetBreak( KeepAlive *k );
+
+ void DefineCharset( const char *c, Error *e );
+ void DefineClient( const char *c, Error *e );
+ void DefineHost( const char *c, Error *e );
+ void DefineIgnoreFile( const char *c, Error *e );
+ void DefineLanguage( const char *c, Error *e );
+ void DefinePassword( const char *c, Error *e );
+ void DefinePort( const char *c, Error *e );
+ void DefineUser( const char *c, Error *e );
+
+ const int &GetAPI();
+ const StrPtr &GetCharset();
+ const StrPtr &GetClient();
+ const StrPtr &GetClientNoHost();
+ const StrPtr &GetCwd();
+ const StrPtr &GetExecutable();
+ const StrPtr &GetHost();
+ const StrPtr &GetIgnoreFile();
+ const StrPtr &GetLanguage();
+ const StrPtr &GetOs();
+ const StrPtr &GetPassword();
+ const StrPtr &GetPassword( const StrPtr *user );
+ const StrPtr &GetPort();
+ const StrPtr &GetProg();
+ const StrPtr &GetUser();
+ const StrPtr &GetConfig();
+ const StrArray *GetConfigs();
+ const StrPtr &GetBuild();
+ const StrPtr &GetVersion();
+
+ Enviro * GetEnviro();
+ Ignore * GetIgnore();
+
+ void SetIgnorePassword();
+
+ StrPtr *GetEVar( const StrPtr &var );
+ void SetEVar( const StrPtr &var, const StrPtr &val );
+ void VSetVarV( const char *var );
+
+ void EnableExtensions( Error* e );
+ void DisableExtensions();
+ bool ExtensionsEnabled();
+ void SetExtension( ClientScript* cs, Error* e,
+ const bool callerOwns = false );
+
+ public:
+ // The old interface, where ui was held from the start
+
+ ClientApi( ClientUser *ui );
+ void SetUi( ClientUser *i );
+ void Run( const char *func );
+
+ // Internal wrapping constructor
+
+ ClientApi( Client *client );
+
+ private:
+ // Our StrDict implementation
+ // Set strdict.h for various GetVar/SetVar calls
+
+ StrPtr *VGetVar( const StrPtr &var );
+ void VSetVar( const StrPtr &var, const StrPtr &val );
+
+ private:
+ Client *client; // wrapped up RPC
+ ClientUser *ui; // the old way
+ int ourClient;
+
+} ;
+
+# endif
diff --git a/P4Plugin/Source/p4api/include_r21.2/p4/clientmerge.h b/P4Plugin/Source/p4api/include_r21.2/p4/clientmerge.h
new file mode 100644
index 0000000..cc703dd
--- /dev/null
+++ b/P4Plugin/Source/p4api/include_r21.2/p4/clientmerge.h
@@ -0,0 +1,189 @@
+/*
+ * Copyright 1995, 1996 Perforce Software. All rights reserved.
+ *
+ * This file is part of Perforce - the FAST SCM System.
+ */
+
+#ifndef __CLIENTMERGE__
+#define __CLIENTMERGE__
+
+/*
+ * ClientMerge - client side merge controller
+ *
+ * ClientMerge
+ *
+ * A ClientMerge object handles the client-side merge process,
+ * taking the server-generated merge stream and writing out the
+ * base, yours, theirs, and merge files. A ClientMerge also has
+ * both a command line resolve implementation as well as hooks
+ * to allow other resolve implementations.
+ *
+ * ClientMerge is almost purely virtual, allowing for varying
+ * implementations that deal with the varying server-generated
+ * merge streams (basically 2 and 3 way merges).
+ *
+ * Half of ClientMerge's methods are for handling the server merge
+ * stream; the other half are for the user interface.
+ *
+ * Virtual member functions - Server merge stream handling
+ *
+ * ClientMerge::SetNames() - provides the user-recognisable names
+ * for the base, theirs, and yours.
+ *
+ * ClientMerge::SetShowAll() - turns on verbose merging.
+ *
+ * ClientMerge::Open() - state name of client file and prepare to
+ * process merge pipe.
+ *
+ * ClientMerge::Write() - write a block of the merge pipe. See
+ * diffmerge.h for the meaning of bits.
+ *
+ * ClientMerge::Close() - close file(s) at end of merge pipe.
+ *
+ * ClientMerge::Select() - move user-selected result into place
+ *
+ * ClientMerge::Chmod() - set permissions on the target file;
+ * generally, set to rw before and ro after.
+ *
+ * Virtual member functions - User interface hooks
+ *
+ * ClientMerge::AutoResolve() - take a guess at which version
+ * (theirs, yours, result) should be the result of the
+ * merge, using the chunk counts as hints.
+ *
+ * ClientMerge::Resolve() - let the user select which version
+ * should be the result of the merge.
+ *
+ * ClientMerge::DetectResolve() - determine which version by
+ * comparing result vs theirs/yours/merged.
+ *
+ * ClientMerge::IsAcceptable() - returns 1 if the result file
+ * has no merge markers (generated by the merge stream
+ * handler) left in it.
+ *
+ * ClientMerge::GetBaseFile()
+ * ClientMerge::GetYourFile()
+ * ClientMerge::GetTheirFile()
+ * ClientMerge::GetResultFile()
+ * Return a FileSys * to the desired file. 2 way merges
+ * return 0 for Base/Result files: only Yours/Theirs is
+ * available.
+ *
+ * ClientMerge::GetYourChunks()
+ * ClientMerge::GetTheirChunks()
+ * ClientMerge::GetBothChunks()
+ * ClientMerge::GetConflictChunks()
+ * Returns the number of chunks in the merge stream.
+ * 2 way merges return 0 for all.
+ *
+ * The actual caller of the ClientMerge class is in clientservice.cc.
+ * It uses the stream handling functions to produce 2 or 4 files on
+ * the client (yours/theirs, yours/theirs/base/result), and then calls
+ *
+ * MergeType ClientUser::Resolve( ClientMerge *merger )
+ *
+ * The default ClientUser::Resolve() merely calls merger->Resolve()
+ * to carry out the command-line resolve interaction, but a subclassed
+ * ClientUser::Resolve() can use the other merger methods to gain
+ * access to the files and performs its own resolve.
+ */
+
+enum MergeType {
+ CMT_BINARY, // binary merge
+ CMT_3WAY, // 3-way text
+ CMT_2WAY // 2-way text
+} ;
+
+enum MergeStatus {
+ CMS_QUIT, // user wants to quit
+ CMS_SKIP, // skip the integration record
+ CMS_MERGED, // accepted merged theirs and yours
+ CMS_EDIT, // accepted edited merge
+ CMS_THEIRS, // accepted theirs
+ CMS_YOURS // accepted yours,
+} ;
+
+enum MergeForce {
+ CMF_AUTO, // don't force // -am
+ CMF_SAFE, // accept only non-conflicts // -as
+ CMF_FORCE // accept anything // -af
+} ;
+
+class ClientUser;
+
+class ClientMerge : public LastChance {
+
+ public:
+ static ClientMerge *Create(
+ ClientUser *ui,
+ FileSysType type,
+ FileSysType resType,
+ MergeType m );
+
+ static ClientMerge *Create(
+ ClientUser *ui,
+ FileSysType type,
+ FileSysType resType,
+ FileSysType theirType,
+ FileSysType baseType,
+ MergeType m );
+
+ virtual ~ClientMerge();
+
+ // User interface: AutoResolve is called if any of the -a flags
+ // are passed to 'p4 resolve'. Resolve() is used otherwise. The
+ // Resolve()'s often call AutoResolve() to provide the user with
+ // a default selection.
+
+ virtual MergeStatus AutoResolve( MergeForce forceMerge ) = 0;
+ virtual MergeStatus Resolve( Error *e ) = 0;
+ virtual MergeStatus DetectResolve() const = 0;
+
+ virtual int IsAcceptable() const = 0;
+
+ virtual FileSys *GetBaseFile() const = 0;
+ virtual FileSys *GetYourFile() const = 0;
+ virtual FileSys *GetTheirFile() const = 0;
+ virtual FileSys *GetResultFile() const = 0;
+
+ virtual int GetYourChunks() const = 0;
+ virtual int GetTheirChunks() const = 0;
+ virtual int GetBothChunks() const = 0;
+ virtual int GetConflictChunks() const = 0;
+
+ virtual const StrPtr *GetMergeDigest() const { return NULL; }
+ virtual const StrPtr *GetYourDigest() const { return NULL; }
+ virtual const StrPtr *GetTheirDigest() const { return NULL; }
+
+ // Server merge stream handling
+
+ virtual void SetNames( StrPtr *, StrPtr *, StrPtr * ) {};
+ virtual void CopyDigest( StrPtr *, Error * ) {};
+ virtual void SetShowAll() {};
+ virtual void SetDiffFlags( const StrPtr * ) {};
+
+ virtual void Open( StrPtr *name, Error *e, CharSetCvt * = 0,
+ int charset = 0 ) = 0;
+ virtual void Write( StrPtr *buf, StrPtr *bits, Error *e ) = 0;
+ virtual void Close( Error *e ) = 0;
+ virtual void Select( MergeStatus stat, Error *e ) = 0;
+ virtual void Chmod( const char *perms, Error *e ) = 0;
+
+ virtual void SetTheirModTime( StrPtr *modTime ) = 0;
+
+ // Chmod must use 'const char' as the type not 'char'
+ // The following will cause compile time errors for using 'char'
+
+ virtual int Chmod( char *perms, Error *e )
+ { Chmod( (const char *)perms, e ); return 0; };
+
+ protected:
+
+ ClientUser *ui;
+ static const char *const confirm; // confirm overwrite
+
+ int Verify( const Error *message, Error *e );
+
+} ;
+
+# endif /* __CLIENTMERGE__ */
diff --git a/P4Plugin/Source/p4api/include_r21.2/p4/clientprog.h b/P4Plugin/Source/p4api/include_r21.2/p4/clientprog.h
new file mode 100644
index 0000000..3272649
--- /dev/null
+++ b/P4Plugin/Source/p4api/include_r21.2/p4/clientprog.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright 1995, 2011 Perforce Software. All rights reserved.
+ *
+ * This file is part of Perforce - the FAST SCM System.
+ */
+
+// client Progress type
+
+#define CPT_SENDFILE 1
+#define CPT_RECVFILE 2
+#define CPT_FILESTRANS 3
+#define CPT_COMPUTATION 4
+
+#define CPU_UNSPECIFIED 0
+#define CPU_PERCENT 1
+#define CPU_FILES 2
+#define CPU_KBYTES 3
+#define CPU_MBYTES 4
+
+class ClientProgress
+{
+ public:
+ virtual ~ClientProgress() {};
+ virtual void Description( const StrPtr *desc, int units ) = 0;
+ virtual void Total( long ) = 0;
+ virtual int Update( long ) = 0;
+ virtual void Done( int fail ) = 0;
+};
+
+class ClientProgressText : public ClientProgress
+{
+ public:
+ ClientProgressText( int );
+ virtual ~ClientProgressText();
+ void Description( const StrPtr *description, int units );
+ void Total( long );
+ int Update( long );
+ void Done( int fail );
+
+ // Track if we're already in use, multiple will overwrite
+ static bool InUse;
+
+ int GetProgressType() const;
+
+ private:
+ int cnt;
+ long total;
+ int typeOfProgress;
+ int backup;
+ StrBuf desc;
+ bool done;
+
+};
diff --git a/P4Plugin/Source/p4api/include_r21.2/p4/clientresolvea.h b/P4Plugin/Source/p4api/include_r21.2/p4/clientresolvea.h
new file mode 100644
index 0000000..332dca4
--- /dev/null
+++ b/P4Plugin/Source/p4api/include_r21.2/p4/clientresolvea.h
@@ -0,0 +1,136 @@
+/*
+ * Copyright 2010 Perforce Software. All rights reserved.
+ *
+ * This file is part of Perforce - the FAST SCM System.
+ */
+
+#ifndef __CLIENTRESOLVEA__
+#define __CLIENTRESOLVEA__
+
+#include "clientmerge.h"
+
+/*
+ * ClientResolveA - client side "action resolve" controller
+ *
+ * An "action resolve" is a multiple-choice resolve that (generally)
+ * modifies the way that the client file is open, not its contents.
+ *
+ */
+
+class ClientUser;
+
+class ClientResolveA
+{
+ public:
+ // User interface: Resolve() is called to present a command-line
+ // dialog via ClientUser, presenting the Merge/Yours/Their actions
+ // and asking the user to pick one.
+
+ // AutoResolve() returns the server-suggested action. This is
+ // displayed by Resolve() as well.
+
+ MergeStatus AutoResolve( MergeForce force ) const;
+ MergeStatus Resolve( int preview, Error *e );
+
+ const Error &GetType() const { return type; }
+
+ const Error &GetMergeAction() const { return mergeA; }
+ const Error &GetYoursAction() const { return yoursA; }
+ const Error &GetTheirAction() const { return theirA; }
+
+ // For the CLI interface, probably not of interest to others
+
+ const Error &GetMergePrompt() const { return mergeP; }
+ const Error &GetYoursPrompt() const { return yoursP; }
+ const Error &GetTheirPrompt() const { return theirP; }
+
+ const Error &GetMergeOpt() const { return mergeO; }
+ const Error &GetYoursOpt() const { return yoursO; }
+ const Error &GetTheirOpt() const { return theirO; }
+ const Error &GetSkipOpt() const { return skipO; }
+ const Error &GetHelpOpt() const { return helpO; }
+ const Error &GetAutoOpt() const { return autoO; }
+
+ const Error &GetPrompt() const { return prompt; }
+ const Error &GetTypePrompt() const { return typeP; }
+ const Error &GetUsageError() const { return error; }
+ const Error &GetHelp() const { return help; }
+ const Error &GetMoveReaddIntegConflictIgnored() const
+ {
+ return moveReaddIntegConflictIgnored;
+ }
+ const Error &GetMoveReaddIntegConflictSkip() const
+ {
+ return moveReaddIntegConflictSkip;
+ }
+
+ // Called by clientservice while talking to the server
+
+ ClientResolveA( ClientUser *ui );
+
+ void SetMergeAction( const Error &msg ) { mergeA = msg; }
+ void SetYoursAction( const Error &msg ) { yoursA = msg; }
+ void SetTheirAction( const Error &msg ) { theirA = msg; }
+
+ void SetMergePrompt( const Error &msg ) { mergeP = msg; }
+ void SetYoursPrompt( const Error &msg ) { yoursP = msg; }
+ void SetTheirPrompt( const Error &msg ) { theirP = msg; }
+
+ void SetMergeOpt( const Error &msg ) { mergeO = msg; }
+ void SetYoursOpt( const Error &msg ) { yoursO = msg; }
+ void SetTheirOpt( const Error &msg ) { theirO = msg; }
+ void SetHelpOpt ( const Error &msg ) { helpO = msg; }
+ void SetSkipOpt ( const Error &msg ) { skipO = msg; }
+ void SetAutoOpt ( const Error &msg ) { autoO = msg; }
+
+ void SetTypePrompt( const Error &msg ) { typeP = msg; }
+ void SetType( const Error &msg ) { type = msg; }
+
+ void SetPrompt( const Error &msg ) { prompt = msg; }
+ void SetHelp( const Error &msg ) { help = msg; }
+ void SetUsageError( const Error &msg ) { error = msg; }
+
+ void SetMoveReaddIntegConflictIgnored ( const Error &msg )
+ {
+ moveReaddIntegConflictIgnored = msg;
+ }
+
+ void SetMoveReaddIntegConflictSkip( const Error &msg )
+ {
+ moveReaddIntegConflictSkip = msg;
+ }
+
+ void SetAuto( MergeStatus s ) { suggest = s; }
+
+ private:
+
+ ClientUser *ui;
+
+ Error mergeA;
+ Error yoursA;
+ Error theirA;
+
+ Error mergeP;
+ Error yoursP;
+ Error theirP;
+
+ Error mergeO; // "am"
+ Error yoursO; // "ay"
+ Error theirO; // "at"
+ Error helpO; // "?"
+ Error skipO; // "s"
+ Error autoO; // "a"
+
+ Error type;
+ Error typeP;
+ Error help;
+ Error prompt;
+ Error error;
+ Error moveReaddIntegConflictIgnored;
+ Error moveReaddIntegConflictSkip;
+
+ MergeStatus suggest;
+};
+
+
+# endif /* __CLIENTRESOLVEA__ */
diff --git a/P4Plugin/Source/p4api/include_r21.2/p4/clientscript.h b/P4Plugin/Source/p4api/include_r21.2/p4/clientscript.h
new file mode 100644
index 0000000..9834c74
--- /dev/null
+++ b/P4Plugin/Source/p4api/include_r21.2/p4/clientscript.h
@@ -0,0 +1,94 @@
+/*
+ * Copyright 1995, 2019 Perforce Software. All rights reserved.
+ *
+ * This file is part of Perforce - the FAST SCM System.
+ */
+
+# ifdef HAS_EXTENSIONS
+
+enum class ClientScriptAction
+{
+ UNKNOWN,
+ FAIL,
+ PASS,
+ REPLACE
+};
+
+class ClientScript
+{
+ public:
+
+ ClientScript( Client* c );
+ virtual ~ClientScript();
+
+ bool CanLoad() const;
+ bool BuildCheck() const;
+ void SetClient( Client* c );
+ void SetSearchPath( const char* where );
+ void SetSearchPattern( const char* what );
+
+ std::vector< std::unique_ptr< Extension > >& GetExts();
+
+ virtual void LoadScripts( const bool search, Error* e );
+
+ virtual std::tuple< ClientScriptAction, int >
+ Run( const char* cmd, const char* func,
+ ClientUser* u, const bool noReplace,
+ Error* e );
+
+ static SCR_VERSION scrVerFromFileName( const char* file );
+
+ private:
+
+ std::vector< std::tuple< std::string, SCR_VERSION > >
+ FindLooseExts( const StrPtr& start, const bool search, Error* e );
+
+ std::vector< std::unique_ptr< Extension > > exts;
+
+ std::vector< std::string > patterns;
+ StrBuf path;
+ Client* client;
+};
+
+# else
+
+struct ClientScriptAction
+{
+ static const int UNKNOWN = 0;
+ static const int FAIL = 1;
+ static const int PASS = 2;
+ static const int REPLACE = 3;
+
+ bool operator ==( const int o ) const
+ {
+ // Ensure that we can only ever pass in the stub.
+ return o == PASS;
+ }
+};
+
+class ClientScript
+{
+ public:
+
+ ClientScript( Client* c ){}
+ ~ClientScript(){}
+
+ bool CanLoad() const { return false; }
+ bool BuildCheck() const { return false; }
+
+ int& GetExts();
+
+ void LoadScripts( const bool search, Error* e ){}
+
+ ClientScriptAction
+ Run( const char* cmd, const char* func,
+ ClientUser *u, const bool noReplace,
+ Error* e );
+
+ void SetClient( Client* c );
+ void SetSearchPath( const char* where );
+ void SetSearchPattern( const char* what );
+
+};
+
+# endif
diff --git a/P4Plugin/Source/p4api/include_r21.2/p4/clientuser.h b/P4Plugin/Source/p4api/include_r21.2/p4/clientuser.h
new file mode 100644
index 0000000..964f549
--- /dev/null
+++ b/P4Plugin/Source/p4api/include_r21.2/p4/clientuser.h
@@ -0,0 +1,267 @@
+/*
+ * Copyright 1995, 2000 Perforce Software. All rights reserved.
+ *
+ * This file is part of Perforce - the FAST SCM System.
+ */
+
+/*
+ * ClientUser - user interface primitives
+ *
+ * Public classes:
+ *
+ * ClientUser - user interface for client services
+ *
+ * Note that not all methods are always used. Here's a guideline:
+ *
+ * Used by almost all Perforce commands:
+ *
+ * Finished
+ * HandleError
+ * OutputBinary
+ * OutputError
+ * OutputInfo
+ * OutputText
+ * File
+ *
+ * Used only by commands that read the client's stdin:
+ *
+ * InputData
+ *
+ * Used only by 'p4 fstat' and some other commands when the
+ * protocol variable 'tag' is set:
+ *
+ * OutputStat
+ *
+ * Used only by interactive commands that can generally be avoided:
+ *
+ * Diff
+ * Edit
+ * ErrorPause
+ * Prompt
+ *
+ * Used only by the default ClientUser implementation:
+ *
+ * Help
+ * Merge
+ *
+ * Public methods:
+ *
+ * ClientUser::InputData() - provide data to 'p4 spec-command -i';
+ * spec-command is branch, change, client, job, label, protect,
+ * user, etc.
+ *
+ * ClientUser::HandleError() - process error data, the result of a failed
+ * command. Default is to format output and call OutputError().
+ *
+ * ClientUser::Message() - output error or tabular data. This is the
+ * 2002.1 replacement for OutputInfo/Error: earlier servers
+ * will invoke still HandleError() and OutputInfo().
+ *
+ * ClinetUser::OutputError() - output error data, the result of a failed
+ * command.
+ *
+ * ClientUser::OutputInfo() - output tabular data, the result of most
+ * commands that report metadata.
+ *
+ * ClientUser::OutputBinary() - output binary data, generally the result
+ * of 'p4 print binary_file'.
+ *
+ * ClientUser::OutputText() - output text data, generally the result
+ * of 'p4 print text_file'.
+ *
+ * ClientUser::OutputStat() - output results of 'p4 fstat'; requires
+ * calling StrDict::GetVar() to get the actual variable results.
+ *
+ * ClientUser::Prompt() - prompt the user, and wait for a response.
+ * Optionally takes a noOutput flag to suppress the prompt and
+ * just collect the response.
+ *
+ * ClientUser::ErrorPause() - print an error message and wait for the
+ * user before continuing.
+ *
+ * ClientUser::Edit() - bring the user's editor up on a file; generally
+ * part of 'p4 spec-command'.
+ *
+ * ClientUser::Diff() - diff two files, and display the results; the
+ * result of 'p4 diff'. Optionally takes a FileSys object to
+ * direct output to a target file instead of stdout.
+ *
+ * ClientUser::Merge() - merge three files and save the results; the
+ * result of saying 'm' to the resolve dialog of 'p4 resolve'.
+ *
+ * ClientUser::Help() - dump out a block of help text to the user;
+ * used by the resolve dialogs.
+ *
+ * ClientUser::File() - produce a FileSys object for reading
+ * and writing files in client workspace.
+ *
+ * ClientUser::Finished() - called when tagged client call is finished.
+ */
+
+class Enviro;
+class ClientMerge;
+class ClientResolveA;
+class ClientProgress;
+class ClientTransfer;
+class ClientSSO;
+class ClientApi;
+
+class ClientUser {
+
+ public:
+ ClientUser(
+ int autoLoginPrompt = 0,
+ int apiVersion = -1 );
+
+ virtual ~ClientUser();
+
+ virtual void InputData( StrBuf *strbuf, Error *e );
+
+ virtual void HandleError( Error *err );
+ virtual void Message( Error *err );
+ virtual void OutputError( const char *errBuf );
+ virtual void OutputInfo( char level, const char *data );
+ virtual void OutputBinary( const char *data, int length );
+ virtual void OutputText( const char *data, int length );
+
+ virtual void OutputStat( StrDict *varList );
+ virtual int OutputStatPartial( StrDict * ) { return 0; }
+ // The above method returns 0 to carry the fstat partials or non-0
+ // to drop them (return 1 if you print them as you get them)
+
+ virtual void Prompt( Error *err, StrBuf &rsp,
+ int noEcho, Error *e );
+ virtual void Prompt( Error *err, StrBuf &rsp,
+ int noEcho, int noOutput, Error *e );
+ virtual void Prompt( const StrPtr &msg, StrBuf &rsp,
+ int noEcho, Error *e );
+ virtual void Prompt( const StrPtr &msg, StrBuf &rsp,
+ int noEcho, int noOutput, Error *e );
+ virtual void ErrorPause( char *errBuf, Error *e );
+ virtual void HandleUrl( const StrPtr *url );
+
+ virtual void Edit( FileSys *f1, Error *e );
+
+ virtual void Diff( FileSys *f1, FileSys *f2, int doPage,
+ char *diffFlags, Error *e );
+ virtual void Diff( FileSys *f1, FileSys *f2, FileSys *fout,
+ int doPage, char *diffFlags, Error *e );
+
+ virtual void Merge( FileSys *base, FileSys *leg1, FileSys *leg2,
+ FileSys *result, Error *e );
+
+ virtual int Resolve( ClientMerge *m, Error *e );
+ virtual int Resolve( ClientResolveA *r, int preview, Error *e );
+
+ virtual void Help( const char *const *help );
+
+ virtual FileSys *File( FileSysType type );
+ virtual ClientProgress *CreateProgress( int, P4INT64 );
+ virtual ClientProgress *CreateProgress( int );
+ virtual int ProgressIndicator();
+ virtual int CanParallelProgress() { return 0; }
+
+ virtual void Finished() {}
+
+ StrDict *varList; // (cheesy) access to RPC buffer
+ Enviro *enviro; // (cheesy) access to Client's env
+
+ static void Edit( FileSys *f1, Enviro * env, Error *e );
+
+ static void RunCmd( const char *command, const char *arg1,
+ const char *arg2, const char *arg3,
+ const char *arg4, const char *arg5,
+ const char *pager,
+ Error *e );
+
+ virtual void SetOutputCharset( int );
+ virtual void DisableTmpCleanup();
+ virtual void SetQuiet();
+ virtual int CanAutoLoginPrompt();
+ virtual int IsOutputTaggedWithErrorLevel();
+
+ // ClientTransfer allows the threading behavor of parallel sync/submit
+ // to be overridden by the client application. The ClientTransfer will
+ // be deleted with the the ClientUser.
+ virtual void SetTransfer( ClientTransfer* t );
+ virtual ClientTransfer* GetTransfer() { return transfer; }
+
+ // ClientSSO allows the P4LOGINSSO behavor to be overriden from the
+ // application using the P4API. This is intended for use where an SSO
+ // agent would not be able to be directly invoked on the user's machine
+ virtual void SetSSOHandler( ClientSSO* t );
+ virtual ClientSSO* GetSSOHandler() { return ssoHandler; }
+
+ // Output... and Help must use 'const char' instead of 'char'
+ // The following will cause compile time errors for using 'char'
+ virtual int OutputError( char *errBuf )
+ { OutputError( (const char *)errBuf ); return 0; }
+ virtual int OutputInfo( char level, char *data )
+ { OutputInfo( level, (const char *)data ); return 0; }
+ virtual int OutputBinary( char *data, int length )
+ { OutputBinary( (const char *)data, length ); return 0; }
+ virtual int OutputText( char *data, int length )
+ { OutputText( (const char *)data, length ); return 0; }
+ virtual int Help( char *const *help )
+ { Help( (const char * const *)help ); return 0; }
+
+ private:
+ int binaryStdout; // stdout is in binary mode
+ int quiet; // OutputInfo does nothing.
+ int autoLogin; // Can this implementation autoprompt
+
+ protected:
+ int outputCharset; // P4CHARSET for output
+ StrBuf editFile;
+ int outputTaggedWithErrorLevel; // "p4 -s cmd" yes/no
+ int apiVer;
+ ClientTransfer *transfer;
+ ClientSSO *ssoHandler;
+
+} ;
+
+class ClientUserProgress : public ClientUser {
+ public:
+ ClientUserProgress( int autoLoginPrompt = 0,
+ int apiVersion = -1 ) :
+ ClientUser( autoLoginPrompt, apiVersion ) {}
+ virtual ClientProgress *CreateProgress( int );
+ virtual int ProgressIndicator();
+} ;
+
+class ClientTransfer {
+ public:
+ virtual ~ClientTransfer() {}
+
+ virtual int Transfer( ClientApi *client,
+ ClientUser *ui,
+ const char *cmd,
+ StrArray &args,
+ StrDict &pVars,
+ int threads,
+ Error *e ) = 0;
+};
+
+enum ClientSSOStatus {
+ CSS_PASS, // SSO succeeded (result is an authentication token)
+ CSS_FAIL, // SSO failed (result will be logged as error message)
+ CSS_UNSET, // Client has no SSO support
+ CSS_EXIT, // Stop login process
+ CSS_SKIP // Fall back to default P4API behavior
+};
+
+class ClientSSO {
+ public:
+ virtual ~ClientSSO() {}
+
+ virtual ClientSSOStatus Authorize( StrDict &vars,
+ int maxLength,
+ StrBuf &result ) = 0;
+};
+
+/*
+ * StrDict now provides the GetVar() interface for OutputStat();
+ * ClientVarList defined for backward compatability.
+ */
+
+typedef StrDict ClientVarList;
diff --git a/P4Plugin/Source/p4api/include_r21.2/p4/datetime.h b/P4Plugin/Source/p4api/include_r21.2/p4/datetime.h
new file mode 100644
index 0000000..6e7824b
--- /dev/null
+++ b/P4Plugin/Source/p4api/include_r21.2/p4/datetime.h
@@ -0,0 +1,148 @@
+/*
+ * Copyright 1995, 1996 Perforce Software. All rights reserved.
+ *
+ * This file is part of Perforce - the FAST SCM System.
+ */
+
+/*
+ * DateTime - get and set the date as a string
+ */
+
+// size for Fmt, FmtDay
+
+# define DateTimeBufSize 20
+
+// size for FmtTz, which can say things like '0700 - Pacific Standard Time'
+
+# define DateTimeZoneBufSize 80
+
+class DateTime {
+
+ public:
+ DateTime() {}
+ DateTime( const int date ) { Set( date ); }
+ DateTime( const char *date, Error *e ) { Set( date, e ); }
+
+ void Set( const char *date, Error *e );
+ void Set( const int date ) { wholeDay = 0; tval = (time_t)date; }
+ void SetNow() { Set( (int)Now() ); }
+
+ int Compare( const DateTime &t2 ) const {
+ return (int)(tval - t2.tval); };
+
+ void Fmt( char *buf ) const;
+ void FmtDay( char *buf ) const;
+ void FmtDayUTC( char *buf ) const;
+ void FmtTz( char *buf ) const;
+ void FmtUTC( char *buf ) const;
+ void FmtElapsed( char *buf, const DateTime &t2 );
+ void FmtUnifiedDiff( char *buf ) const;
+ void FmtISO8601( char *buf ) const;
+
+ void SetGit( const StrPtr &gitDate, Error *e );
+ void FmtGit( StrBuf &buf ) const;
+
+ int Value() const { return (int)tval; }
+ int Tomorrow() const { return (int)tval + 24*60*60; }
+ int IsWholeDay() const { return wholeDay; }
+
+ static int Never() { return 0; }
+ static int Forever() { return 2147483647; }
+
+ // for stat() and utime() conversion
+
+ static time_t Localize( time_t centralTime );
+ static time_t Centralize( time_t localTime );
+ int TzOffset( int *isdst = 0 ) const;
+
+ protected:
+ time_t Now();
+
+ private:
+ time_t tval;
+ int wholeDay;
+
+ int ParseOffset( const char *s, const char *odate, Error *e );
+};
+
+class DateTimeNow : public DateTime {
+
+ public:
+ DateTimeNow() { Set( Now() ); }
+
+} ;
+
+// Pass a buffer of at least this size to DateTimeHighPrecision::Fmt():
+
+# define DTHighPrecisionBufSize 40
+
+/*
+ * Uses gettimeofday/clock_gettime/etc. to find more precise system time
+ */
+class DateTimeHighPrecision
+{
+ public:
+
+ // Orthodox Canonical Form (OCF) methods (we don't need a dtor)
+ DateTimeHighPrecision(time_t secs = 0, int nsecs = 0)
+ : seconds( secs ), nanos( nsecs ) { }
+
+ DateTimeHighPrecision(const DateTimeHighPrecision &rhs)
+ : seconds( rhs.seconds ), nanos( rhs.nanos ) { }
+
+ DateTimeHighPrecision &
+ operator=( const DateTimeHighPrecision &rhs );
+
+ DateTimeHighPrecision &
+ operator+=( const DateTimeHighPrecision &rhs );
+
+ DateTimeHighPrecision &
+ operator-=( const DateTimeHighPrecision &rhs );
+
+ bool
+ operator==(
+ const DateTimeHighPrecision &rhs) const;
+
+ bool
+ operator!=(
+ const DateTimeHighPrecision &rhs) const;
+
+ bool
+ operator<(
+ const DateTimeHighPrecision &rhs) const;
+
+ bool
+ operator<=(
+ const DateTimeHighPrecision &rhs) const;
+
+ bool
+ operator>(
+ const DateTimeHighPrecision &rhs) const;
+
+ bool
+ operator>=(
+ const DateTimeHighPrecision &rhs) const;
+
+ void Now();
+ void Fmt( char *buf ) const;
+
+ time_t Seconds() const;
+ int Nanos() const;
+
+ bool IsZero() const { return seconds == 0 && nanos == 0; }
+
+ // return (t2 - *this) in nanoseconds
+ P4INT64 ElapsedNanos( const DateTimeHighPrecision &t2 ) const;
+
+ void FmtElapsed( StrBuf &buf, const DateTimeHighPrecision t2 ) const;
+ // return < 0, = 0, or > 0 if *this < rhs, *this == rhs, or *this > rhs, respectively
+ int Compare( const DateTimeHighPrecision &rhs ) const;
+
+ private:
+
+ P4INT64 ToNanos() const;
+
+ time_t seconds; // Since 1/1/1970, natch
+ int nanos;
+} ;
+
diff --git a/P4Plugin/Source/p4api/include_r21.2/p4/debug.h b/P4Plugin/Source/p4api/include_r21.2/p4/debug.h
new file mode 100644
index 0000000..44e5b4a
--- /dev/null
+++ b/P4Plugin/Source/p4api/include_r21.2/p4/debug.h
@@ -0,0 +1,199 @@
+/*
+ * Copyright 1995, 2003 Perforce Software. All rights reserved.
+ *
+ * This file is part of Perforce - the FAST SCM System.
+ */
+
+// Note: not all debug type below (P4DebugType) uses
+// this debuglevel enum.
+enum P4DebugLevel {
+ DL_NONE, // 0 means no debugging output
+ DL_ERROR, // 1
+ DL_WARNING, // 2
+ DL_INFO, // 3
+ DL_DETAILED, // 4
+ DL_DEBUG, // 5
+} ;
+
+class StrPtr;
+class StrBuf;
+class ErrorLog;
+class Error;
+
+enum P4DebugType {
+ DT_DB, // DbOpen
+ DT_DIFF, // Diff
+ DT_DM, // Dm
+ DT_DMC, // Dm commands
+ DT_FTP, // Ftp Server
+ DT_HANDLE, // Handles
+ DT_LBR, // Lbr
+ DT_MAP, // MapTable
+ DT_NET, // Net
+ DT_OPTIONS, // Optional behavior
+ DT_PEEK, // Peeking
+ DT_RCS, // RCS
+ DT_RECORDS, // VarRecords
+ DT_RPC, // Rpc
+ DT_SERVER, // Server
+ DT_SPEC, // Spec
+ DT_TRACK, // Track
+ DT_OB, // Offline Broker
+ DT_VIEWGEN, // Streamw view generator
+ DT_RPL, // Distributed functionality related
+ DT_SSL, // SSL related
+ DT_TIME, // Add timestamps to debug output
+ DT_CLUSTER, // Cluster related
+ DT_ZK, // p4zk related
+ DT_LDAP, // LDAP related
+ DT_DVCS, // DVCS related
+ DT_GRAPH, // GRAPH related
+ DT_GCONN, // gconn related
+ DT_FOVR, // Failover related
+ DT_SCRIPT, // scripting support
+ DT_STG, // Tracking storage records.
+ DT_THREAD, // threading
+ DT_EXTS, // exts (extension)
+ DT_PROTECT, // protections stats
+ DT_HEARTBEAT, // Heartbeat related
+ DT_SHELVE, // Shelving related
+ DT_SQW, // StreamQWorker related
+ DT_TOPOLOGY, // Topology
+ DT_LAST
+} ;
+
+enum P4TunableType {
+ DTT_NONE, // Unknown tuneable
+ DTT_INT, // Numeric tuneable
+ DTT_STR, // String tuneable
+};
+
+extern P4MT int list2[];
+
+class P4Tunable {
+
+ public:
+
+ void Set( const char *set );
+ void SetTLocal( const char *set );
+ void Unset( const char *set );
+ int Get( int t ) const {
+ return t < DT_LAST && list2[t] != -1 && list2[t] > list[t].value ?
+ list2[t] : list[t].value;
+ }
+ int GetLevel( const char *n ) const;
+ StrBuf GetString( const char *n ) const;
+ StrBuf GetString( int t ) const;
+ int GetIndex( const char *n ) const;
+ const char *GetName( int t ) const { return list[t].name; }
+ int IsSet( int t ) const { return list[t].isSet; }
+ int IsSet( const char * n ) const;
+ int IsKnown( const char * n );
+ int IsNumeric( const char * n );
+ void IsValid( const char * n, const char * v, Error *e );
+ int IsSensitive( int t ) const { return list[t].sensitive;}
+ void Unbuffer();
+ void UnsetAll();
+
+ /*
+ * The intended use for this method, which only sets the active
+ * value for a tunable, is to set a specific value that will be used
+ * at a lower layer and the value cannot otherwise be passed into the
+ * lower layer. The need to use this method should be rare.
+ */
+ void SetActive( int t, int v );
+
+ protected:
+
+ static struct tunable {
+ const char *name;
+ int isSet;
+ int value;
+ int minVal;
+ int maxVal;
+ int modVal;
+ int k; // what's 1k? 1000 or 1024?
+ int original;
+ int sensitive;
+ } list[];
+
+ static struct stunable {
+ const char *name;
+ int isSet;
+ const char *def;
+ char *value;
+ int sensitive;
+ } slist[];
+} ;
+
+typedef void (*DebugOutputHook)( void *context, const StrPtr *buffer );
+
+class P4DebugConfig {
+ public:
+ P4DebugConfig();
+ virtual ~P4DebugConfig();
+ virtual void Output();
+ virtual StrBuf *Buffer();
+ virtual int Alloc( int );
+ void Install();
+ void SetErrorLog( ErrorLog *e ) { elog = e; }
+ void SetOutputHook( void *ctx, DebugOutputHook hk )
+ { hook = hk; context = ctx; }
+
+ static void TsPid2StrBuf( StrBuf &prefix );
+
+ protected:
+ StrBuf *buf;
+ int msz;
+ ErrorLog *elog;
+ DebugOutputHook hook;
+ void *context;
+};
+
+class P4Debug : private P4Tunable {
+
+ public:
+
+ void SetLevel( int l );
+ void SetLevel( const char *set );
+ void SetLevel( P4DebugType t, int l ) { list[t].value = l ;}
+
+ int GetLevel( P4DebugType t ) const { return Get(t); }
+
+ void ShowLevels( int showAll, StrBuf &buf );
+
+ void Event();
+
+ void printf( const char *fmt, ... );
+
+};
+
+/*
+ * DEBUGPRINT and DEBUGPRINTF are generic debug macros.
+ * These macros simply check to see if the passed condition
+ * is true and if so prints out the message. The latter macro
+ * takes arguments.
+ *
+ * It is expected that the underlying sub-project will
+ * construct macros that that encapsulate the comparison
+ * of their area's debug flag against specific levels:
+ * e.g. # define DEBUG_SVR_ERROR ( p4debug.GetLevel( DT_SERVER ) >= 1 )
+ * # define DEBUG_SVR_WARN ( p4debug.GetLevel( DT_SERVER ) >= 2 )
+ * # define DEBUG_SVR_INFO ( p4debug.GetLevel( DT_SERVER ) >= 4 )
+ */
+# define DEBUGPRINT(level, msg) \
+ do \
+ { \
+ if( level ) \
+ p4debug.printf( msg "\n" ); \
+ } while(0);
+
+# define DEBUGPRINTF( level, msg, ... ) \
+ do \
+ { \
+ if( level ) \
+ p4debug.printf( msg "\n", __VA_ARGS__ ); \
+ } while(0);
+
+extern P4Debug p4debug;
+extern P4Tunable p4tunable;
diff --git a/P4Plugin/Source/p4api/include_r21.2/p4/diff.h b/P4Plugin/Source/p4api/include_r21.2/p4/diff.h
new file mode 100644
index 0000000..3e76dc1
--- /dev/null
+++ b/P4Plugin/Source/p4api/include_r21.2/p4/diff.h
@@ -0,0 +1,100 @@
+/*
+ * Copyright 1997 Perforce Software. All rights reserved.
+ *
+ * This file is part of Perforce - the FAST SCM System.
+ *
+ * Diff code written by James Strickland, May 1997.
+ */
+
+/*
+ * Diff walkers: produce output according to diff style by walking
+ * the diff results.
+ *
+ * Classes defined:
+ *
+ * Diff - compare two files, outputting the differences
+ * DiffFlags - parse diff's -d
+ *
+ * Diff::Diff - set up for diff output
+ * Diff::DiffWithFlags - produces diff output according to flags
+ * Diff::DiffContext - produces diff -c output to a file
+ * Diff::DiffUnified - produces diff -u output to a file
+ * Diff::DiffNorm - produces normal diff output to a file
+ * Diff::DiffRcs - produces diff -n output to a file
+ * Diff::DiffHTML - produces html markup
+ * Diff::DiffSummary - produces a single summary line
+ *
+ * Diff::CloseOutput - finish write and collect error status
+ */
+
+class DiffAnalyze;
+class DiffFlags;
+class Error;
+class FileSys;
+class Sequence;
+class StrPtr;
+typedef signed int LineNo;
+
+class Diff {
+
+ public:
+
+ Diff();
+ ~Diff();
+
+ void SetInput( FileSys *fx, FileSys *fy,
+ const DiffFlags &flags, Error *e );
+ void SetOutput( const char *fout, Error *e );
+ void SetOutput( FILE *fout );
+ void CloseOutput( Error *e );
+
+ void DiffWithFlags( const DiffFlags &flags );
+
+ void DiffContext( int c = 0 );
+ void DiffUnified( int c = 0 );
+ void DiffUnifiedDeleteFile( FileSys *f, Error *e );
+ void DiffNorm();
+ void DiffRcs();
+ void DiffHTML();
+ void DiffSummary();
+
+ void DiffFast() { fastMaxD = 1; }
+
+ int GetChunkCnt() { return (chunkCnt); }
+
+ int IsIdentical();
+
+ private:
+
+ void Walker( const char *flags, Sequence *s,
+ LineNo sx, LineNo sy );
+
+ Sequence *spx;
+ Sequence *spy;
+ FILE *out;
+ DiffAnalyze *diff;
+ const DiffFlags *flags;
+ int closeOut;
+ LineType lineType;
+ const char *newLines;
+ int fastMaxD;
+ int chunkCnt;
+
+} ;
+
+class DiffFlags {
+
+ public:
+ DiffFlags() { Init( "" ); }
+ DiffFlags( const char *flags ) { Init( flags ); }
+ DiffFlags( const StrPtr *flags ) { Init( flags ); }
+
+ void Init( const char *flags );
+ void Init( const StrPtr *flags );
+
+ enum Type { Normal, Context, Unified, Rcs, HTML, Summary } type;
+ enum Sequence { Line, Word, DashL, DashB, DashW, WClass } sequence;
+ enum Grid { Optimal, Guarded, TwoWay, Diff3, GuardedDiff3 } grid;
+
+ int contextCount;
+} ;
diff --git a/P4Plugin/Source/p4api/include_r21.2/p4/diffmerge.h b/P4Plugin/Source/p4api/include_r21.2/p4/diffmerge.h
new file mode 100644
index 0000000..46de41c
--- /dev/null
+++ b/P4Plugin/Source/p4api/include_r21.2/p4/diffmerge.h
@@ -0,0 +1,134 @@
+/*
+ * Copyright 1995, 1996 Perforce Software. All rights reserved.
+ *
+ * This file is part of the Library RCS. See rcstest.c.
+ */
+
+/*
+ * diffmerge.h - 3 way file merge
+ *
+ * Classes defined:
+ *
+ * DiffMerge - control block for merging
+ *
+ * Public methods:
+ *
+ * DiffMerge::DiffMerge() - Merge 3 files to produce integrated result
+ * DiffMerge::~DiffMerge() - dispose of DiffMerge and its contents
+ * DiffMerge::Read() - produce next part of integrated result
+ *
+ * History:
+ * 2-18-97 (seiwald) - translated to C++.
+ */
+
+/*
+ * SELBITS - the return value from DiffMergeRead
+ *
+ * 0 means no more output; otherwise the bits are set according to what
+ * outputfile is to take the next piece. The length of DiffMergeRead
+ * can be zero while the bits returned are non-zero: this indicates a
+ * zero length chunk to be placed in the output file.
+ *
+ * SEL_CONF indicates a conflict, and is set for each of the legs that
+ * are in conflict, including the base. Thus for a conflict the follow
+ * sequence will be seen:
+ *
+ * SEL_CONF | SEL_BASE
+ * SEL_CONF | SEL_LEG1 | SEL_RSLT
+ * SEL_CONF | SEL_LEG2 | SEL_RSLT
+ *
+ * If changes are identical both lines, they are not in conflict. The
+ * sequence is:
+ *
+ * SEL_BASE
+ * SEL_LEG1 | SEL_LEG2 | SEL_RSLT
+ *
+ * SEL_ALL indicates chunks synchronized between all 3 files. The
+ * actual text comes from LEG2, so that if the underlying diff is
+ * ignoring certain changes (like whitespace), the resulting merge
+ * will have the last leg (typically "yours") rather than the original
+ * unchanged base.
+ */
+
+# define SEL_BASE 0x01
+# define SEL_LEG1 0x02
+# define SEL_LEG2 0x04
+# define SEL_RSLT 0x08
+# define SEL_ALL (SEL_BASE|SEL_LEG1|SEL_LEG2|SEL_RSLT)
+# define SEL_CONF 0x10
+
+class DiffAnalyze;
+class DiffDFile;
+class DiffFfile;
+class DiffFlags;
+
+enum DiffDiffs {
+ DD_EOF, // End of df1/df2
+ DD_LEG1, // df1 up next
+ DD_LEG2, // df2 up next
+ DD_BOTH, // df1, df2 overlap
+ DD_CONF, // df1, df2 conflict
+ DD_ALL, // all lines
+ DD_LAST
+} ;
+
+enum GridTypes {
+ GRT_OPTIMAL, // Optimal grid type
+ GRT_GUARDED, // Guarded grid type
+ GRT_TWOWAY // Two way grid type
+} ;
+
+typedef offL_t LineLen;
+
+class DiffMerge {
+
+ public:
+ DiffMerge( FileSys *base, FileSys *leg1, FileSys *leg2,
+ const DiffFlags &fl, LineType lineType, Error *e );
+
+ ~DiffMerge();
+
+ int Read( char *buf, int len, int *outlen );
+
+ const char *BitNames( int bits );
+
+ LineLen MaxLineLength() const;
+
+ private:
+
+ DiffDiffs DiffDiff();
+
+ /* State machine for merging. */
+
+ DiffDiffs diffDiff;
+ GridTypes gridType;
+ int state;
+ int oldMode;
+ int diff3behavior;
+
+ /* Base->Yours diff, Base->Theirs diff. */
+
+ DiffDFile *df1;
+ DiffDFile *df2;
+ DiffDFile *df3;
+
+ /* Base, yours, theirs. */
+
+ DiffFfile *bf;
+ DiffFfile *lf1;
+ DiffFfile *lf2;
+
+ /* Empty base */
+
+ FileSys *emptyFile;
+
+ /*
+ * For returning data from Read():
+ * what leg we're reading from,
+ * what selbits we're returning
+ */
+
+ DiffFfile *readFile;
+ int selbits;
+} ;
+
diff --git a/P4Plugin/Source/p4api/include_r21.2/p4/dmextension.h b/P4Plugin/Source/p4api/include_r21.2/p4/dmextension.h
new file mode 100644
index 0000000..8bf5418
--- /dev/null
+++ b/P4Plugin/Source/p4api/include_r21.2/p4/dmextension.h
@@ -0,0 +1,151 @@
+/*
+ * Copyright 1995, 2018 Perforce Software. All rights reserved.
+ *
+ * This file is part of Perforce - the FAST SCM System.
+ */
+
+# ifdef HAS_EXTENSIONS
+
+# include