pvpgn-twilight 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Changes +5 -1
- data/examples/pvpgn_test.rb +4 -1
- data/ext/pvpgn.c +10 -5
- data/pvpgn-twilight.gemspec +1 -1
- metadata +1 -1
data/Changes
CHANGED
data/examples/pvpgn_test.rb
CHANGED
@@ -1,2 +1,5 @@
|
|
1
1
|
require 'pvpgn'
|
2
|
-
puts PVPGN
|
2
|
+
#puts 'PVPGN Gem Version:' + PVPGN::Version
|
3
|
+
puts 'the following will hash to 2e0236a3649381fe99cdce4b5b59adffa3167c7b:'
|
4
|
+
puts 'hello -> ' + PVPGN::BNHash('hello') #will hash to: 2e0236a3649381fe99cdce4b5b59adffa3167c7b
|
5
|
+
puts 'HELLO -> ' + PVPGN::BNHash('HELLO') #will hash to: 2e0236a3649381fe99cdce4b5b59adffa3167c7b
|
data/ext/pvpgn.c
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#define PVPGN_TWILIGHT_VERSION "0.2.3"
|
2
2
|
#define PVPGN_TWILIGHT_MODULE "PVPGN"
|
3
|
-
|
3
|
+
#define __TEST__ 0
|
4
4
|
/**************************************************/
|
5
5
|
/*/ /*/
|
6
6
|
/*/ Comments & Notes /*/
|
@@ -14,7 +14,7 @@
|
|
14
14
|
linux/ruby linkage bug
|
15
15
|
*/
|
16
16
|
|
17
|
-
#
|
17
|
+
#if ( __TEST__ )
|
18
18
|
#include <stdio.h>
|
19
19
|
#else
|
20
20
|
//#include "d2bitstream.h"
|
@@ -40,7 +40,11 @@
|
|
40
40
|
//Register a variable arg func for a class
|
41
41
|
#define RUBY_RegisterClassFunc(c,x) rb_define_method(c,#x,x,-1)
|
42
42
|
//Register a set arg func for a class
|
43
|
-
#define
|
43
|
+
#define RUBY_RegisterClassFuncEx(c,x,a) rb_define_method(c,#x,x,a)
|
44
|
+
//Register a global variable
|
45
|
+
#define RUBY_RegisterGlobalVariable(x,y) rb_define_global_const(#x,y)
|
46
|
+
//Register a Module Variable
|
47
|
+
#define RUBY_RegisterVariable(x,y) rb_define_const(RUBY_Module,#x,y)
|
44
48
|
|
45
49
|
|
46
50
|
/**************************************************/
|
@@ -313,10 +317,10 @@ static char* PVPGN_CreateHash(char* pHash, signed int nSize, char pHashOut[41])
|
|
313
317
|
UTILITY_HexToText(&pHashOut[i * 8],dwHash[i],0);
|
314
318
|
}
|
315
319
|
|
316
|
-
return pHashOut;
|
320
|
+
return &pHashOut[0];
|
317
321
|
}
|
318
322
|
|
319
|
-
#
|
323
|
+
#if ( __TEST__ )
|
320
324
|
/**************************************************/
|
321
325
|
/*/ /*/
|
322
326
|
/*/ Testing /*/
|
@@ -368,6 +372,7 @@ void Init_pvpgn()
|
|
368
372
|
VALUE RUBY_Module;
|
369
373
|
|
370
374
|
RUBY_Module = rb_define_module(PVPGN_TWILIGHT_MODULE);
|
375
|
+
RUBY_RegisterVariable(Version,rb_str_new2(PVPGN_TWILIGHT_VERSION));
|
371
376
|
RUBY_RegisterFunc(BNHash);
|
372
377
|
}
|
373
378
|
#endif
|
data/pvpgn-twilight.gemspec
CHANGED