00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifdef FLIB
00015
00016 #include <stdio.h>
00017 #include <stdlib.h>
00018 #include <stdint.h>
00019 #include <string.h>
00020 #include <ctype.h>
00021 #include "cmdparams.h"
00022 #include "inthandles.h"
00023 #include "cfortran.h"
00024 #include "timeio.h"
00025
00026
00027
00028
00029
00030
00031 void f_cmdparams_get_str(pFHandleCmdParams handle,
00032 const char *name,
00033 char *ret,
00034 int size,
00035 int *status)
00036 {
00037 *status = CMDPARAMS_FAILURE;
00038
00039 CmdParams_t *pCP = (CmdParams_t *)GetJSOCStructure((void *)handle, kFHandleTypeCmdParams);
00040
00041 if (pCP != NULL)
00042 {
00043
00044
00045 char *argname = strdup(name);
00046
00047 if (argname)
00048 {
00049 char *str = cmdparams_get_str(pCP, argname, status);
00050 if (*status == CMDPARAMS_SUCCESS)
00051 {
00052 strncpy(ret, str, size);
00053 }
00054 free(argname);
00055 }
00056 else
00057 {
00058 *status = CMDPARAMS_OUTOFMEMORY;
00059 }
00060 }
00061 }
00062
00063 void f_cmdparams_isflagset(pFHandleCmdParams handle, const char *name, int *ret)
00064 {
00065 *ret = 0;
00066
00067 CmdParams_t *pCP = (CmdParams_t *)GetJSOCStructure((void *)handle, kFHandleTypeCmdParams);
00068
00069 if (pCP != NULL)
00070 {
00071
00072
00073 char *argname = strdup(name);
00074
00075 if (argname)
00076 {
00077 int ans = cmdparams_isflagset(pCP, argname);
00078 *ret = ans;
00079
00080 free(argname);
00081 }
00082 }
00083 }
00084
00085 void f_cmdparams_get_int(pFHandleCmdParams handle, const char *name, int *ret, int *status)
00086 {
00087 *status = CMDPARAMS_FAILURE;
00088
00089 CmdParams_t *pCP = (CmdParams_t *)GetJSOCStructure((void *)handle, kFHandleTypeCmdParams);
00090
00091 if (pCP != NULL)
00092 {
00093
00094
00095 char *argname = strdup(name);
00096
00097 if (argname)
00098 {
00099 int ans = cmdparams_get_int(pCP, argname, status);
00100 if (*status == CMDPARAMS_SUCCESS)
00101 {
00102 *ret = ans;
00103 }
00104
00105 free(argname);
00106 }
00107 else
00108 {
00109 *status = CMDPARAMS_OUTOFMEMORY;
00110 }
00111 }
00112 }
00113
00114 void f_cmdparams_get_int8(pFHandleCmdParams handle, const char *name, int8_t *ret, int *status)
00115 {
00116 *status = CMDPARAMS_FAILURE;
00117
00118 CmdParams_t *pCP = (CmdParams_t *)GetJSOCStructure((void *)handle, kFHandleTypeCmdParams);
00119
00120 if (pCP != NULL)
00121 {
00122
00123
00124 char *argname = strdup(name);
00125
00126 if (argname)
00127 {
00128 int8_t ans = cmdparams_get_int8(pCP, argname, status);
00129 if (*status == CMDPARAMS_SUCCESS)
00130 {
00131 *ret = ans;
00132 }
00133
00134 free(argname);
00135 }
00136 else
00137 {
00138 *status = CMDPARAMS_OUTOFMEMORY;
00139 }
00140 }
00141 }
00142
00143 void f_cmdparams_get_int16(pFHandleCmdParams handle, const char *name, int16_t *ret, int *status)
00144 {
00145 *status = CMDPARAMS_FAILURE;
00146
00147 CmdParams_t *pCP = (CmdParams_t *)GetJSOCStructure((void *)handle, kFHandleTypeCmdParams);
00148
00149 if (pCP != NULL)
00150 {
00151
00152
00153 char *argname = strdup(name);
00154
00155 if (argname)
00156 {
00157 int16_t ans = cmdparams_get_int16(pCP, argname, status);
00158 if (*status == CMDPARAMS_SUCCESS)
00159 {
00160 *ret = ans;
00161 }
00162
00163 free(argname);
00164 }
00165 else
00166 {
00167 *status = CMDPARAMS_OUTOFMEMORY;
00168 }
00169 }
00170 }
00171
00172 void f_cmdparams_get_int32(pFHandleCmdParams handle, const char *name, int32_t *ret, int *status)
00173 {
00174 *status = CMDPARAMS_FAILURE;
00175
00176 CmdParams_t *pCP = (CmdParams_t *)GetJSOCStructure((void *)handle, kFHandleTypeCmdParams);
00177
00178 if (pCP != NULL)
00179 {
00180
00181
00182 char *argname = strdup(name);
00183
00184 if (argname)
00185 {
00186 int32_t ans = cmdparams_get_int32(pCP, argname, status);
00187 if (*status == CMDPARAMS_SUCCESS)
00188 {
00189 *ret = ans;
00190 }
00191
00192 free(argname);
00193 }
00194 else
00195 {
00196 *status = CMDPARAMS_OUTOFMEMORY;
00197 }
00198 }
00199 }
00200
00201 void f_cmdparams_get_int64(pFHandleCmdParams handle, const char *name, long long *ret, int *status)
00202 {
00203 *status = CMDPARAMS_FAILURE;
00204
00205 CmdParams_t *pCP = (CmdParams_t *)GetJSOCStructure((void *)handle, kFHandleTypeCmdParams);
00206
00207 if (pCP != NULL)
00208 {
00209
00210
00211 char *argname = strdup(name);
00212
00213 if (argname)
00214 {
00215 int64_t ans = cmdparams_get_int64(pCP, argname, status);
00216 if (*status == CMDPARAMS_SUCCESS)
00217 {
00218 *ret = ans;
00219 }
00220
00221 free(argname);
00222 }
00223 else
00224 {
00225 *status = CMDPARAMS_OUTOFMEMORY;
00226 }
00227 }
00228 }
00229
00230 void f_cmdparams_get_float(pFHandleCmdParams handle, char *name, float *ret, int *status)
00231 {
00232 *status = CMDPARAMS_FAILURE;
00233
00234 CmdParams_t *pCP = (CmdParams_t *)GetJSOCStructure((void *)handle, kFHandleTypeCmdParams);
00235
00236 if (pCP != NULL)
00237 {
00238
00239
00240 char *argname = strdup(name);
00241
00242 if (argname)
00243 {
00244 float ans = cmdparams_get_float(pCP, argname, status);
00245 if (*status == CMDPARAMS_SUCCESS)
00246 {
00247 *ret = ans;
00248 }
00249
00250 free(argname);
00251 }
00252 else
00253 {
00254 *status = CMDPARAMS_OUTOFMEMORY;
00255 }
00256 }
00257 }
00258
00259 void f_cmdparams_get_double(pFHandleCmdParams handle, char *name, double *ret, int *status)
00260 {
00261 *status = CMDPARAMS_FAILURE;
00262
00263 CmdParams_t *pCP = (CmdParams_t *)GetJSOCStructure((void *)handle, kFHandleTypeCmdParams);
00264
00265 if (pCP != NULL)
00266 {
00267
00268
00269 char *argname = strdup(name);
00270
00271 if (argname)
00272 {
00273 double ans = cmdparams_get_double(pCP, argname, status);
00274 if (*status == CMDPARAMS_SUCCESS)
00275 {
00276 *ret = ans;
00277 }
00278
00279 free(argname);
00280 }
00281 else
00282 {
00283 *status = CMDPARAMS_OUTOFMEMORY;
00284 }
00285 }
00286 }
00287
00288 void f_cmdparams_get_time(pFHandleCmdParams handle, char *name, double *ret, int *status)
00289 {
00290 *status = CMDPARAMS_FAILURE;
00291
00292 CmdParams_t *pCP = (CmdParams_t *)GetJSOCStructure((void *)handle, kFHandleTypeCmdParams);
00293
00294 if (pCP != NULL)
00295 {
00296
00297
00298 char *argname = strdup(name);
00299
00300 if (argname)
00301 {
00302 TIME ans = cmdparams_get_time(pCP, argname, status);
00303 if (*status == CMDPARAMS_SUCCESS)
00304 {
00305 *ret = ans;
00306 }
00307
00308 free(argname);
00309 }
00310 else
00311 {
00312 *status = CMDPARAMS_OUTOFMEMORY;
00313 }
00314 }
00315 }
00316
00317 void f_params_get_str(pFHandleCmdParams handle, const char *name, char *ret, int size)
00318 {
00319 CmdParams_t *pCP = (CmdParams_t *)GetJSOCStructure((void *)handle, kFHandleTypeCmdParams);
00320
00321 if (pCP != NULL)
00322 {
00323
00324
00325 char *argname = strdup(name);
00326
00327 if (argname)
00328 {
00329 char *str = params_get_str(pCP, argname);
00330 if (str)
00331 {
00332 strncpy(ret, str, size);
00333 }
00334
00335 free(argname);
00336 }
00337 }
00338 }
00339
00340 void f_params_isflagset(pFHandleCmdParams handle, const char *name, int *ret)
00341 {
00342 *ret = 0;
00343
00344 CmdParams_t *pCP = (CmdParams_t *)GetJSOCStructure((void *)handle, kFHandleTypeCmdParams);
00345
00346 if (pCP != NULL)
00347 {
00348
00349
00350 char *argname = strdup(name);
00351
00352 if (argname)
00353 {
00354 int ans = params_isflagset(pCP, argname);
00355 *ret = ans;
00356
00357 free(argname);
00358 }
00359 }
00360 }
00361
00362 void f_params_get_int(pFHandleCmdParams handle, const char *name, int *ret)
00363 {
00364 CmdParams_t *pCP = (CmdParams_t *)GetJSOCStructure((void *)handle, kFHandleTypeCmdParams);
00365
00366 if (pCP != NULL)
00367 {
00368
00369
00370 char *argname = strdup(name);
00371
00372 if (argname)
00373 {
00374 int ans = params_get_int(pCP, argname);
00375 *ret = ans;
00376
00377 free(argname);
00378 }
00379 }
00380 }
00381
00382 void f_params_get_int8(pFHandleCmdParams handle, const char *name, int8_t *ret)
00383 {
00384 CmdParams_t *pCP = (CmdParams_t *)GetJSOCStructure((void *)handle, kFHandleTypeCmdParams);
00385
00386 if (pCP != NULL)
00387 {
00388
00389
00390 char *argname = strdup(name);
00391
00392 if (argname)
00393 {
00394 int8_t ans = params_get_int8(pCP, argname);
00395 *ret = ans;
00396
00397 free(argname);
00398 }
00399 }
00400 }
00401
00402 void f_params_get_int16(pFHandleCmdParams handle, const char *name, int16_t *ret)
00403 {
00404 CmdParams_t *pCP = (CmdParams_t *)GetJSOCStructure((void *)handle, kFHandleTypeCmdParams);
00405
00406 if (pCP != NULL)
00407 {
00408
00409
00410 char *argname = strdup(name);
00411
00412 if (argname)
00413 {
00414 int16_t ans = params_get_int16(pCP, argname);
00415 *ret = ans;
00416
00417 free(argname);
00418 }
00419 }
00420 }
00421
00422 void f_params_get_int32(pFHandleCmdParams handle, const char *name, int32_t *ret)
00423 {
00424 CmdParams_t *pCP = (CmdParams_t *)GetJSOCStructure((void *)handle, kFHandleTypeCmdParams);
00425
00426 if (pCP != NULL)
00427 {
00428
00429
00430 char *argname = strdup(name);
00431
00432 if (argname)
00433 {
00434 int32_t ans = params_get_int32(pCP, argname);
00435 *ret = ans;
00436
00437 free(argname);
00438 }
00439 }
00440 }
00441
00442 void f_params_get_int64(pFHandleCmdParams handle, const char *name, long long *ret)
00443 {
00444 CmdParams_t *pCP = (CmdParams_t *)GetJSOCStructure((void *)handle, kFHandleTypeCmdParams);
00445
00446 if (pCP != NULL)
00447 {
00448
00449
00450 char *argname = strdup(name);
00451
00452 if (argname)
00453 {
00454 int64_t ans = params_get_int64(pCP, argname);
00455 *ret = ans;
00456
00457 free(argname);
00458 }
00459 }
00460 }
00461
00462 void f_params_get_char(pFHandleCmdParams handle, char *name, signed char *ret)
00463 {
00464 CmdParams_t *pCP = (CmdParams_t *)GetJSOCStructure((void *)handle, kFHandleTypeCmdParams);
00465
00466 if (pCP != NULL)
00467 {
00468
00469
00470 char *argname = strdup(name);
00471
00472 if (argname)
00473 {
00474 char ans = params_get_char(pCP, argname);
00475 *ret = ans;
00476
00477 free(argname);
00478 }
00479 }
00480 }
00481
00482 void f_params_get_short(pFHandleCmdParams handle, char *name, short *ret)
00483 {
00484 CmdParams_t *pCP = (CmdParams_t *)GetJSOCStructure((void *)handle, kFHandleTypeCmdParams);
00485
00486 if (pCP != NULL)
00487 {
00488
00489
00490 char *argname = strdup(name);
00491
00492 if (argname)
00493 {
00494 short ans = params_get_short(pCP, argname);
00495 *ret = ans;
00496
00497 free(argname);
00498 }
00499 }
00500 }
00501
00502 void f_params_get_float(pFHandleCmdParams handle, char *name, float *ret)
00503 {
00504 CmdParams_t *pCP = (CmdParams_t *)GetJSOCStructure((void *)handle, kFHandleTypeCmdParams);
00505
00506 if (pCP != NULL)
00507 {
00508
00509
00510 char *argname = strdup(name);
00511
00512 if (argname)
00513 {
00514 float ans = params_get_float(pCP, argname);
00515 *ret = ans;
00516
00517 free(argname);
00518 }
00519 }
00520 }
00521
00522 void f_params_get_double(pFHandleCmdParams handle, char *name, double *ret)
00523 {
00524 CmdParams_t *pCP = (CmdParams_t *)GetJSOCStructure((void *)handle, kFHandleTypeCmdParams);
00525
00526 if (pCP != NULL)
00527 {
00528
00529
00530 char *argname = strdup(name);
00531
00532 if (argname)
00533 {
00534 double ans = params_get_double(pCP, argname);
00535 *ret = ans;
00536
00537 free(argname);
00538 }
00539 }
00540 }
00541
00542 void f_params_get_time(pFHandleCmdParams handle, char *name, double *ret)
00543 {
00544 CmdParams_t *pCP = (CmdParams_t *)GetJSOCStructure((void *)handle, kFHandleTypeCmdParams);
00545
00546 if (pCP != NULL)
00547 {
00548
00549
00550 char *argname = strdup(name);
00551
00552 if (argname)
00553 {
00554 TIME ans = params_get_time(pCP, argname);
00555 *ret = ans;
00556
00557 free(argname);
00558 }
00559 }
00560 }
00561
00562
00563
00564
00565
00566 #ifdef ICCCOMP
00567 #pragma warning (disable : 981)
00568 #pragma warning (disable : 1418)
00569 #endif
00570
00571
00572
00573 FCALLSCSUB4(f_cmdparams_get_str, cpgetstr, cpgetstr, PINT, STRING, PSTRING, PINT)
00574 FCALLSCSUB3(f_cmdparams_isflagset, cpflagset, cpflagset, PINT, STRING, PINT)
00575 FCALLSCSUB4(f_cmdparams_get_int, cpgetint, cpgetint, PINT, STRING, PINT, PINT)
00576 FCALLSCSUB4(f_cmdparams_get_int8, cpgetint8, cpgetint8, PINT, STRING, PBYTE, PINT)
00577 FCALLSCSUB4(f_cmdparams_get_int16, cpgetint16, cpgetint16, PINT, STRING, PSHORT, PINT)
00578 FCALLSCSUB4(f_cmdparams_get_int32, cpgetint32, cpgetint32, PINT, STRING, PINT, PINT)
00579 FCALLSCSUB4(f_cmdparams_get_int64, cpgetint64, cpgetint64, PINT, STRING, PLONGLONG, PINT)
00580 FCALLSCSUB4(f_cmdparams_get_float, cpgetfloat, cpgetfloat, PINT, STRING, PFLOAT, PINT)
00581 FCALLSCSUB4(f_cmdparams_get_double, cpgetdouble, cpgetdouble, PINT, STRING, PDOUBLE, PINT)
00582 FCALLSCSUB4(f_cmdparams_get_time, cpgettime, cpgettime, PINT, STRING, PDOUBLE, PINT)
00583
00584 FCALLSCSUB3(f_params_get_str, paramsgetstr, paramsgetstr, PINT, STRING, PSTRING)
00585 FCALLSCSUB3(f_params_isflagset, paramsflagset, paramsflagset, PINT, STRING, PINT)
00586 FCALLSCSUB3(f_params_get_int, paramsgetint, paramsgetint, PINT, STRING, PINT)
00587 FCALLSCSUB3(f_params_get_int8, paramsgetint8, paramsgetint8, PINT, STRING, PBYTE)
00588 FCALLSCSUB3(f_params_get_int16, paramsgetint16, paramsgetint16, PINT, STRING, PSHORT)
00589 FCALLSCSUB3(f_params_get_int32, paramsgetint32, paramsgetint32, PINT, STRING, PINT)
00590 FCALLSCSUB3(f_params_get_int64, paramsgetint64, paramsgetint64, PINT, STRING, PLONGLONG)
00591 FCALLSCSUB3(f_params_get_char, paramsgetchar, paramsgetchar, PINT, STRING, PBYTE)
00592 FCALLSCSUB3(f_params_get_short, paramsgetshort, paramsgetshort, PINT, STRING, PSHORT)
00593 FCALLSCSUB3(f_params_get_float, paramsgetfloat, paramsgetfloat, PINT, STRING, PFLOAT)
00594 FCALLSCSUB3(f_params_get_double, paramsgetdouble, paramsgetdouble, PINT, STRING, PDOUBLE)
00595 FCALLSCSUB3(f_params_get_time, paramsgettime, paramsgettime, PINT, STRING, PDOUBLE)
00596
00597 #ifdef ICCCOMP
00598 #pragma warning (default : 981)
00599 #pragma warning (default : 1418)
00600 #endif
00601
00602 #endif