1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
#include "GS5_Intf.h"

#include <assert.h>

#ifdef _MSC_VER
#include <Windows.h>
#else
#include <stdio.h>
#include <dlfcn.h>
#include <string>
#endif



namespace gs {

#define MIN_API_INDEX 2
#define MAX_API_INDEX 162

#ifndef NULL
#define NULL ((void*)0)
#endif

static void * apis[MAX_API_INDEX+1];

#ifndef _WINDOWS_
//Unix: image base of gsCore
static void * s_core = NULL;
#endif

//Resolve all gsCore apis dynamically, must be called before any other apis
static bool resolveAPIs(void){
	static bool inited = false;
	if(inited) return true;

	int i;
	
	for(i = MIN_API_INDEX; i <= MAX_API_INDEX; i++){
		apis[i] = NULL;
	}

#if defined(_WINDOWS_)
	HMODULE h = LoadLibraryA("gsCore.dll");
	if (h){
		for(i = MIN_API_INDEX; i <= MAX_API_INDEX; i++){
			apis[i] = GetProcAddress(h, (const char*)i);
		}
	}
#else
	//Mac wrapped core, if loaded, will set its image base in environment
	void * h = NULL;
	char* p = getenv("GS_CORE_BASE");
	if(p){
		//Already loaded in memory p;
		sscanf(p, "%p", &h);
		printf("GS_CORE_BASE = [%p]", h);
	}else{
		//Load it from the directory side by side with *this* module (lib or exe)
		char buf[4096];

		dl_info di;
		const char* core = "libgsCore.dylib";
		if(dladdr(&apis, &di)){
			std::string this_module = (const char*)realpath(di.dli_fname, buf);
			size_t i = this_module.find_last_of('/');
			buf[i+1] = 0;
			strcat(buf, core);
		}else{
			strcpy(buf, core);
		}

		printf("Loading Core lib [%s]...\n", buf);
		h = dlopen(buf, RTLD_LAZY | RTLD_LOCAL);
		if(h == NULL){
			printf("ERROR: cannot load core lib [%s], abort!\n", buf);
			exit(-1);
		}
	}

	s_core = h;
#endif
	inited = true;
	return h != NULL;
}

#ifdef _WINDOWS_
#define RESOLVE_API(ord, apiName) { resolveAPIs(); assert(apis[ord]); }
#else
//Unix..
void resolveApi(int ord, const char* apiName){
	if(NULL == s_core) resolveAPIs();
	assert(s_core);

	if(NULL == apis[ord]){
		apis[ord] = dlsym(s_core, apiName);
	}
	assert(apis[ord]);
}

#define RESOLVE_API(ord, apiName) { resolveApi(ord, #apiName); }
#endif

#define BIND_PROC(ord, apiName, ...) \
	void apiName(__VA_ARGS__){\
		RESOLVE_API(ord, apiName);\
		typedef void (WINAPI* Fapi)(__VA_ARGS__);\
		(*(Fapi)apis[ord])(

#define BIND_FUNC(ord, retType, apiName, ...) \
	retType apiName(__VA_ARGS__){\
		RESOLVE_API(ord, apiName);\
		typedef retType (WINAPI* Fapi)(__VA_ARGS__);\
		return (*(Fapi)apis[ord])(

#define BIND_END );}

#define BIND_PROC0(ord, apiName)\
	void apiName(){\
		RESOLVE_API(ord, apiName);\
		typedef void (WINAPI* Fapi)();\
		(*(Fapi)apis[ord])();}

#define BIND_FUNC0(ord,retType, apiName)\
	retType apiName(){\
		RESOLVE_API(ord, apiName);\
		typedef retType (WINAPI* Fapi)();\
		return (*(Fapi)apis[ord])();}

BIND_FUNC(3, int, gsInit, const char* productId, const char* origLic, const char* password, void * reserved)
productId, origLic, password, reserved
BIND_END

BIND_FUNC(103, int, gsInit, const char* productId, const unsigned char* origLicData, int licSize, const char* password, void * reserved)
productId, origLicData, licSize, password, reserved
BIND_END

BIND_FUNC0(4, int, gsCleanUp)

BIND_FUNC0(2, const char*, gsGetVersion)

BIND_PROC(5, gsCloseHandle, gs_handle_t handle)
handle
BIND_END

BIND_PROC0(6, gsFlush)
BIND_FUNC0(7, const char*, gsGetLastErrorMessage)
BIND_FUNC0(8, int, gsGetLastErrorCode)

BIND_PROC(104, gsSetLastErrorInfo, int errCode, const char* errMsg)
errCode, errMsg
BIND_END

BIND_FUNC0(9, int, gsGetBuildId)
BIND_FUNC0(84, const char*, gsGetProductName)
BIND_FUNC0(85, const char*, gsGetProductId)
//Entity
BIND_FUNC0(10, int, gsGetEntityCount)

BIND_FUNC(11, TEntityHandle, gsOpenEntityByIndex, int index)
index
BIND_END

BIND_FUNC(12, TEntityHandle, gsOpenEntityById, entity_id_t entityId)
entityId
BIND_END

BIND_FUNC(13, unsigned int, gsGetEntityAttributes, TEntityHandle hEntity)
hEntity
BIND_END

BIND_FUNC(14, entity_id_t, gsGetEntityId, TEntityHandle hEntity)
hEntity
BIND_END

BIND_FUNC(15, const char *, gsGetEntityName, TEntityHandle hEntity)
hEntity
BIND_END

BIND_FUNC(16, const char*, gsGetEntityDescription, TEntityHandle hEntity)
hEntity
BIND_END

BIND_FUNC(20, bool, gsBeginAccessEntity, TEntityHandle hEntity)
hEntity
BIND_END

BIND_FUNC(21, bool, gsEndAccessEntity, TEntityHandle hEntity)
hEntity
BIND_END

//License
BIND_FUNC(25, int, gsGetLicenseCount, TEntityHandle hEntity)
hEntity
BIND_END

BIND_FUNC(26, TLicenseHandle, gsOpenLicenseByIndex, TEntityHandle hEntity, int index)
hEntity, index
BIND_END

BIND_FUNC(27, TLicenseHandle, gsOpenLicenseById, TEntityHandle hEntity, license_id_t licenseId)
hEntity, licenseId
BIND_END
/*
* Inspect the license model's status
*/
BIND_FUNC(28, license_id_t, gsGetLicenseId, TLicenseHandle hLicense)
hLicense
BIND_END

BIND_FUNC(22, const char*, gsGetLicenseName, TLicenseHandle hLicense)
hLicense
BIND_END

BIND_FUNC(23, const char*, gsGetLicenseDescription, TLicenseHandle hLicense)
hLicense
BIND_END

BIND_FUNC(24, TLicenseStatus, gsGetLicenseStatus, TLicenseHandle hLicense)
hLicense
BIND_END

BIND_FUNC(34, bool, gsIsLicenseValid, TLicenseHandle hLicense)
hLicense
BIND_END

BIND_FUNC(48, TEntityHandle, gsGetLicensedEntity, TLicenseHandle hLic)
hLic
BIND_END

/*
* Inspect the license model's parameters
*/
/// Get total number of parameters in a license.
BIND_FUNC(29, int, gsGetLicenseParamCount, TLicenseHandle hLicense)
hLicense
BIND_END

/// Get the index'th parameter info handle
BIND_FUNC(30, TVarHandle, gsGetLicenseParamByIndex, TLicenseHandle hLicense, int index)
hLicense, index
BIND_END

BIND_FUNC(31, TVarHandle, gsGetLicenseParamByName, TLicenseHandle hLicense, const char * name)
hLicense, name
BIND_END

/**
 * Inspect license model's actions
 */
 BIND_FUNC(32, int, gsGetActionInfoCount, TLicenseHandle hLicense)
 hLicense
 BIND_END

 BIND_FUNC(33, const char *, gsGetActionInfoByIndex, TLicenseHandle hLicense, int index, action_id_t* actionId)
 hLicense, index, actionId
 BIND_END

 /**
  *	Inspect an action
  */
  BIND_FUNC(38, const char*, gsGetActionName, TActionHandle hAct)
  hAct
  BIND_END

  BIND_FUNC(39, action_id_t, gsGetActionId, TActionHandle hAct)
  hAct
  BIND_END

  BIND_FUNC(40, const char*, gsGetActionDescription, TActionHandle hAct)
  hAct
  BIND_END

  BIND_FUNC(41, const char*, gsGetActionString, TActionHandle hAct)
  hAct
  BIND_END

  /**
   * Inspect action's parameters
   */
   BIND_FUNC(42, int, gsGetActionParamCount, TActionHandle hAct)
   hAct
   BIND_END

   BIND_FUNC(43, TVarHandle, gsGetActionParamByName, TActionHandle hAct, const char* paramName)
   hAct, paramName
   BIND_END

   BIND_FUNC(44, TVarHandle, gsGetActionParamByIndex, TActionHandle hAct, int index)
   hAct, index
   BIND_END

   //Variables
   BIND_FUNC(50, TVarHandle, gsAddVariable, const char* varName, TVarType varType, int attr, const char* initValStr)
   varName, varType, attr, initValStr
   BIND_END

   BIND_FUNC(51, bool, gsRemoveVariable, const char * varName)
   varName
   BIND_END

   BIND_FUNC(52, TVarHandle, gsGetVariable, const char* varName)
   varName
   BIND_END

   BIND_FUNC(53, const char*, gsGetVariableName, TVarHandle hVar)
   hVar
   BIND_END

   BIND_FUNC(54, TVarType, gsGetVariableType, TVarHandle hVar)
   hVar
   BIND_END

   BIND_FUNC(55, const char*, gsVariableTypeToString, var_type_t paramType)
   paramType
   BIND_END

   BIND_FUNC(56, int, gsGetVariableAttr, TVarHandle hVar)
   hVar
   BIND_END

   BIND_FUNC(65, const char*, gsVariableAttrToString, int permit, char* buf, int bufSize)
   permit, buf, bufSize
   BIND_END

   BIND_FUNC(66, int, gsVariableAttrFromString, const char* permitStr)
   permitStr
   BIND_END

   //Value Get/Set
   BIND_FUNC(57, const char *, gsGetVariableValueAsString, TVarHandle hVar)
   hVar
   BIND_END

   BIND_FUNC(58, bool, gsSetVariableValueFromString, TVarHandle hVar, const char* valstr)
   hVar, valstr
   BIND_END

   BIND_FUNC(59, bool, gsGetVariableValueAsInt, TVarHandle hVar, int& val)
   hVar, val
   BIND_END

   BIND_FUNC(60, bool, gsSetVariableValueFromInt, TVarHandle hVar, int val)
   hVar, val
   BIND_END

   BIND_FUNC(61, bool, gsGetVariableValueAsInt64, TVarHandle hVar, int64_t & val)
   hVar, val
   BIND_END

   BIND_FUNC(62, bool, gsSetVariableValueFromInt64, TVarHandle hVar, int64_t val)
   hVar, val
   BIND_END

   BIND_FUNC(63, bool, gsGetVariableValueAsFloat, TVarHandle hVar, float & val)
   hVar, val
   BIND_END

   BIND_FUNC(64, bool, gsSetVariableValueFromFloat, TVarHandle hVar, float val)
   hVar, val
   BIND_END

   BIND_FUNC(78, bool, gsGetVariableValueAsDouble, TVarHandle hVar, double & val)
   hVar, val
   BIND_END

   BIND_FUNC(79, bool, gsSetVariableValueFromDouble, TVarHandle hVar, double val)
   hVar, val
   BIND_END

   BIND_FUNC(68, bool, gsGetVariableValueAsTime, TVarHandle hVar, time_t & val)
   hVar, val
   BIND_END

   BIND_FUNC(69, bool, gsSetVariableValueFromTime, TVarHandle hVar, time_t val)
   hVar, val
   BIND_END

   //Request
   BIND_FUNC0(36, TRequestHandle, gsCreateRequest)

   BIND_FUNC(37, TActionHandle, gsAddRequestAction, TRequestHandle hReq, action_id_t actId, TLicenseHandle hLic)
   hReq, actId, hLic
   BIND_END

   BIND_FUNC(47, TActionHandle, gsAddRequestActionEx, TRequestHandle hReq, action_id_t actId, const char* entityId, const char* licenseId)
   hReq, actId, entityId, licenseId
   BIND_END

   BIND_FUNC(45, const char*, gsGetRequestCode, TRequestHandle hReq)
   hReq
   BIND_END

   BIND_FUNC(46, bool, gsApplyLicenseCode, const char * licenseCode)
   licenseCode
   BIND_END

   //---------- Time Engine Service ------------
   BIND_PROC0(70, gsTurnOnInternalTimer)
   BIND_PROC0(71, gsTurnOffInternalTimer)
   BIND_FUNC0(72, bool, gsIsInternalTimerActive)
   BIND_PROC0(73, gsTickFromExternalTimer)
   BIND_PROC0(74, gsPauseTimeEngine)
   BIND_PROC0(75, gsResumeTimeEngine)
   BIND_FUNC0(76, bool, gsIsTimeEngineActive)

   //Monitor
   BIND_FUNC(90, TMonitorHandle, gsCreateMonitorEx, gs5_monitor_callback cbMonitor, void * usrData, const char* monitorName)
   cbMonitor, usrData, monitorName
   BIND_END

   BIND_FUNC(86, int, gsGetEventId, TEventHandle hEvent)
   hEvent
   BIND_END

   BIND_FUNC(87, TEventType, gsGetEventType, TEventHandle hEvent)
   hEvent
   BIND_END

   BIND_FUNC(88, TEventSourceHandle, gsGetEventSource, TEventHandle hEvent)
   hEvent
   BIND_END

   //HTML
   BIND_FUNC(80, bool, gsRenderHTML, const char* url, const char* title, int width, int height)
   url, title, width, height
   BIND_END

   BIND_FUNC(83, bool, gsRenderHTMLEx, const char* url, const char* title, int width, int height, bool resizable, bool exitAppWhenUIClosed, bool cleanUpAfterRendering)
   url, title, width, height, resizable, exitAppWhenUIClosed, cleanUpAfterRendering
   BIND_END

   BIND_FUNC0(81, bool, gsRunInWrappedMode)

   BIND_FUNC(82, bool, gsRunInsideVM, vm_mask_t vmask)
   vmask
   BIND_END

   BIND_FUNC0(91, bool, gsIsDebugVersion)

   BIND_PROC(92, gsTrace, const char* msg)
   msg
   BIND_END

   BIND_FUNC(67, bool, gsIsVariableValid, TVarHandle hVar)
   hVar
   BIND_END

   //Application Control
   BIND_PROC(93, gsExitApp, int rc)
   rc
   BIND_END

   BIND_PROC(94, gsTerminateApp, int rc)
   rc
   BIND_END

   BIND_PROC0(95, gsPlayApp)
   BIND_PROC0(96, gsRestartApp)
   BIND_FUNC0(102, bool, gsIsRestartedApp)

   BIND_FUNC0(97, const char*, gsGetAppRootPath)
   BIND_FUNC0(98, const char*, gsGetAppCommandLine)
   BIND_FUNC0(101, const char*, gsGetAppMainExe)


   //Session Variables
   BIND_PROC(99, gsSetAppVar, const char* name, const char* val)
   name, val
   BIND_END

   BIND_FUNC(100, const char*, gsGetAppVar, const char* name)
   name
   BIND_END

   //Custom LM
   BIND_FUNC(105, TLicenseHandle, gsCreateCustomLicense, const char* licId, const char* licName, const char* description, void *usrData,
   lm_isValid_callback cbIsValid, lm_startAccess_callback cbStartAccess,
   lm_finishAccess_callback cbFinishAccess, lm_onAction_callback cbOnAction,
   lm_destroy_callback cbDestroy)
   licId, licName, description, usrData, cbIsValid, cbStartAccess, cbFinishAccess, cbOnAction, cbDestroy
   BIND_END

   BIND_FUNC(106, bool, gsBindLicense, TEntityHandle hEntity, TLicenseHandle hLic)
   hEntity, hLic
   BIND_END

   BIND_FUNC(107, TLicenseHandle, gsCreateLicense, const char * licId)
   licId
   BIND_END

   BIND_PROC(108, gsRegisterCustomLicense, const char * licId, lm_create_callback createLM, void * usrData)
   licId, createLM, usrData
   BIND_END

   BIND_PROC(109, gsAddLicenseParamStr, TLicenseHandle hLic, const char* paramName, const char* initValue, int permission)
   hLic, paramName, initValue, permission
   BIND_END

   BIND_PROC(110, gsAddLicenseParamInt, TLicenseHandle hLic, const char* paramName, int initValue, int permission)
   hLic, paramName, initValue, permission
   BIND_END

   BIND_PROC(111, gsAddLicenseParamInt64, TLicenseHandle hLic, const char* paramName, int64_t initValue, int permission)
   hLic, paramName, initValue, permission
   BIND_END

   BIND_PROC(112, gsAddLicenseParamBool, TLicenseHandle hLic, const char* paramName, bool initValue, int permission)
   hLic, paramName, initValue, permission
   BIND_END

   BIND_PROC(113, gsAddLicenseParamFloat, TLicenseHandle hLic, const char* paramName, float initValue, int permission)
   hLic, paramName, initValue, permission
   BIND_END

   BIND_PROC(114, gsAddLicenseParamTime, TLicenseHandle hLic, const char* paramName, time_t initValue, int permission)
   hLic, paramName, initValue, permission
   BIND_END

   BIND_PROC(115, gsAddLicenseParamDouble, TLicenseHandle hLic, const char* paramName, double initValue, int permission)
   hLic, paramName, initValue, permission
   BIND_END

   //-------- Game Execution Context -----------
   BIND_FUNC0(116, bool, gsIsFirstPass);
BIND_FUNC0(117, bool, gsIsGamePass);
BIND_FUNC0(118, bool, gsIsLastPass);
BIND_FUNC0(119, bool, gsIsFirstGameExe);
BIND_FUNC0(120, bool, gsIsLastGameExe);
BIND_FUNC0(121, bool, gsIsMainThread);

BIND_FUNC0(122, int, gsGetTotalVariables);
BIND_FUNC(123, TVarHandle, gsGetVariableByIndex, int index)
index
BIND_END

BIND_PROC(89, gsPostUserEvent, unsigned int evtId, bool bSync, void * usrData, unsigned int usrDataSize)
evtId, bSync, usrData, usrDataSize
BIND_END

BIND_FUNC(124, void *, gsGetUserEventData, TEventHandle hEvent, unsigned int * usrDataSize)
hEvent, usrDataSize
BIND_END

BIND_PROC0(125, gsPauseApp);
BIND_PROC0(126, gsResumeAndExitApp);

BIND_FUNC0(127, bool, gsIsNodeLocked);
BIND_FUNC0(128, bool, gsIsFingerPrintMatched);
BIND_FUNC0(129, const char*, gsGetUniqueNodeId);

BIND_FUNC0(130, bool, gsIsAppFirstLaunched);

BIND_FUNC(131, bool, gsIsServerAlive, int timeout)
timeout
BIND_END

BIND_PROC(132, gsIsServerAliveAsync, ping_cb pcb, void * userData, int timeout)
pcb, userData, timeout
BIND_END

BIND_FUNC(133, bool, gsApplySN, const char* sn, int* pRetCode, const char** ppSNRef, int timeout)
sn, pRetCode, ppSNRef, timeout
BIND_END

BIND_PROC(134, gsApplySNAsync, const char* sn, activate_cb activateCB, void * userData, int timeout)
sn, activateCB, userData, timeout
BIND_END


//136
BIND_FUNC(136, bool, gsHasLicense, TEntityHandle hEntity)
hEntity
BIND_END

//137
BIND_FUNC(137, TLicenseHandle, gsOpenLicense, TEntityHandle hEntity)
hEntity
BIND_END

//138
BIND_PROC(138, gsLockLicense, TLicenseHandle hLic)
hLic
BIND_END

//139
BIND_FUNC(139, bool, gsIsSNValid, const char* sn, int timeout)
sn, timeout
BIND_END

//140
BIND_PROC(140, gsIsSNValidAsync, const char* sn, testsn_cb cb, void * userData, int timeout)
sn, cb, userData, timeout
BIND_END


//135
BIND_FUNC(135, bool, gsRevokeApp, int timeout, const char* sn)
  timeout, sn
BIND_END


//144
BIND_FUNC(144, bool, gsRevokeSN, int timeout, const char* sn)
  timeout, sn
BIND_END

BIND_FUNC0(17, int, gsGetTotalUnlockSNs);//17

BIND_FUNC(49, const char*, gsGetUnlockSNByIndex, int index)
index
BIND_END

BIND_FUNC(142, int, gsGetTotalEntitiesUnlockedBySN, const char* sn)
sn
BIND_END

BIND_FUNC(143, const char*, gsGetEntityIdUnlockedBySN, const char* sn, int index)
sn, index
BIND_END

BIND_FUNC(154, const char *, gsGetSNByUnlockedEntityId, const char* entityId)
entityId
BIND_END

BIND_FUNC0(155, const char*, gsGetPreliminarySN)
//;;;;;;;;;;;;;;;; MOVE ;;;;;;;;;;;;;;;;
//145
BIND_FUNC(145, TMPHandle, gsMPCreate, int reserved)
reserved
BIND_END
//146
BIND_PROC(146, gsMPAddEntity, TMPHandle hMP, const char* entityId)
hMP, entityId
BIND_END
//147
BIND_FUNC(147, const char*, gsMPExport, TMPHandle hMP)
hMP
BIND_END
//148
BIND_FUNC(148, const char*, gsMPUpload, TMPHandle hMP, const char* sn, int timeout)
hMP, sn, timeout
BIND_END

//149
BIND_FUNC(149, TMPHandle, gsMPOpen, const char* mpStr)
mpStr
BIND_END


BIND_FUNC(141, bool, gsMPImportOnline, TMPHandle hMP, const char* sn, int timeout)
hMP, sn, timeout
BIND_END

//150
BIND_FUNC(150, const char*, gsMPGetImportOfflineRequestCode, TMPHandle hMP)
hMP
BIND_END
//151
BIND_FUNC(151, bool, gsMPImportOffline, TMPHandle hMP, const char* licenseCode)
hMP, licenseCode
BIND_END
//152
BIND_FUNC(152, const char*, gsMPUploadApp, const char* sn, int timeout)
sn, timeout
BIND_END

//153
BIND_FUNC0(153, const char*, gsMPExportApp)

BIND_FUNC(156, bool, gsMPCanPreliminarySNResolved, TMPHandle hMP)
hMP
BIND_END

BIND_FUNC(157, bool, gsMPIsTooBigToUpload, TMPHandle hMP)
  hMP
BIND_END

BIND_FUNC(158, bool, gsApplyLicenseCodeEx, const char* licenseCode, const char* sn, const char* snRef)
  licenseCode, sn, snRef
BIND_END

BIND_FUNC0(159, TCodeExchangeHandle, gsCodeExchangeBegin);

BIND_FUNC(160, const char*, gsCodeExchangeGetLicenseCode, gs_handle_t hCodeExchange, const char* productId, int buildId, const char* sn, const char* requestCode)
  hCodeExchange, productId, buildId, sn, requestCode
BIND_END

BIND_FUNC(161, int, gsCodeExchangeGetErrorCode, gs_handle_t hCodeExchange)
  hCodeExchange
BIND_END

BIND_FUNC(162, const char*, gsCodeExchangeGetErrorMessage, gs_handle_t hCodeExchange)
  hCodeExchange
BIND_END

};//gs