p4ruby 2022.1.2359956-x64-mingw-ucrt
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +484 -0
- data/README.md +17 -0
- data/ext/P4/clientprogressruby.cpp +98 -0
- data/ext/P4/clientprogressruby.h +52 -0
- data/ext/P4/clientuserruby.cpp +979 -0
- data/ext/P4/clientuserruby.h +158 -0
- data/ext/P4/extconf.rb +634 -0
- data/ext/P4/gc_hack.h +10 -0
- data/ext/P4/p4.cpp +1509 -0
- data/ext/P4/p4clientapi.cpp +841 -0
- data/ext/P4/p4clientapi.h +263 -0
- data/ext/P4/p4error.cpp +137 -0
- data/ext/P4/p4error.h +62 -0
- data/ext/P4/p4mapmaker.cpp +459 -0
- data/ext/P4/p4mapmaker.h +69 -0
- data/ext/P4/p4mergedata.cpp +272 -0
- data/ext/P4/p4mergedata.h +97 -0
- data/ext/P4/p4result.cpp +260 -0
- data/ext/P4/p4result.h +86 -0
- data/ext/P4/p4rubydebug.h +46 -0
- data/ext/P4/p4specdata.cpp +137 -0
- data/ext/P4/p4specdata.h +54 -0
- data/ext/P4/p4utils.cpp +62 -0
- data/ext/P4/p4utils.h +46 -0
- data/ext/P4/specmgr.cpp +700 -0
- data/ext/P4/specmgr.h +104 -0
- data/ext/P4/undefdups.h +64 -0
- data/lib/2.7/P4.so +0 -0
- data/lib/3.0/P4.so +0 -0
- data/lib/3.1/P4.so +0 -0
- data/lib/P4/version.rb +3 -0
- data/lib/P4.rb +688 -0
- data/lib/P4.so +0 -0
- metadata +76 -0
data/ext/P4/specmgr.h
ADDED
@@ -0,0 +1,104 @@
|
|
1
|
+
/*******************************************************************************
|
2
|
+
|
3
|
+
Copyright (c) 2001-2008, Perforce Software, Inc. All rights reserved.
|
4
|
+
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
7
|
+
|
8
|
+
1. Redistributions of source code must retain the above copyright
|
9
|
+
notice, this list of conditions and the following disclaimer.
|
10
|
+
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright
|
12
|
+
notice, this list of conditions and the following disclaimer in the
|
13
|
+
documentation and/or other materials provided with the distribution.
|
14
|
+
|
15
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
16
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
17
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
18
|
+
ARE DISCLAIMED. IN NO EVENT SHALL PERFORCE SOFTWARE, INC. BE LIABLE FOR ANY
|
19
|
+
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
20
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
21
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
22
|
+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
23
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
24
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
25
|
+
|
26
|
+
*******************************************************************************/
|
27
|
+
|
28
|
+
/*******************************************************************************
|
29
|
+
* Name : specmgr.h
|
30
|
+
*
|
31
|
+
* Author : Tony Smith <tony@perforce.com> or <tony@smee.org>
|
32
|
+
*
|
33
|
+
* Description : Ruby bindings for the Perforce API. Class for handling
|
34
|
+
* Perforce specs. This class provides other classes with
|
35
|
+
* generic support for parsing and formatting Perforce
|
36
|
+
* specs.
|
37
|
+
*
|
38
|
+
******************************************************************************/
|
39
|
+
|
40
|
+
class StrBufDict;
|
41
|
+
class SpecMgr
|
42
|
+
{
|
43
|
+
public:
|
44
|
+
SpecMgr();
|
45
|
+
~SpecMgr();
|
46
|
+
void SetDebug( int i ) { debug = i; }
|
47
|
+
void SetArrayConversion( int a) { convertArray = a; }
|
48
|
+
|
49
|
+
// Clear the spec cache and revert to internal defaults
|
50
|
+
void Reset();
|
51
|
+
|
52
|
+
// Add a spec to the cache
|
53
|
+
void AddSpecDef( const char *type, StrPtr &specDef );
|
54
|
+
void AddSpecDef( const char *type, const char * specDef );
|
55
|
+
|
56
|
+
// Check that a type of spec is known.
|
57
|
+
int HaveSpecDef( const char *type );
|
58
|
+
|
59
|
+
//
|
60
|
+
// Parse routine: converts strings into Ruby P4::Spec objects.
|
61
|
+
//
|
62
|
+
VALUE StringToSpec( const char *type, const char *spec, Error *e );
|
63
|
+
|
64
|
+
//
|
65
|
+
// Format routine. updates a StrBuf object with the form;
|
66
|
+
// that can then be converted to a Ruby string where required.
|
67
|
+
//
|
68
|
+
void SpecToString(const char *type, VALUE hash, StrBuf &b, Error *e);
|
69
|
+
|
70
|
+
//
|
71
|
+
// Convert a Perforce StrDict into a Ruby hash. Used when we're
|
72
|
+
// parsing tagged output that is NOT a spec. e.g. output of
|
73
|
+
// fstat etc.
|
74
|
+
//
|
75
|
+
VALUE StrDictToHash( StrDict *dict, VALUE hash = Qnil );
|
76
|
+
|
77
|
+
//
|
78
|
+
// Convert a Perforce StrDict into a P4::Spec object. This is for
|
79
|
+
// 2005.2 and later servers where the forms are supplied pre-parsed
|
80
|
+
// into a dictionary - we just need to convert them. The specDef
|
81
|
+
// argument tells us what type of spec we're converting.
|
82
|
+
//
|
83
|
+
VALUE StrDictToSpec( StrDict *dict, StrPtr *specDef );
|
84
|
+
|
85
|
+
|
86
|
+
//
|
87
|
+
// Return a list of the fields in a given type of spec. Return Qnil
|
88
|
+
// if the spec type is not known.
|
89
|
+
//
|
90
|
+
VALUE SpecFields( const char *type );
|
91
|
+
|
92
|
+
private:
|
93
|
+
|
94
|
+
void SplitKey( const StrPtr *key, StrBuf &base, StrBuf &index );
|
95
|
+
void InsertItem( VALUE hash, const StrPtr *var, const StrPtr *val );
|
96
|
+
VALUE NewSpec( StrPtr *specDef );
|
97
|
+
VALUE SpecFields( StrPtr *specDef );
|
98
|
+
|
99
|
+
private:
|
100
|
+
int debug;
|
101
|
+
int convertArray;
|
102
|
+
StrBufDict * specs;
|
103
|
+
};
|
104
|
+
|
data/ext/P4/undefdups.h
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
/*******************************************************************************
|
2
|
+
|
3
|
+
Copyright (c) 2001-2008, Perforce Software, Inc. All rights reserved.
|
4
|
+
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
7
|
+
|
8
|
+
1. Redistributions of source code must retain the above copyright
|
9
|
+
notice, this list of conditions and the following disclaimer.
|
10
|
+
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright
|
12
|
+
notice, this list of conditions and the following disclaimer in the
|
13
|
+
documentation and/or other materials provided with the distribution.
|
14
|
+
|
15
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
16
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
17
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
18
|
+
ARE DISCLAIMED. IN NO EVENT SHALL PERFORCE SOFTWARE, INC. BE LIABLE FOR ANY
|
19
|
+
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
20
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
21
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
22
|
+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
23
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
24
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
25
|
+
|
26
|
+
*******************************************************************************/
|
27
|
+
|
28
|
+
/*******************************************************************************
|
29
|
+
* Name : undefdups.h
|
30
|
+
*
|
31
|
+
* Author : Tony Smith <tony@perforce.com> or <tony@smee.org>
|
32
|
+
*
|
33
|
+
* Description : Undefine portability macros defined by both Ruby's header
|
34
|
+
* files and those of the Perforce API. The idea is that you
|
35
|
+
* first include Ruby's headers, then this file, and then the
|
36
|
+
* Perforce API. This squelches any compiler warnings about
|
37
|
+
* pre-processor macros already being defined.
|
38
|
+
*
|
39
|
+
******************************************************************************/
|
40
|
+
|
41
|
+
//
|
42
|
+
// Symbols defined by both Ruby and Perforce API headers
|
43
|
+
//
|
44
|
+
#undef HAVE_FSYNC
|
45
|
+
#undef HAVE_TRUNCATE
|
46
|
+
|
47
|
+
#ifdef _WIN32
|
48
|
+
|
49
|
+
// Unnecessary "#define SetPort SetPortA" in winspool.h
|
50
|
+
# ifdef SetPort
|
51
|
+
# undef SetPort
|
52
|
+
# endif
|
53
|
+
|
54
|
+
// GetMessage often #defined to GetMessageA
|
55
|
+
# ifdef GetMessage
|
56
|
+
# undef GetMessage
|
57
|
+
# endif
|
58
|
+
|
59
|
+
#endif
|
60
|
+
|
61
|
+
#ifdef HAVE_FORK
|
62
|
+
# undef HAVE_FORK
|
63
|
+
#endif
|
64
|
+
|
data/lib/2.7/P4.so
ADDED
Binary file
|
data/lib/3.0/P4.so
ADDED
Binary file
|
data/lib/3.1/P4.so
ADDED
Binary file
|
data/lib/P4/version.rb
ADDED