00001
00002
00003
00004
00005 #include "drms.h"
00006
00007 #define EXPANDAPI 0
00008
00009 #define USEINTERNALHANDLES 0
00010
00011 #include "drms_fortran.h"
00012 #include "inthandles.h"
00013
00014 #if !USEINTERNALHANDLES
00015 static char gRethandle[kMaxFHandleKey];
00016
00017
00018
00019
00020 #endif
00021
00022 #if USEINTERNALHANDLES
00023 static char ** handles = (char **) NULL;
00024 static int handle_max_index =0, handle_index =0;
00025 #endif
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053 #if USEINTERNALHANDLES
00054 static HContainer_t *fHandleH = NULL;
00055
00056 void create_fortran_handleH(void) {
00057 if (!fHandleH) {
00058 fHandleH = hcon_create(sizeof(void *),
00059 FHANDLEKEYSIZE,
00060 NULL,
00061 NULL,
00062 NULL,
00063 NULL,
00064 0);
00065 }
00066 XASSERT(fHandleH);
00067 }
00068
00069 void insert2hash(char * key, void * value) {
00070 if (!fHandleH) create_fortran_handleH();
00071 hcon_insert(fHandleH, key, value);
00072 }
00073 #endif
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104 void fort_alloc(Fort_Alloc_t * farr, void * storage, int nElem, int sizeof_type, int mult)
00105 {
00106 int iRank=1;
00107 #ifdef DEBUG
00108 printf("Fort Alloc [%p]\n", farr);
00109 #endif
00110 farr->m_pBase = storage;
00111 farr->m_sizeof = mult * sizeof_type;
00112 farr->m_iOffset = - (mult * sizeof_type);
00113 farr->m_iFlags = VF_EXISTING | VF_OWNMEMORY;
00114 farr->m_iRank = iRank;
00115
00116 farr->m_Dim[0].iExtent = nElem;
00117 farr->m_Dim[0].iStride = mult*sizeof_type;
00118 farr->m_Dim[0].lBound = 1;
00119 #ifdef DEBUG
00120 printf("Array sizeof [%d]; iOffset [%d]; iExtent [%d]; iStride [%d]\n", farr->m_sizeof, farr->m_iOffset, farr->m_Dim[0].iExtent, farr->m_Dim[0].iStride);
00121 #endif
00122 return;
00123 }
00124
00125
00126 void free_fort_alloc ( Fort_Alloc_t * farr) {
00127 free(farr->m_pBase);
00128 farr->m_sizeof = 0;
00129 farr->m_iOffset = 0;
00130 farr->m_iFlags = 0;
00131 farr->m_Dim[0].iExtent = 0;
00132 farr->m_Dim[0].iStride = 0;
00133 }
00134
00135 #if !USEINTERNALHANDLES
00136
00137 const char *__pointer2handle(void * ptr, char * type, char * func)
00138 {
00139 const char *ret_str = NULL;
00140
00141 char buf[kMaxFHandleKey];
00142 snprintf(buf, sizeof(buf), "%p;%s;%s", ptr, type, func);
00143 InsertJSOCStructure(buf, (void *)ptr, kFHandleTypeDRMS, &ret_str);
00144 return ret_str;
00145 }
00146 #endif
00147
00148 char * _pointer2handle(void * ptr, char * type, char * func) {
00149 #if USEINTERNALHANDLES
00150 char *ret_str;
00151
00152 int incr = 10, mult=1;
00153 ret_str = malloc(sizeof(char) * FHANDLEKEYSIZE);
00154 snprintf(ret_str, FHANDLEKEYSIZE, "%p;%s;%s",ptr, type, func);
00155
00156 if ( handle_max_index - handle_index == 0 ) {
00157 mult = (handle_max_index ==0) ? mult: 1 + ( handle_max_index + 1)/ incr;
00158
00159 handles = (char **) realloc((void *) handles, sizeof(char *) * incr * mult );
00160
00161 handle_max_index = incr * mult -1;
00162
00163 printf("handle_max_index _pointer2handle [%d]\n", handle_max_index);
00164 }
00165
00166 handles[handle_index] = ret_str;
00167
00168 handle_index++;
00169
00170
00171 #ifdef FHASH
00172 insert2hash(ret_str, (void *) &ptr);
00173 #endif
00174 #else
00175 const char *intstr = NULL;
00176 #endif
00177
00178 #ifdef DEBUG
00179 printf("Generating pointer [%s]\n",ret_str);
00180 #endif
00181
00182 #if USEINTERNALHANDLES
00183 return ret_str;
00184 #else
00185 intstr = __pointer2handle(ptr, type, func);
00186 snprintf(gRethandle, sizeof(gRethandle), "%s", intstr);
00187
00188 return gRethandle;
00189 #endif
00190 }
00191
00192 void _freehandle(char **handle)
00193 {
00194 #if !USEINTERNALHANDLES
00195 if (handle && *handle && !RemoveJSOCStructure(*handle, kFHandleTypeDRMS))
00196 {
00197 (*handle)[0] = '\0';
00198 }
00199 #endif
00200 }
00201
00202 void * _convert_handle(char *handle) {
00203 #if USEINTERNALHANDLES
00204 int ptr_len;
00205 char ptr_str[250];
00206 void * ptr;
00207
00208 #ifdef DEBUG
00209 printf("Converting pointer [%s]\n",handle);
00210 #endif
00211
00212 #ifdef FHASH
00213 return *(void **) hcon_lookup(fHandleH, handle);
00214 #else
00215 ptr_len = strcspn(handle, ";");
00216
00217 strncpy(ptr_str, handle, ptr_len);
00218
00219 ptr_str[ptr_len]='\0';
00220
00221 sscanf(ptr_str,"%p",&ptr);
00222 return ptr;
00223 #endif
00224 #else
00225 return GetJSOCStructure((void *)handle, kFHandleTypeDRMS);
00226 #endif
00227 }
00228
00229 void convert_C2F_string_array(Fort_Alloc_t *f_alloc, char ** c_arr, int no_of_rows, int row_len) {
00230 char *alloc_arr = (char *) NULL;
00231 int i;
00232
00233 alloc_arr = malloc(no_of_rows*row_len);
00234 XASSERT(alloc_arr);
00235
00236 for (i=0; i< no_of_rows; i++) {
00237 strncpy(alloc_arr + row_len*i, c_arr[i], row_len);
00238 }
00239
00240 dealloc_C_string_array(c_arr, no_of_rows);
00241
00242
00243 fort_alloc(f_alloc, alloc_arr, no_of_rows, row_len, 1);
00244
00245 return;
00246
00247 }
00248
00249
00250
00251
00252 void convert_F2C_string_array(Fort_Alloc_t *f_alloc, char *** c_arr, int no_of_rows, int row_len) {
00253 char *alloc_arr = (char *) NULL;
00254 char **_c_arr = (char **) NULL;
00255 int i;
00256
00257 alloc_arr = f_alloc->m_pBase;
00258
00259
00260 _c_arr = malloc(no_of_rows*sizeof(char *));
00261 XASSERT(_c_arr);
00262
00263 for (i=0; i< no_of_rows; i++) {
00264 _c_arr[i] = malloc(row_len*sizeof(char));
00265 XASSERT(_c_arr[i]);
00266 strncpy(_c_arr[i], alloc_arr + row_len*i , row_len);
00267 }
00268
00269 *c_arr = _c_arr;
00270
00271 return;
00272 }
00273
00274 void dealloc_C_string_array(char ** c_arr, int no_of_rows) {
00275 int i=0;
00276 for (i = 0; i<no_of_rows;i++) {
00277 free(c_arr[i]);
00278 }
00279 free(c_arr);
00280 return;
00281 }
00282
00283
00284 int sizeof_drms_type ( DRMS_Type_t type) {
00285 switch (type) {
00286 case DRMS_TYPE_CHAR : return sizeof(char);
00287 case DRMS_TYPE_SHORT : return sizeof(short);
00288 case DRMS_TYPE_INT : return sizeof(int);
00289 case DRMS_TYPE_LONGLONG : return sizeof(long long);
00290 case DRMS_TYPE_FLOAT : return sizeof(float);
00291 case DRMS_TYPE_DOUBLE : return sizeof(double);
00292 case DRMS_TYPE_TIME : return sizeof(double);
00293 case DRMS_TYPE_STRING : return sizeof(char);
00294 case DRMS_TYPE_RAW : return sizeof(int);
00295 default: return sizeof(int);
00296 }
00297 }
00298
00299
00300
00301
00302
00303 #ifdef ICCCOMP
00304 #pragma warning (disable : 279)
00305 #pragma warning (disable : 188)
00306 #pragma warning (disable : 981)
00307 #pragma warning (disable : 1418)
00308 #endif
00309
00310
00311
00312
00313 int f_isnull(char * hdl) {
00314 void * ptr = _convert_handle(hdl);
00315 return ptr == (void *) 0;
00316 }
00317 FCALLSCFUN1(LOGICAL,f_isnull,F_ISNULL,f_isnull,STRING)
00318
00319
00320
00321
00322
00323
00324
00325
00326 char * f_drms_env_handle(void)
00327 {
00328 extern DRMS_Env_t *drms_env;
00329 return _pointer2handle((void *) drms_env, "DRMS_Env_t", "f_drms_env_handle");
00330 }
00331
00332 FCALLSCFUN0(STRING, f_drms_env_handle, F_DRMS_ENV_HANDLE, f_drms_env_handle)
00333
00334
00335
00336
00337
00338
00339
00340 char * f_drms_array_create(DRMS_Type_t type, int naxis, int *axis, void *data, int *status) {
00341 DRMS_Array_t * _ret_var;
00342
00343 _ret_var = drms_array_create(type, naxis, axis, data, status);
00344 return _pointer2handle((void *)_ret_var, "DRMS_Array_t", "drms_array_create");
00345 }
00346 FCALLSCFUN5(STRING, f_drms_array_create, F_DRMS_ARRAY_CREATE, f_drms_array_create, INT, INT, PINT, PVOID, PINT)
00347
00348 char * f_drms_array_create_empty(DRMS_Type_t type, int naxis, int *axis, int *status) {
00349 DRMS_Array_t * _ret_var;
00350
00351 _ret_var = drms_array_create(type, naxis, axis, NULL, status);
00352 return _pointer2handle((void *)_ret_var, "DRMS_Array_t", "drms_array_create");
00353 }
00354 FCALLSCFUN4(STRING, f_drms_array_create_empty, F_DRMS_ARRAY_CREATE_EMPTY, f_drms_array_create_empty, INT, INT, PINT, PINT)
00355
00356 void f_drms_free_array(char * arr_hdl, int size) {
00357 DRMS_Array_t * arr = (DRMS_Array_t *) _convert_handle(arr_hdl);
00358 _freehandle(&arr_hdl);
00359 drms_free_array(arr);
00360 }
00361 FCALLSCSUB1(f_drms_free_array, F_DRMS_FREE_ARRAY, f_drms_free_array, PSTRING)
00362
00363
00364 void f_drms_array_convert_inplace(DRMS_Type_t newtype, double bzero, double bscale, char * src_hdl) {
00365 DRMS_Array_t * src = (DRMS_Array_t *) _convert_handle(src_hdl);
00366
00367 return drms_array_convert_inplace(newtype, bzero, bscale, src);
00368 }
00369 FCALLSCSUB4(f_drms_array_convert_inplace, F_DRMS_ARRAY_CONVERT_INPLACE, f_drms_array_convert_inplace, INT, DOUBLE, DOUBLE, STRING)
00370
00371
00372 char * f_drms_array_convert(DRMS_Type_t dsttype, double bzero, double bscale, char * src_hdl) {
00373 DRMS_Array_t * src = (DRMS_Array_t *) _convert_handle(src_hdl);
00374 DRMS_Array_t * _ret_var;
00375
00376 _ret_var = drms_array_convert(dsttype, bzero, bscale, src);
00377 return _pointer2handle((void *)_ret_var, "DRMS_Array_t", "drms_array_convert");
00378 }
00379 FCALLSCFUN4(STRING, f_drms_array_convert, F_DRMS_ARRAY_CONVERT, f_drms_array_convert, INT, DOUBLE, DOUBLE, STRING)
00380
00381
00382 char * f_drms_array_slice(int *start, int *end, char * src_hdl) {
00383 DRMS_Array_t * src = (DRMS_Array_t *) _convert_handle(src_hdl);
00384 DRMS_Array_t * _ret_var;
00385
00386 _ret_var = drms_array_slice(start, end, src);
00387 return _pointer2handle((void *)_ret_var, "DRMS_Array_t", "drms_array_slice");
00388 }
00389 FCALLSCFUN3(STRING, f_drms_array_slice, F_DRMS_ARRAY_SLICE, f_drms_array_slice, PINT, PINT, STRING)
00390
00391
00392 char * f_drms_array_permute(char * src_hdl, int *perm, int *status) {
00393 DRMS_Array_t * src = (DRMS_Array_t *) _convert_handle(src_hdl);
00394 DRMS_Array_t * _ret_var;
00395
00396 _ret_var = drms_array_permute(src, perm, status);
00397 return _pointer2handle((void *)_ret_var, "DRMS_Array_t", "drms_array_permute");
00398 }
00399 FCALLSCFUN3(STRING, f_drms_array_permute, F_DRMS_ARRAY_PERMUTE, f_drms_array_permute, STRING, PINT, PINT)
00400
00401
00402
00403
00404
00405 FCALLSCFUN7(INT, drms_array_rawconvert, F_DRMS_ARRAY_RAWCONVERT, f_drms_array_rawconvert, INT, INT, DOUBLE, DOUBLE, PVOID, INT, PVOID)
00406
00407
00408 void f_drms_array2missing(char * arr_hdl) {
00409 DRMS_Array_t * arr = (DRMS_Array_t *) _convert_handle(arr_hdl);
00410
00411 return drms_array2missing(arr);
00412 }
00413 FCALLSCSUB1(f_drms_array2missing, F_DRMS_ARRAY2MISSING, f_drms_array2missing, STRING)
00414
00415
00416 void f_drms_array_print(char * arr_hdl, const char *colsep, const char *rowsep) {
00417 DRMS_Array_t * arr = (DRMS_Array_t *) _convert_handle(arr_hdl);
00418
00419 return drms_array_print(arr, colsep, rowsep);
00420 }
00421 FCALLSCSUB3(f_drms_array_print, F_DRMS_ARRAY_PRINT, f_drms_array_print, STRING, STRING, STRING)
00422
00423
00424
00425
00426
00427 FCALLSCFUN6(INT, drms_array2char, F_DRMS_ARRAY2CHAR, f_drms_array2char, INT, INT, DOUBLE, DOUBLE, PVOID, STRING)
00428
00429
00430
00431
00432
00433 FCALLSCFUN6(INT, drms_array2short, F_DRMS_ARRAY2SHORT, f_drms_array2short, INT, INT, DOUBLE, DOUBLE, PVOID, PSHORT)
00434
00435
00436
00437
00438
00439 FCALLSCFUN6(INT, drms_array2int, F_DRMS_ARRAY2INT, f_drms_array2int, INT, INT, DOUBLE, DOUBLE, PVOID, PINT)
00440
00441
00442
00443
00444
00445 FCALLSCFUN6(INT, drms_array2longlong, F_DRMS_ARRAY2LONGLONG, f_drms_array2longlong, INT, INT, DOUBLE, DOUBLE, PVOID, PLONGLONG)
00446
00447
00448
00449
00450
00451 FCALLSCFUN6(INT, drms_array2float, F_DRMS_ARRAY2FLOAT, f_drms_array2float, INT, INT, DOUBLE, DOUBLE, PVOID, PFLOAT)
00452
00453
00454
00455
00456
00457 FCALLSCFUN6(INT, drms_array2double, F_DRMS_ARRAY2DOUBLE, f_drms_array2double, INT, INT, DOUBLE, DOUBLE, PVOID, PDOUBLE)
00458
00459
00460
00461
00462
00463 FCALLSCFUN6(INT, drms_array2time, F_DRMS_ARRAY2TIME, f_drms_array2time, INT, INT, DOUBLE, DOUBLE, PVOID, PDOUBLE)
00464
00465
00466
00467 int f_drms_array2string(int n, DRMS_Type_t src_type, double bzero, double bscale, void *src, void *char_dst) {
00468 int stat, a2s_len = DRMS_ARRAY2STRING_LEN;
00469 char **_dst = (char **) NULL;
00470 char *alloc_dst = (char *) NULL;
00471 int i=0;
00472
00473 Fort_Alloc_t *dst = (Fort_Alloc_t *) char_dst;
00474
00475 stat = drms_array2string(n, src_type, bzero, bscale, src, _dst);
00476
00477
00478 alloc_dst = malloc(a2s_len*n);
00479 XASSERT(alloc_dst);
00480
00481 if (stat != DRMS_ERROR_INVALIDTYPE) {
00482 for (i=0; i<n; i++) {
00483 strncpy(alloc_dst + a2s_len*i, _dst[i], a2s_len);
00484 }
00485
00486 for (i=0; i<n; i++) {
00487 free(_dst[i]);
00488 }
00489 free(_dst);
00490 }
00491
00492
00493 fort_alloc(dst, alloc_dst, n, a2s_len, 1);
00494
00495 return stat;
00496 }
00497
00498 FCALLSCFUN6(INT, f_drms_array2string, F_DRMS_ARRAY2STRING, f_drms_array2string, INT, INT, DOUBLE, DOUBLE, PVOID, PVOID)
00499
00500
00501
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511 char * f_drms_connect(char *host) {
00512 DRMS_Session_t * _ret_var;
00513
00514 _ret_var = drms_connect(host);
00515 return _pointer2handle((void *)_ret_var, "DRMS_Session_t", "drms_connect");
00516 }
00517 FCALLSCFUN1(STRING, f_drms_connect, F_DRMS_CONNECT, f_drms_connect, STRING)
00518
00519 #ifdef DRMS_CLIENT
00520 void f_drms_disconnect(char * env_hdl, int abort) {
00521 DRMS_Env_t * env = (DRMS_Env_t *) _convert_handle(env_hdl);
00522
00523 return drms_disconnect(env, abort);
00524 }
00525 FCALLSCSUB2(f_drms_disconnect, F_DRMS_DISCONNECT, f_drms_disconnect, STRING, INT)
00526 #endif
00527
00528 int f_drms_commit(char * env_hdl) {
00529 DRMS_Env_t * env = (DRMS_Env_t *) _convert_handle(env_hdl);
00530
00531 return drms_commit(env);
00532 }
00533 FCALLSCFUN1(INT, f_drms_commit, F_DRMS_COMMIT, f_drms_commit, STRING)
00534
00535
00536 int f_drms_rollback(char * session_hdl) {
00537 DRMS_Session_t * session = (DRMS_Session_t *) _convert_handle(session_hdl);
00538
00539 return drms_rollback(session);
00540 }
00541 FCALLSCFUN1(INT, f_drms_rollback, F_DRMS_ROLLBACK, f_drms_rollback, STRING)
00542
00543
00544 char * f_drms_query_txt(char * session_hdl, char *query) {
00545 DRMS_Session_t * session = (DRMS_Session_t *) _convert_handle(session_hdl);
00546 DB_Text_Result_t * _ret_var;
00547
00548 _ret_var = drms_query_txt(session, query);
00549 return _pointer2handle((void *)_ret_var, "DB_Text_Result_t", "drms_query_txt");
00550 }
00551 FCALLSCFUN2(STRING, f_drms_query_txt, F_DRMS_QUERY_TXT, f_drms_query_txt, STRING, STRING)
00552
00553
00554 char * f_drms_query_bin(char * session_hdl, char *query) {
00555 DRMS_Session_t * session = (DRMS_Session_t *) _convert_handle(session_hdl);
00556 DB_Binary_Result_t * _ret_var;
00557
00558 _ret_var = drms_query_bin(session, query);
00559 return _pointer2handle((void *)_ret_var, "DB_Binary_Result_t", "drms_query_bin");
00560 }
00561 FCALLSCFUN2(STRING, f_drms_query_bin, F_DRMS_QUERY_BIN, f_drms_query_bin, STRING, STRING)
00562
00563
00564
00565
00566
00567
00568
00569
00570
00571
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586
00587
00588
00589
00590 int f_drms_dms(char * session_hdl, int *row_count, char *query) {
00591 DRMS_Session_t * session = (DRMS_Session_t *) _convert_handle(session_hdl);
00592
00593 return drms_dms(session, row_count, query);
00594 }
00595 FCALLSCFUN3(INT, f_drms_dms, F_DRMS_DMS, f_drms_dms, STRING, PINT, STRING)
00596
00597
00598
00599
00600
00601
00602
00603
00604
00605
00606
00607
00608
00609
00610
00611
00612
00613
00614
00615
00616
00617
00618
00619
00620
00621
00622
00623
00624
00625
00626
00627
00628
00629
00630
00631
00632
00633
00634
00635
00636
00637
00638
00639
00640
00641
00642
00643
00644 #if EXPANDAPI
00645
00646
00647
00648
00649
00650
00651 int f_drms_sequence_drop(char * session_hdl, char *table) {
00652 DRMS_Session_t * session = (DRMS_Session_t *) _convert_handle(session_hdl);
00653
00654 return drms_sequence_drop(session, table);
00655 }
00656 FCALLSCFUN2(INT, f_drms_sequence_drop, F_DRMS_SEQUENCE_DROP, f_drms_sequence_drop, STRING, STRING)
00657
00658
00659 int f_drms_sequence_create(char * session_hdl, char *table) {
00660 DRMS_Session_t * session = (DRMS_Session_t *) _convert_handle(session_hdl);
00661
00662 return drms_sequence_create(session, table);
00663 }
00664 FCALLSCFUN2(INT, f_drms_sequence_create, F_DRMS_SEQUENCE_CREATE, f_drms_sequence_create, STRING, STRING)
00665
00666
00667
00668 void f_drms_sequence_getnext(long long * seq, char * session_hdl, char *table, int n) {
00669 DRMS_Session_t * session = (DRMS_Session_t *) _convert_handle(session_hdl);
00670
00671 seq = drms_sequence_getnext(session, table, n);
00672 return;
00673 }
00674 FCALLSCSUB4(f_drms_sequence_getnext, F_DRMS_SEQUENCE_GETNEXT, f_drms_sequence_getnext,PLONGLONG, STRING, STRING, INT)
00675
00676 long long f_drms_sequence_getcurrent(char * session_hdl, char *table) {
00677 DRMS_Session_t * session = (DRMS_Session_t *) _convert_handle(session_hdl);
00678
00679 return drms_sequence_getcurrent(session, table);
00680 }
00681 FCALLSCFUN2(LONGLONG, f_drms_sequence_getcurrent, F_DRMS_SEQUENCE_GETCURRENT, f_drms_sequence_getcurrent, STRING, STRING)
00682
00683 long long f_drms_sequence_getlast(char * session_hdl, char *table) {
00684 DRMS_Session_t * session = (DRMS_Session_t *) _convert_handle(session_hdl);
00685
00686 return drms_sequence_getlast(session, table);
00687 }
00688 FCALLSCFUN2(LONGLONG, f_drms_sequence_getlast, F_DRMS_SEQUENCE_GETLAST, f_drms_sequence_getlast, STRING, STRING)
00689
00690
00691
00692 void f_drms_alloc_recnum(long long * recnum, char * session_hdl, char *series, DRMS_RecLifetime_t lifetime, int n) {
00693 DRMS_Session_t * session = (DRMS_Session_t *) _convert_handle(session_hdl);
00694
00695 recnum = drms_alloc_recnum(session, series, lifetime, n);
00696
00697 return;
00698 }
00699 FCALLSCSUB5(f_drms_alloc_recnum, F_DRMS_ALLOC_RECNUM, f_drms_alloc_recnum, PLONGLONG, STRING, STRING, INT, INT)
00700
00701
00702 char * f_drms_getunit(char * env_hdl, char *series, long long sunum, int retrieve, int *status) {
00703 DRMS_Env_t * env = (DRMS_Env_t *) _convert_handle(env_hdl);
00704 DRMS_StorageUnit_t * _ret_var;
00705
00706 _ret_var = drms_getunit(env, series, sunum, retrieve, status);
00707 return _pointer2handle((void *)_ret_var, "DRMS_StorageUnit_t", "drms_getunit");
00708 }
00709 FCALLSCFUN5(STRING, f_drms_getunit, F_DRMS_GETUNIT, f_drms_getunit, STRING, STRING, LONG, INT, PINT)
00710
00711 int f_drms_newslots(char * env_hdl, int n, char *series, long long *recnum, DRMS_RecLifetime_t lifetime, int *slotnum, char * su_hdl, int size) {
00712 DRMS_Env_t * env = (DRMS_Env_t *) _convert_handle(env_hdl);
00713 DRMS_StorageUnit_t ** su = (DRMS_StorageUnit_t **) _convert_handle(su_hdl);
00714
00715 return drms_newslots(env, n, series, recnum, lifetime, slotnum, su);
00716 }
00717 FCALLSCFUN7(INT, f_drms_newslots, F_DRMS_NEWSLOTS, f_drms_newslots, STRING, INT, STRING, PLONGLONG, INT, PINT, PSTRING)
00718
00719
00720 int f_drms_slot_setstate(char * env_hdl, char *series, long long sunum, int slotnum, int state) {
00721 DRMS_Env_t * env = (DRMS_Env_t *) _convert_handle(env_hdl);
00722
00723 return drms_slot_setstate(env, series, sunum, slotnum, state);
00724 }
00725 FCALLSCFUN5(INT, f_drms_slot_setstate, F_DRMS_SLOT_SETSTATE, f_drms_slot_setstate, STRING, STRING, LONG, INT, INT)
00726 #endif
00727
00728
00729 int f_drms_create_series(char * rec_hdl, int perms) {
00730 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
00731
00732 return drms_create_series(rec, perms);
00733 }
00734 FCALLSCFUN2(INT, f_drms_create_series, F_DRMS_CREATE_SERIES, f_drms_create_series, STRING, INT)
00735
00736
00737 int f_drms_update_series(char * rec_hdl, int perms) {
00738 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
00739
00740 return drms_update_series(rec, perms);
00741 }
00742 FCALLSCFUN2(INT, f_drms_update_series, F_DRMS_UPDATE_SERIES, f_drms_update_series, STRING, INT)
00743
00744
00745
00746
00747
00748
00749
00750
00751
00752
00753
00754
00755 void f_drms_free_template_keyword_struct(char * key_hdl) {
00756 DRMS_Keyword_t * key = (DRMS_Keyword_t *) _convert_handle(key_hdl);
00757
00758 return drms_free_template_keyword_struct(key);
00759 }
00760 FCALLSCSUB1(f_drms_free_template_keyword_struct, F_DRMS_FREE_TEMPLATE_KEYWORD_STRUCT, f_drms_free_template_keyword_struct, STRING)
00761
00762
00763 void f_drms_free_keyword_struct(char * key_hdl) {
00764 DRMS_Keyword_t * key = (DRMS_Keyword_t *) _convert_handle(key_hdl);
00765
00766 return drms_free_keyword_struct(key);
00767 }
00768 FCALLSCSUB1(f_drms_free_keyword_struct, F_DRMS_FREE_KEYWORD_STRUCT, f_drms_free_keyword_struct, STRING)
00769
00770
00771 void f_drms_copy_keyword_struct(char * dst_hdl, char * src_hdl) {
00772 DRMS_Keyword_t * dst = (DRMS_Keyword_t *) _convert_handle(dst_hdl);
00773 DRMS_Keyword_t * src = (DRMS_Keyword_t *) _convert_handle(src_hdl);
00774
00775 return drms_copy_keyword_struct(dst, src);
00776 }
00777 FCALLSCSUB2(f_drms_copy_keyword_struct, F_DRMS_COPY_KEYWORD_STRUCT, f_drms_copy_keyword_struct, STRING, STRING)
00778
00779 void f_drms_keyword_print(char * key_hdl) {
00780 DRMS_Keyword_t * key = (DRMS_Keyword_t *) _convert_handle(key_hdl);
00781
00782 return drms_keyword_print(key);
00783 }
00784 FCALLSCSUB1(f_drms_keyword_print, F_DRMS_KEYWORD_PRINT, f_drms_keyword_print, STRING)
00785
00786
00787 void f_drms_keyword_printval(char * key_hdl) {
00788 DRMS_Keyword_t * key = (DRMS_Keyword_t *) _convert_handle(key_hdl);
00789
00790 return drms_keyword_printval(key);
00791 }
00792 FCALLSCSUB1(f_drms_keyword_printval, F_DRMS_KEYWORD_PRINTVAL, f_drms_keyword_printval, STRING)
00793
00794
00795 int f_drms_template_keywords(char * template_hdl) {
00796 DRMS_Record_t * template = (DRMS_Record_t *) _convert_handle(template_hdl);
00797
00798 return drms_template_keywords(template);
00799 }
00800 FCALLSCFUN1(INT, f_drms_template_keywords, F_DRMS_TEMPLATE_KEYWORDS, f_drms_template_keywords, STRING)
00801
00802
00803 char * f_drms_keyword_lookup(char * rec_hdl, const char *key, int followlink) {
00804 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
00805 DRMS_Keyword_t * _ret_var;
00806
00807 _ret_var = drms_keyword_lookup(rec, key, followlink);
00808 return _pointer2handle((void *)_ret_var, "DRMS_Keyword_t", "drms_keyword_lookup");
00809 }
00810 FCALLSCFUN3(STRING, f_drms_keyword_lookup, F_DRMS_KEYWORD_LOOKUP, f_drms_keyword_lookup, STRING, STRING, INT)
00811
00812
00813 DRMS_Type_t f_drms_keyword_type(char * key_hdl) {
00814 DRMS_Keyword_t * key = (DRMS_Keyword_t *) _convert_handle(key_hdl);
00815
00816 return drms_keyword_type(key);
00817 }
00818 FCALLSCFUN1(INT, f_drms_keyword_type, F_DRMS_KEYWORD_TYPE, f_drms_keyword_type, STRING)
00819
00820 char f_drms_getkey_char(char * rec_hdl, const char *key, int *status) {
00821 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
00822
00823 return drms_getkey_char(rec, key, status);
00824 }
00825 FCALLSCFUN3(SHORT, f_drms_getkey_char, F_DRMS_GETKEY_CHAR, f_drms_getkey_char, STRING, STRING, PINT)
00826
00827
00828 short f_drms_getkey_short(char * rec_hdl, const char *key, int *status) {
00829 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
00830
00831 return drms_getkey_short(rec, key, status);
00832 }
00833 FCALLSCFUN3(SHORT, f_drms_getkey_short, F_DRMS_GETKEY_SHORT, f_drms_getkey_short, STRING, STRING, PINT)
00834
00835
00836 int f_drms_getkey_int(char * rec_hdl, const char *key, int *status) {
00837 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
00838
00839 return drms_getkey_int(rec, key, status);
00840 }
00841 FCALLSCFUN3(INT, f_drms_getkey_int, F_DRMS_GETKEY_INT, f_drms_getkey_int, STRING, STRING, PINT)
00842
00843 long long f_drms_getkey_longlong(char * rec_hdl, const char *key, int *status) {
00844 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
00845
00846 return drms_getkey_longlong(rec, key, status);
00847 }
00848 FCALLSCFUN3(LONGLONG, f_drms_getkey_longlong, F_DRMS_GETKEY_LONGLONG, f_drms_getkey_longlong, STRING, STRING, PINT)
00849
00850
00851 float f_drms_getkey_float(char * rec_hdl, const char *key, int *status) {
00852 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
00853
00854 return drms_getkey_float(rec, key, status);
00855 }
00856 FCALLSCFUN3(FLOAT, f_drms_getkey_float, F_DRMS_GETKEY_FLOAT, f_drms_getkey_float, STRING, STRING, PINT)
00857
00858
00859 double f_drms_getkey_double(char * rec_hdl, const char *key, int *status) {
00860 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
00861
00862 return drms_getkey_double(rec, key, status);
00863 }
00864 FCALLSCFUN3(DOUBLE, f_drms_getkey_double, F_DRMS_GETKEY_DOUBLE, f_drms_getkey_double, STRING, STRING, PINT)
00865
00866
00867 char * f_drms_getkey_string(char * rec_hdl, const char *key, int *status) {
00868 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
00869
00870 return drms_getkey_string(rec, key, status);
00871 }
00872 FCALLSCFUN3(STRING, f_drms_getkey_string, F_DRMS_GETKEY_STRING, f_drms_getkey_string, STRING, STRING, PINT)
00873
00874
00875
00876
00877
00878
00879
00880
00881
00882
00883
00884
00885
00886
00887
00888
00889
00890
00891
00892
00893
00894 int f_drms_setkey_char(char * rec_hdl, const char *key, char value) {
00895 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
00896
00897 return drms_setkey_char(rec, key, (char) value);
00898 }
00899 FCALLSCFUN3(INT, f_drms_setkey_char, F_DRMS_SETKEY_CHAR, f_drms_setkey_char, STRING, STRING, BYTE)
00900
00901
00902 int f_drms_setkey_short(char * rec_hdl, const char *key, short value) {
00903 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
00904
00905 return drms_setkey_short(rec, key, value);
00906 }
00907 FCALLSCFUN3(INT, f_drms_setkey_short, F_DRMS_SETKEY_SHORT, f_drms_setkey_short, STRING, STRING, SHORT)
00908
00909
00910 int f_drms_setkey_int(char * rec_hdl, const char *key, int value) {
00911 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
00912
00913 return drms_setkey_int(rec, key, value);
00914 }
00915 FCALLSCFUN3(INT, f_drms_setkey_int, F_DRMS_SETKEY_INT, f_drms_setkey_int, STRING, STRING, INT)
00916
00917
00918 int f_drms_setkey_longlong(char * rec_hdl, const char *key, long long value) {
00919 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
00920
00921 return drms_setkey_longlong(rec, key, value);
00922 }
00923 FCALLSCFUN3(INT, f_drms_setkey_longlong, F_DRMS_SETKEY_LONGLONG, f_drms_setkey_longlong, STRING, STRING, LONG)
00924
00925
00926 int f_drms_setkey_float(char * rec_hdl, const char *key, float value) {
00927 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
00928
00929 return drms_setkey_float(rec, key, value);
00930 }
00931 FCALLSCFUN3(INT, f_drms_setkey_float, F_DRMS_SETKEY_FLOAT, f_drms_setkey_float, STRING, STRING, FLOAT)
00932
00933
00934 int f_drms_setkey_double(char * rec_hdl, const char *key, double value) {
00935 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
00936
00937 return drms_setkey_double(rec, key, value);
00938 }
00939 FCALLSCFUN3(INT, f_drms_setkey_double, F_DRMS_SETKEY_DOUBLE, f_drms_setkey_double, STRING, STRING, DOUBLE)
00940
00941
00942 int f_drms_setkey_string(char * rec_hdl, const char *key, char *value) {
00943 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
00944
00945 return drms_setkey_string(rec, key, value);
00946 }
00947 FCALLSCFUN3(INT, f_drms_setkey_string, F_DRMS_SETKEY_STRING, f_drms_setkey_string, STRING, STRING, STRING)
00948
00949
00950
00951
00952
00953
00954
00955
00956
00957
00958
00959
00960
00961 void f_drms_free_template_link_struct(char * link_hdl) {
00962 DRMS_Link_t * link = (DRMS_Link_t *) _convert_handle(link_hdl);
00963
00964 return drms_free_template_link_struct(link);
00965 }
00966 FCALLSCSUB1(f_drms_free_template_link_struct, F_DRMS_FREE_TEMPLATE_LINK_STRUCT, f_drms_free_template_link_struct, STRING)
00967
00968
00969 void f_drms_free_link_struct(char * link_hdl) {
00970 DRMS_Link_t * link = (DRMS_Link_t *) _convert_handle(link_hdl);
00971
00972 return drms_free_link_struct(link);
00973 }
00974 FCALLSCSUB1(f_drms_free_link_struct, F_DRMS_FREE_LINK_STRUCT, f_drms_free_link_struct, STRING)
00975
00976
00977 void f_drms_copy_link_struct(char * dst_hdl, char * src_hdl) {
00978 DRMS_Link_t * dst = (DRMS_Link_t *) _convert_handle(dst_hdl);
00979 DRMS_Link_t * src = (DRMS_Link_t *) _convert_handle(src_hdl);
00980
00981 return drms_copy_link_struct(dst, src);
00982 }
00983 FCALLSCSUB2(f_drms_copy_link_struct, F_DRMS_COPY_LINK_STRUCT, f_drms_copy_link_struct, STRING, STRING)
00984
00985 int f_drms_setlink_static(char * rec_hdl, const char *linkname, long long recnum) {
00986 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
00987
00988 return drms_setlink_static(rec, linkname, recnum);
00989 }
00990 FCALLSCFUN3(INT, f_drms_setlink_static, F_DRMS_SETLINK_STATIC, f_drms_setlink_static, STRING, STRING, LONG)
00991
00992
00993
00994
00995
00996
00997
00998
00999
01000
01001
01002
01003
01004
01005 char * f_drms_link_follow(char * rec_hdl, const char *linkname, int *status) {
01006 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01007 DRMS_Record_t * _ret_var;
01008
01009 _ret_var = drms_link_follow(rec, linkname, status);
01010 return _pointer2handle((void *)_ret_var, "DRMS_Record_t", "drms_link_follow");
01011 }
01012 FCALLSCFUN3(STRING, f_drms_link_follow, F_DRMS_LINK_FOLLOW, f_drms_link_follow, STRING, STRING, PINT)
01013
01014
01015 char * f_drms_link_followall(char * rec_hdl, const char *linkname, int *status) {
01016 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01017 DRMS_RecordSet_t * _ret_var;
01018
01019 _ret_var = drms_link_followall(rec, linkname, status);
01020 return _pointer2handle((void *)_ret_var, "DRMS_RecordSet_t", "drms_link_followall");
01021 }
01022 FCALLSCFUN3(STRING, f_drms_link_followall, F_DRMS_LINK_FOLLOWALL, f_drms_link_followall, STRING, STRING, PINT)
01023
01024
01025 void f_drms_link_print(char * link_hdl) {
01026 DRMS_Link_t * link = (DRMS_Link_t *) _convert_handle(link_hdl);
01027
01028 return drms_link_print(link);
01029 }
01030 FCALLSCSUB1(f_drms_link_print, F_DRMS_LINK_PRINT, f_drms_link_print, STRING)
01031
01032
01033 int f_drms_template_links(char * template_hdl) {
01034 DRMS_Record_t * template = (DRMS_Record_t *) _convert_handle(template_hdl);
01035
01036 return drms_template_links(template);
01037 }
01038 FCALLSCFUN1(INT, f_drms_template_links, F_DRMS_TEMPLATE_LINKS, f_drms_template_links, STRING)
01039
01040
01041 void f_drms_link_getpidx(char * rec_hdl) {
01042 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01043
01044 return drms_link_getpidx(rec);
01045 }
01046 FCALLSCSUB1(f_drms_link_getpidx, F_DRMS_LINK_GETPIDX, f_drms_link_getpidx, STRING)
01047
01048
01049
01050
01051
01052
01053
01054
01055
01056
01057
01058
01059
01060
01061 void f_free_record_set(char * rs_hdl) {
01062 RecordSet_t * rs = (RecordSet_t *) _convert_handle(rs_hdl);
01063
01064 return free_record_set(rs);
01065 }
01066 FCALLSCSUB1(f_free_record_set, F_FREE_RECORD_SET, f_free_record_set, STRING)
01067
01068 #if EXPANDAPI
01069
01070
01071 int f_drms_recordset_query(char * env_hdl,
01072 char *recordsetname,
01073 void *fquery,
01074 char *fseriesname,
01075 int size,
01076 int *filter,
01077 int * mix) {
01078 Fort_Alloc_t *query = (Fort_Alloc_t *) fquery;
01079 char *seriesname=fseriesname;
01080 char *query_alloc = (char *) NULL;
01081 int ret;
01082 DRMS_Env_t * env = (DRMS_Env_t *) _convert_handle(env_hdl);
01083
01084 ret = drms_recordset_query(env, recordsetname, &query_alloc, &seriesname, filter, mix);
01085
01086 fort_alloc(query, query_alloc, 1, DRMS_MAXQUERYLEN, 1);
01087 return ret;
01088 }
01089 FCALLSCFUN6(INT, f_drms_recordset_query, F_DRMS_RECORDSET_QUERY, f_drms_recordset_query, STRING, STRING, PVOID, PSTRING, PINT, PINT)
01090 #endif
01091
01092
01093
01094
01095
01096
01097
01098
01099
01100
01101
01102
01103
01104
01105
01106
01107
01108
01109
01110
01111
01112
01113
01114
01115
01116
01117
01118
01119
01120
01121 char * new_hiterator(char * hc_hdl) {
01122 HContainer_t * hc = (HContainer_t *) _convert_handle(hc_hdl);
01123 HIterator_t *hit= (HIterator_t *) NULL;
01124 hit = malloc(sizeof(HIterator_t));
01125 hiter_new(hit,hc);
01126 return _pointer2handle((void *) hit, "HIterator_t", "get_hiterator");
01127 }
01128 FCALLSCFUN1(STRING, new_hiterator, F_NEW_HITERATOR, f_new_hiterator, STRING)
01129
01130 void hiterator_rewind(char * hit_hdl) {
01131 HIterator_t * hit = (HIterator_t *) _convert_handle(hit_hdl);
01132 hiter_rewind(hit);
01133 }
01134 FCALLSCSUB1(hiterator_rewind, F_HITERATOR_REWIND, f_hiterator_rewind, STRING)
01135
01136 char * hiterator_getnext(char * hit_hdl) {
01137 HIterator_t * hit = (HIterator_t *) _convert_handle(hit_hdl);
01138 void * obj;
01139 obj = hiter_getnext(hit);
01140 return _pointer2handle((void *) obj, "undef_type", "hiterator_getnext");
01141 }
01142 FCALLSCFUN1(STRING,hiterator_getnext, F_HITERATOR_GETNEXT, f_hiterator_getnext, STRING)
01143
01144 void destroy_hiterator( char * hit_hdl) {
01145 HIterator_t * hit = (HIterator_t *) _convert_handle(hit_hdl);
01146 free(hit);
01147 return;
01148 }
01149 FCALLSCSUB1(destroy_hiterator, F_DESTROY_HITERATOR, f_destroy_hiterator, STRING)
01150
01151
01152
01153
01154
01155 int get_array_type (char * a_hdl) {
01156 DRMS_Array_t *a = (DRMS_Array_t *) _convert_handle(a_hdl);
01157
01158 return a->type;
01159 }
01160 FCALLSCFUN1(INT, get_array_type, F_GET_ARRAY_TYPE, f_get_array_type, STRING)
01161
01162 int get_array_naxis (char * a_hdl) {
01163 DRMS_Array_t *a = (DRMS_Array_t *) _convert_handle(a_hdl);
01164
01165 return a->naxis;
01166 }
01167 FCALLSCFUN1(INT, get_array_naxis, F_GET_ARRAY_NAXIS, f_get_array_naxis, STRING)
01168
01169 void get_array_axis(int * axis, char * a_hdl) {
01170 DRMS_Array_t *a = (DRMS_Array_t *) _convert_handle(a_hdl);
01171 int i=0;
01172
01173 for (i=0; i< DRMS_MAXRANK; i++)
01174 axis[i]=a->axis[i];
01175
01176 return;
01177 }
01178 FCALLSCSUB2(get_array_axis, F_GET_ARRAY_AXIS, f_get_array_axis, INTV, STRING)
01179
01180
01181 void get_array_data(void * data, char * a_hdl) {
01182 DRMS_Array_t *a = (DRMS_Array_t *) _convert_handle(a_hdl);
01183 Fort_Alloc_t *data_alloc = (Fort_Alloc_t *) data;
01184 int i=0, size=1;
01185
01186 for (i =0 ; i<a->naxis; i++)
01187 size *= a->axis[i];
01188 fort_alloc(data_alloc, a->data, size, drms_sizeof(a->type), 1);
01189 return;
01190 }
01191
01192
01193
01194
01195
01196
01197
01198
01199
01200
01201
01202
01203
01204
01205
01206
01207
01208
01209
01210
01211
01212
01213
01214
01215
01216 FCALLSCSUB2(get_array_data, F_GET_ARRAY_DATA, f_get_array_data, PVOID, STRING)
01217 FCALLSCSUB2(get_array_data, F_GET_ARRAY_DATA_BYTE, f_get_array_data_byte, PVOID, STRING)
01218 FCALLSCSUB2(get_array_data, F_GET_ARRAY_DATA_INTEGER, f_get_array_data_integer, PVOID, STRING)
01219 FCALLSCSUB2(get_array_data, F_GET_ARRAY_DATA_INTEGER8, f_get_array_data_integer8, PVOID, STRING)
01220 FCALLSCSUB2(get_array_data, F_GET_ARRAY_DATA_REAL, f_get_array_data_real, PVOID, STRING)
01221 FCALLSCSUB2(get_array_data, F_GET_ARRAY_DATA_REAL8, f_get_array_data_real8, PVOID, STRING)
01222 FCALLSCSUB2(get_array_data, F_GET_ARRAY_DATA_DOUBLE, f_get_array_data_double, PVOID, STRING)
01223
01224
01225
01226 int get_array_israw(char * a_hdl) {
01227 DRMS_Array_t *a = (DRMS_Array_t *) _convert_handle(a_hdl);
01228
01229
01230
01231
01232
01233 return a->israw;
01234 }
01235 FCALLSCFUN1(INT, get_array_israw, F_GET_ARRAY_ISRAW, f_get_array_israw, STRING)
01236
01237
01238 double get_array_bzero(char * a_hdl) {
01239 DRMS_Array_t *a = (DRMS_Array_t *) _convert_handle(a_hdl);
01240
01241 return a->bzero;
01242 }
01243 FCALLSCFUN1(DOUBLE, get_array_bzero, F_GET_ARRAY_BZERO, f_get_array_bzero, STRING)
01244
01245 double get_array_bscale(char* a_hdl) {
01246 DRMS_Array_t *a = (DRMS_Array_t *) _convert_handle(a_hdl);
01247
01248 return a->bscale;
01249 }
01250 FCALLSCFUN1(DOUBLE, get_array_bscale, F_GET_ARRAY_BSCALE, f_get_array_bscale, STRING)
01251
01252 void get_array_start(int * start, char * a_hdl) {
01253 DRMS_Array_t *a = (DRMS_Array_t *) _convert_handle(a_hdl);
01254 int i=0;
01255
01256 for (i=0; i< DRMS_MAXRANK; i++)
01257 start[i]=a->start[i];
01258
01259 return;
01260 }
01261 FCALLSCSUB2(get_array_start, F_GET_ARRAY_START, f_get_array_start, INTV, STRING)
01262
01263
01264 void get_array_dope( int * dope, char * a_hdl) {
01265 DRMS_Array_t *a = (DRMS_Array_t *) _convert_handle(a_hdl);
01266 int i=0;
01267
01268 for (i=0; i< DRMS_MAXRANK; i++)
01269 dope[i]=a->dope[i];
01270
01271 return;
01272 }
01273 FCALLSCSUB2(get_array_dope, F_GET_ARRAY_DOPE, f_get_array_dope, INTV, STRING)
01274
01275
01276
01277
01278
01279
01280
01281
01282
01283
01284
01285
01286
01287
01288
01289 long long get_array_buflen(char * a_hdl) {
01290 DRMS_Array_t *a = (DRMS_Array_t *) _convert_handle(a_hdl);
01291
01292 return a->buflen;
01293 }
01294 FCALLSCFUN1(LONGLONG, get_array_buflen, F_GET_ARRAY_BUFLEN, f_get_array_buflen, STRING)
01295
01296
01297
01298
01299
01300
01301
01302
01303
01304 int f_get_rs_num(char * rs_hdl) {
01305 DRMS_RecordSet_t * rs = (DRMS_RecordSet_t *) _convert_handle(rs_hdl);
01306 return drms_recordset_getnrecs(rs);
01307 }
01308 FCALLSCFUN1(INT, f_get_rs_num, F_GET_RS_NUM, f_get_rs_num, STRING)
01309
01310
01311 char * f_get_rs_record(char * rs_hdl, int index) {
01312 DRMS_RecordSet_t * rs = (DRMS_RecordSet_t *) _convert_handle(rs_hdl);
01313 return _pointer2handle((void *) rs->records[index], "DRMS_Record_t", "f_get_RS_record");
01314 }
01315 FCALLSCFUN2(STRING, f_get_rs_record, F_GET_RS_RECORD, f_get_rs_record, STRING, INT)
01316
01317
01318
01319
01320
01321
01322
01323 char * get_si_seriesname(char * si_hdl) {
01324 DRMS_SeriesInfo_t * si = (DRMS_SeriesInfo_t *) _convert_handle(si_hdl);
01325 return si->seriesname;
01326 }
01327 FCALLSCFUN1(STRING, get_si_seriesname, F_GET_SI_SERIESNAME, f_get_si_seriesname, STRING)
01328
01329
01330
01331 char * get_si_description(char * si_hdl) {
01332 DRMS_SeriesInfo_t * si = (DRMS_SeriesInfo_t *) _convert_handle(si_hdl);
01333 return si->description;
01334 }
01335 FCALLSCFUN1(STRING, get_si_description, F_GET_SI_DESCRIPTION, f_get_si_description, STRING)
01336
01337
01338
01339 char * get_si_owner(char * si_hdl) {
01340 DRMS_SeriesInfo_t * si = (DRMS_SeriesInfo_t *) _convert_handle(si_hdl);
01341 return si->owner;
01342 }
01343 FCALLSCFUN1(STRING, get_si_owner, F_GET_SI_OWNER, f_get_si_owner, STRING)
01344
01345
01346
01347 int get_si_unitsize(char * si_hdl) {
01348 DRMS_SeriesInfo_t * si = (DRMS_SeriesInfo_t *) _convert_handle(si_hdl);
01349 return si->unitsize;
01350 }
01351 FCALLSCFUN1(INT, get_si_unitsize, F_GET_SI_UNITSIZE, f_get_si_unitsize, STRING)
01352
01353
01354
01355 int get_si_archive(char * si_hdl) {
01356 DRMS_SeriesInfo_t * si = (DRMS_SeriesInfo_t *) _convert_handle(si_hdl);
01357 return si->archive;
01358 }
01359 FCALLSCFUN1(INT, get_si_archive, F_GET_SI_ARCHIVE, f_get_si_archive, STRING)
01360
01361
01362
01363 int get_si_retention(char * si_hdl) {
01364 DRMS_SeriesInfo_t * si = (DRMS_SeriesInfo_t *) _convert_handle(si_hdl);
01365 return si->retention;
01366 }
01367 FCALLSCFUN1(INT, get_si_retention, F_GET_SI_RETENTION, f_get_si_retention, STRING)
01368
01369
01370
01371 int get_si_tapegroup(char * si_hdl) {
01372 DRMS_SeriesInfo_t * si = (DRMS_SeriesInfo_t *) _convert_handle(si_hdl);
01373 return si->tapegroup;
01374 }
01375 FCALLSCFUN1(INT, get_si_tapegroup, F_GET_SI_TAPEGROUP, f_get_si_tapegroup, STRING)
01376
01377
01378
01379 int get_si_pidx_num(char * si_hdl) {
01380 DRMS_SeriesInfo_t * si = (DRMS_SeriesInfo_t *) _convert_handle(si_hdl);
01381 return si->pidx_num;
01382 }
01383 FCALLSCFUN1(INT, get_si_pidx_num, F_GET_SI_PIDX_NUM, f_get_si_pidx_num, STRING)
01384
01385
01386
01387 #define f_get_si_keyword_handlev_STRV_A1 TERM_CHARS(DRMS_MAXPRIMIDX,-1)
01388 void get_si_keyword_handleV(char * strV, char * si_hdl) {
01389 DRMS_SeriesInfo_t * si = (DRMS_SeriesInfo_t *) _convert_handle(si_hdl);
01390 char * key_hdl[DRMS_MAXPRIMIDX];
01391 int i=0;
01392 for (i=0; i<DRMS_MAXPRIMIDX; i++) {
01393 key_hdl[i]=_pointer2handle((void *) si->pidx_keywords[i], "DRMS_Keywords_t", "get_si_keyword_handle");
01394 strncpy(strV +FHANDLEKEYSIZE*i, key_hdl[i], FHANDLEKEYSIZE);
01395 }
01396
01397 return;
01398 }
01399 FCALLSCSUB2(get_si_keyword_handleV, F_GET_SI_KEYWORD_HANDLEV, f_get_si_keyword_handlev, PSTRINGV, STRING)
01400
01401
01402
01403
01404
01405
01406
01407
01408
01409 char * get_segment_record(char * seg_hdl) {
01410 DRMS_Segment_t * seg = (DRMS_Segment_t *) _convert_handle(seg_hdl);
01411
01412 return _pointer2handle((void *) seg->record, "DRMS_Record_t", "get_segment_record");
01413 }
01414 FCALLSCFUN1(STRING, get_segment_record, F_GET_SEGMENT_RECORD, f_get_segment_record, STRING)
01415
01416 char * get_segment_sinfo(char * seg_hdl) {
01417 DRMS_Segment_t * seg = (DRMS_Segment_t *) _convert_handle(seg_hdl);
01418
01419 return _pointer2handle((void *) seg->info, "DRMS_SegmentInfo_t", "get_segment_sinfo");
01420 }
01421 FCALLSCFUN1(STRING, get_segment_sinfo, F_GET_SEGMENT_SINFO, f_get_segment_sinfo, STRING)
01422
01423 char * get_segment_filename(char * seg_hdl) {
01424 DRMS_Segment_t * seg = (DRMS_Segment_t *) _convert_handle(seg_hdl);
01425
01426 return seg->filename;
01427 }
01428 FCALLSCFUN1(STRING, get_segment_filename, F_GET_SEGMENT_FILENAME, f_get_segment_filename, STRING)
01429
01430 void get_segment_axis(int * axis, char * seg_hdl) {
01431 DRMS_Segment_t * seg = (DRMS_Segment_t *) _convert_handle(seg_hdl);
01432
01433 int i=0;
01434 for (i=0; i< DRMS_MAXRANK; i++)
01435 axis[i]=seg->axis[i];
01436
01437 return;
01438 }
01439 FCALLSCSUB2(get_segment_axis, F_GET_SEGMENT_AXIS, f_get_segment_axis, INTV, STRING)
01440
01441 void get_segment_blocksize(int * blocksize, char * seg_hdl) {
01442 DRMS_Segment_t * seg = (DRMS_Segment_t *) _convert_handle(seg_hdl);
01443 int i=0;
01444
01445 for (i=0; i< DRMS_MAXRANK; i++)
01446 blocksize[i]=seg->blocksize[i];
01447 }
01448 FCALLSCSUB2(get_segment_blocksize, F_GET_SEGMENT_BLOCKSIZE, f_get_segment_blocksize, INTV, STRING)
01449
01450
01451
01452
01453
01454
01455
01456
01457
01458 char * get_record_env(char * rec_hdl) {
01459 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01460 DRMS_Env_t *env = rec->env;
01461 return _pointer2handle((void *) env, "DRMS_Env_t", "get_record_env");
01462 }
01463 FCALLSCFUN1(STRING, get_record_env, F_GET_RECORD_ENV, f_get_record_env, STRING)
01464
01465
01466
01467 long long get_record_recnum(char * rec_hdl) {
01468 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01469 return rec->recnum;
01470 }
01471 FCALLSCFUN1(LONGLONG, get_record_recnum, F_GET_RECORD_RECNUM, f_get_record_recnum, STRING)
01472
01473
01474
01475
01476 long long get_record_sunum(char * rec_hdl) {
01477 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01478 return rec->sunum;
01479 }
01480 FCALLSCFUN1(LONGLONG, get_record_sunum, F_GET_RECORD_SUNUM, f_get_record_sunum, STRING)
01481
01482
01483 int get_record_init(char * rec_hdl) {
01484 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01485 return rec->init;
01486 }
01487 FCALLSCFUN1(INT, get_record_init, F_GET_RECORD_INIT, f_get_record_init, STRING)
01488
01489 int get_record_readonly(char * rec_hdl) {
01490 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01491 return rec->readonly;
01492 }
01493 FCALLSCFUN1(INT, get_record_readonly, F_GET_RECORD_READONLY, f_get_record_readonly, STRING)
01494
01495
01496
01497 int get_record_lifetime(char * rec_hdl) {
01498 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01499 return rec->lifetime;
01500 }
01501 FCALLSCFUN1(INT, get_record_lifetime, F_GET_RECORD_LIFETIME, f_get_record_lifetime, STRING)
01502
01503
01504
01505
01506 char * get_record_su(char * rec_hdl) {
01507 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01508 DRMS_StorageUnit_t *su = rec->su;
01509 return _pointer2handle((void *) su, "DRMS_StorageUnit_t", "get_record_su");
01510 }
01511 FCALLSCFUN1(STRING, get_record_su, F_GET_RECORD_SU, f_get_record_su, STRING)
01512
01513 int get_record_slotnum(char * rec_hdl) {
01514 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01515 return rec->slotnum;
01516 }
01517 FCALLSCFUN1(INT, get_record_slotnum, F_GET_RECORD_SLOTNUM, f_get_record_slotnum, STRING)
01518
01519
01520 long long get_record_sessionid(char * rec_hdl) {
01521 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01522 return rec->sessionid;
01523 }
01524 FCALLSCFUN1(LONGLONG, get_record_sessionid, F_GET_RECORD_SESSIONID, f_get_record_sessionid, STRING)
01525
01526
01527 char * get_record_sessionns(char * rec_hdl) {
01528 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01529 return rec->sessionns;
01530 }
01531 FCALLSCFUN1(STRING, get_record_sessionns, F_GET_RECORD_SESSIONNS, f_get_record_sessionns, STRING)
01532
01533 char * get_record_seriesinfo(char * rec_hdl) {
01534 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01535 DRMS_SeriesInfo_t *seriesinfo = rec->seriesinfo;
01536 return _pointer2handle((void *) seriesinfo, "DRMS_SeriesInfo_t", "get_record_seriesinfo");
01537 }
01538 FCALLSCFUN1(STRING, get_record_seriesinfo, F_GET_RECORD_SERIESINFO, f_get_record_seriesinfo, STRING)
01539
01540 char * get_record_keywords(char * rec_hdl) {
01541 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01542 return _pointer2handle((void *) &rec->keywords, "HContainer_t", "get_record_keywords");
01543 }
01544 FCALLSCFUN1(STRING, get_record_keywords, F_GET_RECORD_KEYWORDS, f_get_record_keywords, STRING)
01545
01546 char * get_record_links(char * rec_hdl) {
01547 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01548 return _pointer2handle((void *) &rec->links, "HContainer_t", "get_record_links");
01549 }
01550 FCALLSCFUN1(STRING, get_record_links, F_GET_RECORD_LINKS, f_get_record_links, STRING)
01551
01552 char * get_record_segments(char * rec_hdl) {
01553 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01554 return _pointer2handle((void *) &rec->segments, "HContainer_t", "get_record_segments");
01555 }
01556 FCALLSCFUN1(STRING, get_record_segments, F_GET_RECORD_SEGMENTS, f_get_record_segments, STRING)
01557
01558
01559
01560 char * f_drms_open_records(char * env_hdl, char *recordsetname, int *status) {
01561 DRMS_Env_t * env = (DRMS_Env_t *) _convert_handle(env_hdl);
01562 DRMS_RecordSet_t * _ret_var;
01563
01564 _ret_var = drms_open_records(env, recordsetname, status);
01565 return _pointer2handle((void *)_ret_var, "DRMS_RecordSet_t", "drms_open_records");
01566 }
01567 FCALLSCFUN3(STRING, f_drms_open_records, F_DRMS_OPEN_RECORDS, f_drms_open_records, STRING, STRING, PINT)
01568
01569
01570 char * f_drms_create_records(char * env_hdl, int n, char *series, DRMS_RecLifetime_t lifetime, int *status) {
01571 DRMS_Env_t * env = (DRMS_Env_t *) _convert_handle(env_hdl);
01572 DRMS_RecordSet_t * _ret_var;
01573
01574 _ret_var = drms_create_records(env, n, series, lifetime, status);
01575 return _pointer2handle((void *)_ret_var, "DRMS_RecordSet_t", "drms_create_records");
01576 }
01577 FCALLSCFUN5(STRING, f_drms_create_records, F_DRMS_CREATE_RECORDS, f_drms_create_records, STRING, INT, STRING, INT, PINT)
01578
01579
01580 char * f_drms_create_records2(char * env_hdl, int n, char * template_hdl, DRMS_RecLifetime_t lifetime, int *status) {
01581 DRMS_Env_t * env = (DRMS_Env_t *) _convert_handle(env_hdl);
01582 DRMS_Record_t * template = (DRMS_Record_t *) _convert_handle(template_hdl);
01583 DRMS_RecordSet_t * _ret_var;
01584
01585 _ret_var = drms_create_records_fromtemplate(env, n, template, lifetime, status);
01586 return _pointer2handle((void *)_ret_var, "DRMS_RecordSet_t", "drms_create_records2");
01587 }
01588 FCALLSCFUN5(STRING, f_drms_create_records2, F_DRMS_CREATE_RECORDS2, f_drms_create_records2, STRING, INT, STRING, INT, PINT)
01589
01590 char * f_drms_clone_records(char * rs_in_hdl, DRMS_RecLifetime_t lifetime, DRMS_CloneAction_t mode, int *status) {
01591 DRMS_RecordSet_t * rs_in = (DRMS_RecordSet_t *) _convert_handle(rs_in_hdl);
01592 DRMS_RecordSet_t * _ret_var;
01593
01594 _ret_var = drms_clone_records(rs_in, lifetime, mode, status);
01595 return _pointer2handle((void *)_ret_var, "DRMS_RecordSet_t", "drms_clone_records");
01596 }
01597 FCALLSCFUN4(STRING, f_drms_clone_records, F_DRMS_CLONE_RECORDS, f_drms_clone_records, STRING, INT, INT, PINT)
01598
01599
01600 int f_drms_close_records(char * rs_hdl, int action) {
01601 DRMS_RecordSet_t * rs = (DRMS_RecordSet_t *) _convert_handle(rs_hdl);
01602
01603 return drms_close_records(rs, action);
01604 }
01605 FCALLSCFUN2(INT, f_drms_close_records, F_DRMS_CLOSE_RECORDS, f_drms_close_records, STRING, INT)
01606
01607 #if USEINTERNALHANDLES
01608 void free_handles(void) {
01609 int i;
01610 for (i =0 ; i< handle_index; i ++) {
01611 free(handles[i]);
01612 }
01613
01614 free(handles);
01615 handle_max_index = handle_index = 0;
01616 }
01617 #endif
01618
01619 void f_drms_free_records(char * rs_hdl, int size) {
01620 DRMS_RecordSet_t * rs = (DRMS_RecordSet_t *) _convert_handle(rs_hdl);
01621 strncpy(rs_hdl, "NULL", size);
01622
01623
01624
01625 #if USEINTERNALHANDLES
01626 free_handles();
01627 #endif
01628 return drms_free_records(rs);
01629 }
01630 FCALLSCSUB1(f_drms_free_records, F_DRMS_FREE_RECORDS, f_drms_free_records, PSTRING)
01631
01632
01633 char * f_drms_create_record(char * env_hdl, char *series, DRMS_RecLifetime_t lifetime, int *status) {
01634 DRMS_Env_t * env = (DRMS_Env_t *) _convert_handle(env_hdl);
01635 DRMS_Record_t * _ret_var;
01636
01637 _ret_var = drms_create_record(env, series, lifetime, status);
01638 return _pointer2handle((void *)_ret_var, "DRMS_Record_t", "drms_create_record");
01639 }
01640 FCALLSCFUN4(STRING, f_drms_create_record, F_DRMS_CREATE_RECORD, f_drms_create_record, STRING, STRING, INT, PINT)
01641
01642
01643 char * f_drms_clone_record(char * oldrec_hdl, DRMS_RecLifetime_t lifetime, DRMS_CloneAction_t mode, int *status) {
01644 DRMS_Record_t * oldrec = (DRMS_Record_t *) _convert_handle(oldrec_hdl);
01645 DRMS_Record_t * _ret_var;
01646
01647 _ret_var = drms_clone_record(oldrec, lifetime, mode, status);
01648 return _pointer2handle((void *)_ret_var, "DRMS_Record_t", "drms_clone_record");
01649 }
01650 FCALLSCFUN4(STRING, f_drms_clone_record, F_DRMS_CLONE_RECORD, f_drms_clone_record, STRING, INT, INT, PINT)
01651
01652
01653 int f_drms_close_record(char * rec_hdl, int action) {
01654 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01655
01656 return drms_close_record(rec, action);
01657 }
01658 FCALLSCFUN2(INT, f_drms_close_record, F_DRMS_CLOSE_RECORD, f_drms_close_record, STRING, INT)
01659
01660
01661 int f_drms_closeall_records(char * env_hdl, int action) {
01662 DRMS_Env_t * env = (DRMS_Env_t *) _convert_handle(env_hdl);
01663
01664 return drms_closeall_records(env, action);
01665 }
01666 FCALLSCFUN2(INT, f_drms_closeall_records, F_DRMS_CLOSEALL_RECORDS, f_drms_closeall_records, STRING, INT)
01667
01668
01669 void f_drms_free_record(char * rec_hdl) {
01670 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01671
01672 return drms_free_record(rec);
01673 }
01674 FCALLSCSUB1(f_drms_free_record, F_DRMS_FREE_RECORD, f_drms_free_record, STRING)
01675
01676 char * f_drms_alloc_record2(char * template_hdl, long long recnum, int *status) {
01677 DRMS_Record_t * template = (DRMS_Record_t *) _convert_handle(template_hdl);
01678 DRMS_Record_t * _ret_var;
01679
01680 _ret_var = drms_alloc_record2(template, recnum, status);
01681 return _pointer2handle((void *)_ret_var, "DRMS_Record_t", "drms_alloc_record2");
01682 }
01683 FCALLSCFUN3(STRING, f_drms_alloc_record2, F_DRMS_ALLOC_RECORD2, f_drms_alloc_record2, STRING, LONG, PINT)
01684
01685
01686 char * f_drms_alloc_record(char * env_hdl, const char *series, long long recnum, int *status) {
01687 DRMS_Env_t * env = (DRMS_Env_t *) _convert_handle(env_hdl);
01688 DRMS_Record_t * _ret_var;
01689
01690 _ret_var = drms_alloc_record(env, series, recnum, status);
01691 return _pointer2handle((void *)_ret_var, "DRMS_Record_t", "drms_alloc_record");
01692 }
01693 FCALLSCFUN4(STRING, f_drms_alloc_record, F_DRMS_ALLOC_RECORD, f_drms_alloc_record, STRING, STRING, LONG, PINT)
01694
01695
01696 char * f_drms_template_record(char * env_hdl, const char *seriesname, int *status) {
01697 DRMS_Env_t * env = (DRMS_Env_t *) _convert_handle(env_hdl);
01698 DRMS_Record_t * _ret_var;
01699
01700 _ret_var = drms_template_record(env, seriesname, status);
01701 return _pointer2handle((void *)_ret_var, "DRMS_Record_t", "drms_template_record");
01702 }
01703 FCALLSCFUN3(STRING, f_drms_template_record, F_DRMS_TEMPLATE_RECORD, f_drms_template_record, STRING, STRING, PINT)
01704
01705
01706 void f_drms_free_template_record_struct(char * rec_hdl) {
01707 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01708
01709 return drms_free_template_record_struct(rec);
01710 }
01711 FCALLSCSUB1(f_drms_free_template_record_struct, F_DRMS_FREE_TEMPLATE_RECORD_STRUCT, f_drms_free_template_record_struct, STRING)
01712
01713
01714 void f_drms_free_record_struct(char * rec_hdl) {
01715 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01716
01717 return drms_free_record_struct(rec);
01718 }
01719 FCALLSCSUB1(f_drms_free_record_struct, F_DRMS_FREE_RECORD_STRUCT, f_drms_free_record_struct, STRING)
01720
01721
01722 void f_drms_copy_record_struct(char * dst_hdl, char * src_hdl) {
01723 DRMS_Record_t * dst = (DRMS_Record_t *) _convert_handle(dst_hdl);
01724 DRMS_Record_t * src = (DRMS_Record_t *) _convert_handle(src_hdl);
01725
01726 return drms_copy_record_struct(dst, src);
01727 }
01728 FCALLSCSUB2(f_drms_copy_record_struct, F_DRMS_COPY_RECORD_STRUCT, f_drms_copy_record_struct, STRING, STRING)
01729
01730
01731 #ifdef NEVERWILLNEEDTHIS
01732 int f_drms_populate_record(char * rec_hdl, long long recnum) {
01733 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01734
01735 return drms_populate_record(rec, recnum);
01736 }
01737 FCALLSCFUN2(INT, f_drms_populate_record, F_DRMS_POPULATE_RECORD, f_drms_populate_record, STRING, LONG)
01738
01739
01740 int f_drms_populate_records(char * rs_hdl, char * qres_hdl) {
01741 DRMS_RecordSet_t * rs = (DRMS_RecordSet_t *) _convert_handle(rs_hdl);
01742 DB_Binary_Result_t * qres = (DB_Binary_Result_t *) _convert_handle(qres_hdl);
01743
01744 return drms_populate_records(rs, qres);
01745 }
01746 FCALLSCFUN2(INT, f_drms_populate_records, F_DRMS_POPULATE_RECORDS, f_drms_populate_records, STRING, STRING)
01747 #endif
01748
01749 char * f_drms_field_list(char * rec_hdl, int *num_cols) {
01750 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01751
01752 return drms_field_list(rec, num_cols);
01753 }
01754 FCALLSCFUN2(STRING, f_drms_field_list, F_DRMS_FIELD_LIST, f_drms_field_list, STRING, PINT)
01755
01756
01757 int f_drms_insert_records(char * recset_hdl) {
01758 DRMS_RecordSet_t * recset = (DRMS_RecordSet_t *) _convert_handle(recset_hdl);
01759 return drms_insert_records(recset);
01760 }
01761 FCALLSCFUN1(INT, f_drms_insert_records, F_DRMS_INSERT_RECORDS, f_drms_insert_records, STRING)
01762
01763 long long f_drms_record_size(char * rec_hdl) {
01764 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01765
01766 return drms_record_size(rec);
01767 }
01768 FCALLSCFUN1(LONGLONG, f_drms_record_size, F_DRMS_RECORD_SIZE, f_drms_record_size, STRING)
01769
01770
01771 void f_drms_print_record(char * rec_hdl) {
01772 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01773
01774 return drms_print_record(rec);
01775 }
01776 FCALLSCSUB1(f_drms_print_record, F_DRMS_PRINT_RECORD, f_drms_print_record, STRING)
01777
01778
01779 int f_drms_record_numkeywords(char * rec_hdl) {
01780 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01781
01782 return drms_record_numkeywords(rec);
01783 }
01784 FCALLSCFUN1(INT, f_drms_record_numkeywords, F_DRMS_RECORD_NUMKEYWORDS, f_drms_record_numkeywords, STRING)
01785
01786
01787 int f_drms_record_numlinks(char * rec_hdl) {
01788 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01789
01790 return drms_record_numlinks(rec);
01791 }
01792 FCALLSCFUN1(INT, f_drms_record_numlinks, F_DRMS_RECORD_NUMLINKS, f_drms_record_numlinks, STRING)
01793
01794
01795 int f_drms_record_numsegments(char * rec_hdl) {
01796 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01797
01798 return drms_record_numsegments(rec);
01799 }
01800 FCALLSCFUN1(INT, f_drms_record_numsegments, F_DRMS_RECORD_NUMSEGMENTS, f_drms_record_numsegments, STRING)
01801
01802
01803 int f_drms_record_num_nonlink_segments(char * rec_hdl) {
01804 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01805
01806 return drms_record_num_nonlink_segments(rec);
01807 }
01808 FCALLSCFUN1(INT, f_drms_record_num_nonlink_segments, F_DRMS_RECORD_NUM_NONLINK_SEGMENTS, f_drms_record_num_nonlink_segments, STRING)
01809
01810
01811 void f_drms_record_directory(char * rec_hdl, char *dirname, int size, int retrieve) {
01812 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01813 char buf[DRMS_MAXPATHLEN] = {0};
01814
01815 drms_record_directory(rec, buf, retrieve);
01816
01817 if (*buf)
01818 {
01819 strncpy(dirname, buf, size);
01820 }
01821
01822 return;
01823 }
01824 FCALLSCSUB3(f_drms_record_directory, F_DRMS_RECORD_DIRECTORY, f_drms_record_directory, STRING, PSTRING, INT)
01825
01826
01827 char * f_drms_record_fopen(char * rec_hdl, char *filename, const char *mode) {
01828 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01829 FILE * _ret_var;
01830
01831 _ret_var = drms_record_fopen(rec, filename, mode);
01832 return _pointer2handle((void *)_ret_var, "FILE", "drms_record_fopen");
01833 }
01834 FCALLSCFUN3(STRING, f_drms_record_fopen, F_DRMS_RECORD_FOPEN, f_drms_record_fopen, STRING, STRING, STRING)
01835
01836
01837 long long f_drms_record_memsize(char * rec_hdl) {
01838 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01839
01840 return drms_record_memsize(rec);
01841 }
01842 FCALLSCFUN1(LONGLONG, f_drms_record_memsize, F_DRMS_RECORD_MEMSIZE, f_drms_record_memsize, STRING)
01843
01844
01845 int f_drms_recproto_setseriesinfo(char * rec_hdl, int *unitSize, int *bArchive, int *nDaysRetention, int *tapeGroup, const char *description) {
01846 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01847
01848 return drms_recproto_setseriesinfo(rec, unitSize, bArchive, nDaysRetention, tapeGroup, description);
01849 }
01850 FCALLSCFUN6(INT, f_drms_recproto_setseriesinfo, F_DRMS_RECORD_SETSERIESINFO, f_drms_recproto_setseriesinfo, STRING, PINT, PINT, PINT, PINT, STRING)
01851
01852
01853
01854
01855
01856
01857
01858
01859
01860
01861
01862
01863
01864 int f_drms_segment_write_from_file(char *segment_hdl, char *infile) {
01865 DRMS_Segment_t * segment = (DRMS_Segment_t *) _convert_handle(segment_hdl);
01866 return drms_segment_write_from_file(segment, infile);
01867 }
01868 FCALLSCFUN2(INT, f_drms_segment_write_from_file, F_DRMS_SEGMENT_WRITE_FROM_FILE, f_drms_segment_write_from_file, STRING, STRING)
01869
01870 void f_drms_free_template_segment_struct(char * segment_hdl) {
01871 DRMS_Segment_t * segment = (DRMS_Segment_t *) _convert_handle(segment_hdl);
01872
01873 return drms_free_template_segment_struct(segment);
01874 }
01875 FCALLSCSUB1(f_drms_free_template_segment_struct, F_DRMS_FREE_TEMPLATE_SEGMENT_STRUCT, f_drms_free_template_segment_struct, STRING)
01876
01877
01878 void f_drms_free_segment_struct(char * segment_hdl) {
01879 DRMS_Segment_t * segment = (DRMS_Segment_t *) _convert_handle(segment_hdl);
01880
01881 return drms_free_segment_struct(segment);
01882 }
01883 FCALLSCSUB1(f_drms_free_segment_struct, F_DRMS_FREE_SEGMENT_STRUCT, f_drms_free_segment_struct, STRING)
01884
01885
01886 void f_drms_copy_segment_struct(char * dst_hdl, char * src_hdl) {
01887 DRMS_Segment_t * dst = (DRMS_Segment_t *) _convert_handle(dst_hdl);
01888 DRMS_Segment_t * src = (DRMS_Segment_t *) _convert_handle(src_hdl);
01889
01890 return drms_copy_segment_struct(dst, src);
01891 }
01892 FCALLSCSUB2(f_drms_copy_segment_struct, F_DRMS_COPY_SEGMENT_STRUCT, f_drms_copy_segment_struct, STRING, STRING)
01893
01894 int f_drms_template_segments(char * template_hdl) {
01895 DRMS_Record_t * template = (DRMS_Record_t *) _convert_handle(template_hdl);
01896
01897 return drms_template_segments(template);
01898 }
01899 FCALLSCFUN1(INT, f_drms_template_segments, F_DRMS_TEMPLATE_SEGMENTS, f_drms_template_segments, STRING)
01900
01901
01902 void f_drms_segment_print(char * seg_hdl) {
01903 DRMS_Segment_t * seg = (DRMS_Segment_t *) _convert_handle(seg_hdl);
01904
01905 return drms_segment_print(seg);
01906 }
01907 FCALLSCSUB1(f_drms_segment_print, F_DRMS_SEGMENT_PRINT, f_drms_segment_print, STRING)
01908
01909 long long f_drms_segment_size(char * seg_hdl, int *status) {
01910 DRMS_Segment_t * seg = (DRMS_Segment_t *) _convert_handle(seg_hdl);
01911
01912 return drms_segment_size(seg, status);
01913 }
01914 FCALLSCFUN2(LONGLONG, f_drms_segment_size, F_DRMS_SEGMENT_SIZE, f_drms_segment_size, STRING, PINT)
01915
01916 int f_drms_segment_setdims(char * dims_hdl, char * seg_hdl) {
01917 DRMS_Segment_t * seg = (DRMS_Segment_t *) _convert_handle(seg_hdl);
01918 DRMS_SegmentDimInfo_t * dims = (DRMS_SegmentDimInfo_t *) _convert_handle(dims_hdl);
01919
01920 return drms_segment_setdims(seg, dims);
01921 }
01922 FCALLSCFUN2(INT, f_drms_segment_setdims, F_DRMS_SEGMENT_SETDIMS, f_drms_segment_setdims, STRING, STRING)
01923
01924 #if EXPANDAPI
01925
01926
01927 void f_drms_segment_getdims(int *dims, char * seg_hdl) {
01928 DRMS_Segment_t * seg = (DRMS_Segment_t *) _convert_handle(seg_hdl);
01929
01930 drms_segment_getdims(seg, dims);
01931
01932 return;
01933 }
01934 FCALLSCSUB2(f_drms_segment_getdims, F_DRMS_SEGMENT_GETDIMS, f_drms_segment_getdims, PINT, STRING)
01935 #endif
01936
01937 void f_drms_segment_filename(char * seg_hdl, char *filename, int size) {
01938 DRMS_Segment_t * seg = (DRMS_Segment_t *) _convert_handle(seg_hdl);
01939 char buf[DRMS_MAXPATHLEN] = {0};
01940
01941 drms_segment_filename(seg, buf);
01942
01943 if (*buf)
01944 {
01945 strncpy(filename, buf, size);
01946 }
01947
01948 return;
01949 }
01950
01951 FCALLSCSUB2(f_drms_segment_filename, F_DRMS_SEGMENT_FILENAME, f_drms_segment_filename, STRING, PSTRING)
01952
01953
01954 int f_drms_delete_segmentfile(char * seg_hdl) {
01955 DRMS_Segment_t * seg = (DRMS_Segment_t *) _convert_handle(seg_hdl);
01956
01957 return drms_delete_segmentfile(seg);
01958 }
01959 FCALLSCFUN1(INT, f_drms_delete_segmentfile, F_DRMS_DELETE_SEGMENTFILE, f_drms_delete_segmentfile, STRING)
01960
01961 #if EXPANDAPI
01962 int f_drms_segment_setscaling(char * seg_hdl, double bzero, double bscale) {
01963 DRMS_Segment_t * seg = (DRMS_Segment_t *) _convert_handle(seg_hdl);
01964
01965 return drms_segment_setscaling(seg, bzero, bscale);
01966 }
01967 FCALLSCFUN3(INT, f_drms_segment_setscaling, F_DRMS_SEGMENT_SETSCALING, f_drms_segment_setscaling, STRING, DOUBLE, DOUBLE)
01968
01969
01970 int f_drms_segment_getscaling(char * seg_hdl, double *bzero, double *bscale) {
01971 DRMS_Segment_t * seg = (DRMS_Segment_t *) _convert_handle(seg_hdl);
01972
01973 return drms_segment_getscaling(seg, bzero, bscale);
01974 }
01975 FCALLSCFUN3(INT, f_drms_segment_getscaling, F_DRMS_SEGMENT_GETSCALING, f_drms_segment_getscaling, STRING, PDOUBLE, PDOUBLE)
01976 #endif
01977
01978 char * f_drms_segment_lookup(char * rec_hdl, const char *segname) {
01979 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01980 DRMS_Segment_t * _ret_var;
01981
01982 _ret_var = drms_segment_lookup(rec, segname);
01983 return _pointer2handle((void *)_ret_var, "DRMS_Segment_t", "drms_segment_lookup");
01984 }
01985 FCALLSCFUN2(STRING, f_drms_segment_lookup, F_DRMS_SEGMENT_LOOKUP, f_drms_segment_lookup, STRING, STRING)
01986
01987
01988 char * f_drms_segment_lookupnum(char * rec_hdl, int segnum) {
01989 DRMS_Record_t * rec = (DRMS_Record_t *) _convert_handle(rec_hdl);
01990 DRMS_Segment_t * _ret_var;
01991
01992 _ret_var = drms_segment_lookupnum(rec, segnum);
01993 return _pointer2handle((void *)_ret_var, "DRMS_Segment_t", "drms_segment_lookupnum");
01994 }
01995 FCALLSCFUN2(STRING, f_drms_segment_lookupnum, F_DRMS_SEGMENT_LOOKUPNUM, f_drms_segment_lookupnum, STRING, INT)
01996
01997
01998 char * f_drms_segment_read(char * seg_hdl, DRMS_Type_t type, int *status) {
01999 DRMS_Segment_t * seg = (DRMS_Segment_t *) _convert_handle(seg_hdl);
02000 DRMS_Array_t * _ret_var;
02001
02002 _ret_var = drms_segment_read(seg, type, status);
02003 return _pointer2handle((void *)_ret_var, "DRMS_Array_t", "drms_segment_read");
02004 }
02005 FCALLSCFUN3(STRING, f_drms_segment_read, F_DRMS_SEGMENT_READ, f_drms_segment_read, STRING, INT, PINT)
02006
02007
02008 char * f_drms_segment_readslice(char * seg_hdl, DRMS_Type_t type, int *start, int *end, int *status) {
02009 DRMS_Segment_t * seg = (DRMS_Segment_t *) _convert_handle(seg_hdl);
02010 DRMS_Array_t * _ret_var;
02011
02012 _ret_var = drms_segment_readslice(seg, type, start, end, status);
02013 return _pointer2handle((void *)_ret_var, "DRMS_Array_t", "drms_segment_readslice");
02014 }
02015 FCALLSCFUN5(STRING, f_drms_segment_readslice, F_DRMS_SEGMENT_READSLICE, f_drms_segment_readslice, STRING, INT, PINT, PINT, PINT)
02016
02017
02018 int f_drms_segment_write(char * seg_hdl, char * arr_hdl, int autoscale) {
02019 DRMS_Segment_t * seg = (DRMS_Segment_t *) _convert_handle(seg_hdl);
02020 DRMS_Array_t * arr = (DRMS_Array_t *) _convert_handle(arr_hdl);
02021
02022 return drms_segment_write(seg, arr, autoscale);
02023 }
02024 FCALLSCFUN3(INT, f_drms_segment_write, F_DRMS_SEGMENT_WRITE, f_drms_segment_write, STRING, STRING, INT)
02025
02026
02027 void f_drms_segment_setblocksize(char * seg_hdl, int *blksz) {
02028 DRMS_Segment_t * seg = (DRMS_Segment_t *) _convert_handle(seg_hdl);
02029
02030 return drms_segment_setblocksize(seg, blksz);
02031 }
02032 FCALLSCSUB2(f_drms_segment_setblocksize, F_DRMS_SEGMENT_SETBLOCKSIZE, f_drms_segment_setblocksize, STRING, PINT)
02033
02034
02035 void f_drms_segment_getblocksize(char * seg_hdl, int *blksz) {
02036 DRMS_Segment_t * seg = (DRMS_Segment_t *) _convert_handle(seg_hdl);
02037
02038 return drms_segment_getblocksize(seg, blksz);
02039 }
02040 FCALLSCSUB2(f_drms_segment_getblocksize, F_DRMS_SEGMENT_GETBLOCKSIZE, f_drms_segment_getblocksize, STRING, PINT)
02041
02042
02043 #if EXPANDAPI
02044 void f_drms_segment_autoscale(char * seg_hdl, char * arr_hdl) {
02045 DRMS_Segment_t * seg = (DRMS_Segment_t *) _convert_handle(seg_hdl);
02046 DRMS_Array_t * arr = (DRMS_Array_t *) _convert_handle(arr_hdl);
02047
02048 return drms_segment_autoscale(seg, arr);
02049 }
02050 FCALLSCSUB2(f_drms_segment_autoscale, F_DRMS_SEGMENT_AUTOSCALE, f_drms_segment_autoscale, STRING, STRING)
02051 #endif
02052
02053
02054
02055
02056
02057
02058
02059
02060
02061
02062
02063
02064 int f_drms_series_exists(char * drmsEnv_hdl, const char *sname, int *status) {
02065 DRMS_Env_t * drmsEnv = (DRMS_Env_t *) _convert_handle(drmsEnv_hdl);
02066
02067 return drms_series_exists(drmsEnv, sname, status);
02068 }
02069 FCALLSCFUN3(INT, f_drms_series_exists, F_DRMS_SERIES_EXISTS, f_drms_series_exists, STRING, STRING, PINT)
02070
02071
02072 int f_drms_insert_series(char * session_hdl, int update, char * template_hdl, int perms) {
02073 DRMS_Session_t * session = (DRMS_Session_t *) _convert_handle(session_hdl);
02074 DRMS_Record_t * template = (DRMS_Record_t *) _convert_handle(template_hdl);
02075
02076 return drms_insert_series(session, update, template, perms);
02077 }
02078 FCALLSCFUN4(INT, f_drms_insert_series, F_DRMS_INSERT_SERIES, f_drms_insert_series, STRING, INT, STRING, INT)
02079
02080 #if 0
02081
02082 int f_drms_delete_series(char * env_hdl, char *series, int cascade) {
02083 DRMS_Env_t * env = (DRMS_Env_t *) _convert_handle(env_hdl);
02084
02085 return drms_delete_series(env, series, cascade);
02086 }
02087 FCALLSCFUN3(INT, f_drms_delete_series, F_DRMS_DELETE_SERIES, f_drms_delete_series, STRING, STRING, INT)
02088 #endif
02089
02090
02091 void f_drms_series_createpkeyarray(void * fpkw, char * env_hdl, const char *seriesName, int *nPKeys, int *status) {
02092 DRMS_Env_t * env = (DRMS_Env_t *) _convert_handle(env_hdl);
02093 char **ret = (char **) NULL;
02094
02095 ret = drms_series_createpkeyarray(env, seriesName, nPKeys, status);
02096
02097 if (!*status) {
02098 convert_C2F_string_array( (Fort_Alloc_t *) fpkw, ret, *nPKeys, DRMS_MAXKEYNAMELEN);
02099 }
02100 return;
02101 }
02102 FCALLSCSUB5(f_drms_series_createpkeyarray, F_DRMS_SERIES_CREATEPKEYARRAY, f_drms_series_createpkeyarray, PVOID, STRING, STRING, PINT, PINT)
02103
02104
02105 void f_drms_series_destroypkeyarray(void *fpkeys) {
02106 free_fort_alloc((Fort_Alloc_t *) fpkeys);
02107 }
02108 FCALLSCSUB1(f_drms_series_destroypkeyarray, F_DRMS_SERIES_DESTROYPKEYARRAY, f_drms_series_destroypkeyarray, PVOID)
02109
02110
02111 int f_drms_series_checkseriescompat(char * drmsEnv_hdl, const char *series1, const char *series2, char * matchSegs_hdl, int *status) {
02112 DRMS_Env_t * drmsEnv = (DRMS_Env_t *) _convert_handle(drmsEnv_hdl);
02113 HContainer_t * matchSegs = (HContainer_t *) _convert_handle(matchSegs_hdl);
02114
02115 return drms_series_checkseriescompat(drmsEnv, series1, series2, matchSegs, status);
02116 }
02117 FCALLSCFUN5(INT, f_drms_series_checkseriescompat, F_DRMS_SERIES_CHECKSERIESCOMPAT, f_drms_series_checkseriescompat, STRING, STRING, STRING, STRING, PINT)
02118
02119
02120 int f_drms_series_checkrecordcompat(char * drmsEnv_hdl, const char *series, char * recTempl_hdl, char * matchSegs_hdl, int *status) {
02121 DRMS_Env_t * drmsEnv = (DRMS_Env_t *) _convert_handle(drmsEnv_hdl);
02122 DRMS_Record_t * recTempl = (DRMS_Record_t *) _convert_handle(recTempl_hdl);
02123 HContainer_t * matchSegs = (HContainer_t *) _convert_handle(matchSegs_hdl);
02124
02125 return drms_series_checkrecordcompat(drmsEnv, series, recTempl, matchSegs, status);
02126 }
02127 FCALLSCFUN5(INT, f_drms_series_checkrecordcompat, F_DRMS_SERIES_CHECKRECORDCOMPAT, f_drms_series_checkrecordcompat, STRING, STRING, STRING, STRING, PINT)
02128
02129
02130
02131
02132
02133
02134
02135
02136
02137
02138
02139
02140
02141
02142
02143
02144 #if EXPANDAPI
02145 long long f_drms_su_alloc(char * env_hdl, uint64_t size, char *fsudir, int bufsize, int *status) {
02146 char *sudir=fsudir;
02147 DRMS_Env_t * env = (DRMS_Env_t *) _convert_handle(env_hdl);
02148
02149 return drms_su_alloc(env, size, &sudir, status);
02150 }
02151 FCALLSCFUN4(LONGLONG, f_drms_su_alloc, F_DRMS_SU_ALLOC, f_drms_su_alloc, STRING, DOUBLE, PSTRING, PINT)
02152
02153 int f_drms_su_newslots(char * env_hdl, int n, char *series, long long *recnum, DRMS_RecLifetime_t lifetime, int *slotnum, char * su_hdl, int size) {
02154 DRMS_Env_t * env = (DRMS_Env_t *) _convert_handle(env_hdl);
02155 DRMS_StorageUnit_t ** su = (DRMS_StorageUnit_t **) _convert_handle(su_hdl);
02156 return drms_su_newslots(env, n, series, recnum, lifetime, slotnum, su);
02157 }
02158 FCALLSCFUN7(INT, f_drms_su_newslots, F_DRMS_SU_NEWSLOTS, f_drms_su_newslots, STRING, INT, STRING, PLONGLONG, INT, PINT, PSTRING)
02159
02160
02161 int f_drms_su_getsudir(char * env_hdl, char * su_hdl, int retrieve) {
02162 DRMS_Env_t * env = (DRMS_Env_t *) _convert_handle(env_hdl);
02163 DRMS_StorageUnit_t * su = (DRMS_StorageUnit_t *) _convert_handle(su_hdl);
02164
02165 return drms_su_getsudir(env, su, retrieve);
02166 }
02167 FCALLSCFUN3(INT, f_drms_su_getsudir, F_DRMS_SU_GETSUDIR, f_drms_su_getsudir, STRING, STRING, INT)
02168
02169
02170 int f_drms_commitunit(char * env_hdl, char * su_hdl) {
02171 DRMS_Env_t * env = (DRMS_Env_t *) _convert_handle(env_hdl);
02172 DRMS_StorageUnit_t * su = (DRMS_StorageUnit_t *) _convert_handle(su_hdl);
02173
02174 return drms_commitunit(env, su);
02175 }
02176 FCALLSCFUN2(INT, f_drms_commitunit, F_DRMS_COMMITUNIT, f_drms_commitunit, STRING, STRING)
02177
02178
02179 int f_drms_commit_all_units(char * env_hdl, int *archive) {
02180 DRMS_Env_t * env = (DRMS_Env_t *) _convert_handle(env_hdl);
02181
02182 return drms_commit_all_units(env, archive);
02183 }
02184 FCALLSCFUN2(INT, f_drms_commit_all_units, F_DRMS_COMMIT_ALL_UNITS, f_drms_commit_all_units, STRING, PINT)
02185
02186
02187
02188
02189
02190
02191
02192
02193
02194
02195
02196
02197
02198 void f_drms_su_freeunit(char * su_hdl) {
02199 DRMS_StorageUnit_t * su = (DRMS_StorageUnit_t *) _convert_handle(su_hdl);
02200
02201 return drms_su_freeunit(su);
02202 }
02203 FCALLSCSUB1(f_drms_su_freeunit, F_DRMS_SU_FREEUNIT, f_drms_su_freeunit, STRING)
02204
02205
02206 void f_drms_freeunit(char * env_hdl, char * su_hdl) {
02207 DRMS_Env_t * env = (DRMS_Env_t *) _convert_handle(env_hdl);
02208 DRMS_StorageUnit_t * su = (DRMS_StorageUnit_t *) _convert_handle(su_hdl);
02209
02210 return drms_freeunit(env, su);
02211 }
02212 FCALLSCSUB2(f_drms_freeunit, F_DRMS_FREEUNIT, f_drms_freeunit, STRING, STRING)
02213
02214
02215 int f_drms_su_freeslot(char * env_hdl, char *series, long long sunum, int slotnum) {
02216 DRMS_Env_t * env = (DRMS_Env_t *) _convert_handle(env_hdl);
02217
02218 return drms_su_freeslot(env, series, sunum, slotnum);
02219 }
02220 FCALLSCFUN4(INT, f_drms_su_freeslot, F_DRMS_SU_FREESLOT, f_drms_su_freeslot, STRING, STRING, LONG, INT)
02221
02222
02223 char * f_drms_su_markslot(char * env_hdl, char *series, long long sunum, int slotnum, int *state) {
02224 DRMS_Env_t * env = (DRMS_Env_t *) _convert_handle(env_hdl);
02225 DRMS_StorageUnit_t * _ret_var;
02226
02227 _ret_var = drms_su_markslot(env, series, sunum, slotnum, state);
02228 return _pointer2handle((void *)_ret_var, "DRMS_StorageUnit_t", "drms_su_markslot");
02229 }
02230 FCALLSCFUN5(STRING, f_drms_su_markslot, F_DRMS_SU_MARKSLOT, f_drms_su_markslot, STRING, STRING, LONG, INT, PINT)
02231 #endif
02232
02233
02234
02235
02236
02237
02238
02239
02240
02241
02242
02243
02244
02245
02246
02247
02248
02249
02250
02251
02252
02253
02254
02255
02256
02257
02258
02259
02260
02261
02262
02263
02264
02265
02266
02267
02268
02269
02270
02271
02272
02273
02274
02275
02276
02277
02278
02279
02280
02281
02282
02283
02284
02285
02286
02287 FCALLSCFUN1(INT, drms_str2type, F_DRMS_STR2TYPE, f_drms_str2type, STRING)
02288
02289
02290 char * f_drms_type2str(DRMS_Type_t type) {
02291
02292 return (char *) drms_type2str(type);
02293 }
02294 FCALLSCFUN1(STRING, f_drms_type2str, F_DRMS_TYPE2STR, f_drms_type2str, INT)
02295
02296
02297 FCALLSCFUN1(INT, drms_sizeof, F_DRMS_SIZEOF, f_drms_sizeof, INT)
02298
02299
02300
02301
02302
02303
02304
02305
02306
02307
02308
02309
02310
02311
02312
02313
02314
02315
02316
02317
02318
02319
02320
02321
02322
02323
02324
02325
02326
02327
02328
02329
02330
02331
02332
02333
02334
02335
02336
02337
02338
02339
02340
02341
02342
02343
02344
02345
02346
02347
02348
02349
02350
02351
02352
02353
02354
02355
02356
02357
02358
02359
02360
02361
02362
02363
02364
02365
02366 FCALLSCFUN2(INT, drms_printfval_raw, F_DRMS_PRINTFVAL_RAW, f_drms_printfval_raw, INT, PVOID)
02367
02368
02369
02370
02371
02372
02373
02374
02375
02376
02377
02378
02379
02380
02381
02382
02383
02384
02385
02386
02387
02388
02389
02390
02391
02392
02393
02394
02395
02396
02397
02398
02399
02400
02401
02402
02403
02404
02405
02406
02407
02408
02409
02410
02411
02412
02413
02414
02415
02416
02417
02418
02419
02420
02421
02422
02423
02424
02425
02426
02427
02428
02429
02430
02431
02432
02433
02434
02435
02436
02437
02438
02439
02440
02441
02442
02443
02444
02445
02446
02447
02448
02449
02450
02451
02452
02453
02454
02455
02456
02457
02458
02459
02460
02461
02462
02463
02464
02465
02466
02467
02468
02469
02470
02471
02472
02473
02474
02475
02476
02477
02478
02479
02480
02481
02482
02483
02484
02485
02486
02487
02488
02489
02490
02491
02492
02493
02494
02495
02496
02497
02498
02499
02500
02501
02502
02503
02504
02505
02506
02507
02508
02509
02510
02511
02512
02513 FCALLSCSUB3(drms_byteswap, F_DRMS_BYTESWAP, f_drms_byteswap, INT, INT, STRING)
02514
02515
02516
02517
02518
02519
02520
02521
02522
02523
02524
02525
02526
02527
02528
02529
02530
02531
02532
02533
02534
02535 int f_drms_recordset_getnrecs(char * rs_hdl) {
02536 DRMS_RecordSet_t *rs = (DRMS_RecordSet_t *) _convert_handle(rs_hdl);
02537
02538 return drms_recordset_getnrecs(rs);
02539 }
02540 FCALLSCFUN1(INT, f_drms_recordset_getnrecs, F_DRMS_RECORDSET_GETNRECS, f_drms_recordset_getnrecs, STRING)
02541
02542 char *f_drms_recordset_getrec(char * rs_hdl, long long recnum) {
02543 DRMS_RecordSet_t *rs = (DRMS_RecordSet_t *) _convert_handle(rs_hdl);
02544 DRMS_Record_t *_ret_var = drms_recordset_getrec(rs, recnum);;
02545 return _pointer2handle((void *)_ret_var, "DRMS_Record_t", "drms_recordset_getrec");
02546 }
02547 FCALLSCFUN2(STRING, f_drms_recordset_getrec, F_DRMS_RECORDSET_GETREC, f_drms_recordset_getrec, STRING, INT)
02548
02549 int f_drms_segment_getnaxis(char * seg_hdl) {
02550 DRMS_Segment_t *seg = (DRMS_Segment_t *) _convert_handle(seg_hdl);
02551
02552 return drms_segment_getnaxis(seg);
02553 }
02554 FCALLSCFUN1(INT, f_drms_segment_getnaxis, F_DRMS_SEGMENT_GETNAXIS, f_drms_segment_getnaxis, STRING)