home *** CD-ROM | disk | FTP | other *** search
/ Revista CD Expert 51 / PCGamer51_17Demos.iso / games / CM / CyclingManagerDemoCangas.exe / CyclingManagerDemo / Database / Database.cnd < prev    next >
Text File  |  2001-03-02  |  6KB  |  137 lines

  1. // test database
  2. //include "TestDatabase.cnd"
  3.  
  4. var i32x g_iActiveDatabase;
  5.  
  6. func void MyDatabase_AddTables(i32x _iNumTables)
  7. {
  8.     Database_AddTables(g_iActiveDatabase,_iNumTables);
  9. }
  10.  
  11.  
  12. func void MyDatabase_Create()
  13. {
  14.     Database_Create(g_iActiveDatabase);
  15. }
  16.  
  17. func void MyDatabase_Update()
  18. {
  19.     Database_Update(g_iActiveDatabase);
  20. }
  21.  
  22. func void MyTable_SetName(i32x _iTableIndex, szx _szTableName)
  23. {
  24.     Table_SetName(g_iActiveDatabase,_iTableIndex, _szTableName);
  25. }
  26.  
  27. func void MyTable_AddCols(i32x _iTableIndex, i32x _iNumCols)
  28. {
  29.     Table_AddCols(g_iActiveDatabase,_iTableIndex, _iNumCols);
  30. }
  31.  
  32. func void MyTable_AddRows(i32x _iTableIndex, i32x _iNumRows)
  33. {
  34.     Table_AddRows(g_iActiveDatabase,_iTableIndex, _iNumRows);
  35. }
  36.  
  37. func void MyColumn_SetName(i32x _iTableIndex, i32x _iColumnIndex, szx _szColumnName)
  38. {
  39.     Column_SetName(g_iActiveDatabase,_iTableIndex, _iColumnIndex, _szColumnName);
  40. }
  41.  
  42. func void MyColumn_SetType(i32x _iTableIndex, i32x _iColumnIndex, i32x _iColumnType)
  43. {
  44.     Column_SetType(g_iActiveDatabase,_iTableIndex, _iColumnIndex, _iColumnType);
  45. }
  46.  
  47. func void MyRow_SetIntBlock(i32x _iTableIndex, i32x _iColumnIndex, i32x _iRowIndex, i32x _iNumValues, i32x _iValue0, i32x _iValue1, i32x _iValue2, i32x _iValue3, i32x _iValue4, i32x _iValue5, i32x _iValue6, i32x _iValue7, i32x _iValue8, i32x _iValue9, i32x _iValue10, i32x _iValue11, i32x _iValue12, i32x _iValue13, i32x _iValue14, i32x _iValue15)
  48. {
  49.     Row_SetIntBlock(g_iActiveDatabase,_iTableIndex, _iColumnIndex, _iRowIndex, _iNumValues, _iValue0, _iValue1, _iValue2, _iValue3, _iValue4, _iValue5, _iValue6, _iValue7, _iValue8, _iValue9, _iValue10, _iValue11, _iValue12, _iValue13, _iValue14, _iValue15);
  50. }
  51.  
  52. func void MyRow_SetFloatBlock(i32x _iTableIndex, i32x _iColumnIndex, i32x _iRowIndex, i32x _iNumValues, f32x _fValue0, f32x _fValue1, f32x _fValue2, f32x _fValue3, f32x _fValue4, f32x _fValue5, f32x _fValue6, f32x _fValue7, f32x _fValue8, f32x _fValue9, f32x _fValue10, f32x _fValue11, f32x _fValue12, f32x _fValue13, f32x _fValue14, f32x _fValue15)
  53. {
  54.     Row_SetFloatBlock(g_iActiveDatabase,_iTableIndex, _iColumnIndex, _iRowIndex, _iNumValues, _fValue0, _fValue1,  _fValue2,  _fValue3,  _fValue4,  _fValue5,  _fValue6,  _fValue7, _fValue8,  _fValue9,  _fValue10,  _fValue11,  _fValue12,  _fValue13,  _fValue14,  _fValue15);
  55. }
  56.  
  57. func void MyRow_SetStringBlock(i32x _iTableIndex, i32x _iColumnIndex, i32x _iRowIndex, i32x _iNumValues, szx _szValue0, szx _szValue1, szx _szValue2, szx _szValue3, szx _szValue4, szx _szValue5, szx _szValue6, szx _szValue7, szx _szValue8, szx _szValue9, szx _szValue10, szx _szValue11, szx _szValue12, szx _szValue13, szx _szValue14, szx _szValue15)
  58. {
  59.     Row_SetStringBlock(g_iActiveDatabase,_iTableIndex, _iColumnIndex, _iRowIndex, _iNumValues,  _szValue0,  _szValue1,  _szValue2,  _szValue3,  _szValue4,  _szValue5,  _szValue6,  _szValue7, _szValue8,  _szValue9,  _szValue10,  _szValue11,  _szValue12,  _szValue13,  _szValue14,  _szValue15);
  60. }
  61.  
  62. func void MyRow_SetStringData(i32x _iTableIndex, i32x _iColumnIndex, i32x _iRowIndex, szx _szValue)
  63. {
  64.     Row_SetStringData(g_iActiveDatabase,_iTableIndex, _iColumnIndex, _iRowIndex, _szValue);
  65. }
  66.  
  67.  
  68. func void MyRow_SetListSizeBlock(i32x _iTableIndex, i32x _iColumnIndex, i32x _iRowIndex, i32x _iNumValues, i32x _iValue0, i32x _iValue1, i32x _iValue2, i32x _iValue3, i32x _iValue4, i32x _iValue5, i32x _iValue6, i32x _iValue7, i32x _iValue8, i32x _iValue9, i32x _iValue10, i32x _iValue11, i32x _iValue12, i32x _iValue13, i32x _iValue14, i32x _iValue15)
  69. {
  70.     Row_SetListSizeBlock(g_iActiveDatabase,_iTableIndex, _iColumnIndex, _iRowIndex, _iNumValues, _iValue0, _iValue1, _iValue2, _iValue3, _iValue4, _iValue5, _iValue6, _iValue7, _iValue8, _iValue9, _iValue10, _iValue11, _iValue12, _iValue13, _iValue14, _iValue15);
  71. }
  72.  
  73. func void MyRow_SetListIntBlock(i32x _iTableIndex, i32x _iColumnIndex, i32x _iRowIndex, i32x _iListIndex, i32x _iNumValues, i32x _iValue0, i32x _iValue1, i32x _iValue2, i32x _iValue3, i32x _iValue4, i32x _iValue5, i32x _iValue6, i32x _iValue7, i32x _iValue8, i32x _iValue9, i32x _iValue10, i32x _iValue11, i32x _iValue12, i32x _iValue13, i32x _iValue14, i32x _iValue15)
  74. {
  75.     Row_SetListIntBlock(g_iActiveDatabase,_iTableIndex, _iColumnIndex, _iRowIndex, _iListIndex, _iNumValues, _iValue0, _iValue1, _iValue2, _iValue3, _iValue4, _iValue5, _iValue6, _iValue7, _iValue8, _iValue9, _iValue10, _iValue11, _iValue12, _iValue13, _iValue14, _iValue15);
  76. }
  77.  
  78. func void MyRow_SetListFloatBlock(i32x _iTableIndex, i32x _iColumnIndex, i32x _iRowIndex, i32x _iListIndex, i32x _iNumValues, f32x _fValue0, f32x _fValue1, f32x _fValue2, f32x _fValue3, f32x _fValue4, f32x _fValue5, f32x _fValue6, f32x _fValue7, f32x _fValue8, f32x _fValue9, f32x _fValue10, f32x _fValue11, f32x _fValue12, f32x _fValue13, f32x _fValue14, f32x _fValue15)
  79. {
  80.     Row_SetListFloatBlock(g_iActiveDatabase,_iTableIndex, _iColumnIndex, _iRowIndex, _iListIndex, _iNumValues, _fValue0, _fValue1,  _fValue2,  _fValue3,  _fValue4,  _fValue5,  _fValue6,  _fValue7, _fValue8,  _fValue9,  _fValue10,  _fValue11,  _fValue12,  _fValue13,  _fValue14,  _fValue15);
  81. }
  82.  
  83.  
  84.  
  85. interface Database_ClientInterface
  86. {
  87.   
  88.     MyDatabase_AddTables    Database_AddTables;
  89.     MyDatabase_Create       Database_Create;
  90.     MyDatabase_Update        Database_Update;
  91.  
  92.     MyTable_SetName            Table_SetName;
  93.     MyTable_AddCols            Table_AddCols;    
  94.     MyTable_AddRows            Table_AddRows;
  95.  
  96.     MyColumn_SetName        Column_SetName;
  97.     MyColumn_SetType        Column_SetType;
  98.  
  99.     MyRow_SetIntBlock        Row_SetIntBlock;
  100.     MyRow_SetFloatBlock        Row_SetFloatBlock;
  101.     MyRow_SetStringBlock    Row_SetStringBlock;
  102.  
  103.     MyRow_SetListSizeBlock    Row_SetListSizeBlock;
  104.     MyRow_SetListIntBlock    Row_SetListIntBlock;
  105.     MyRow_SetListFloatBlock    Row_SetListFloatBlock;
  106.  
  107.     MyRow_SetStringData Row_SetStringData;
  108. }
  109.  
  110. func void Database_ClientConnect(Net_Client _client)
  111. {
  112. }
  113.  
  114. func void Database_ClientDisconnect(Net_Client _client)
  115. {
  116. }
  117.  
  118.  
  119.  
  120. func void Database_Open(i32x _iActiveDatabase,szx _szDatabase)
  121. {
  122.     print("Load database : ");
  123.     println(_szDatabase);
  124.  
  125.     g_iActiveDatabase = _iActiveDatabase;
  126.     var szx szDatabase;
  127.     var Net_Client myclient;
  128.     szDatabase = strcat("<",_szDatabase);
  129.     myclient = NetClient_Create(
  130.         szDatabase, 1111,
  131.         Database_ClientInterface,
  132.         Database_ClientConnect,
  133.         Database_ClientDisconnect);
  134.     NetClient_Destroy(myclient);
  135. }
  136.  
  137.