00001 #define _GNU_SOURCE
00002
00003 #include <soi_error.h>
00004 #include <soi_key.h>
00005 #include <string.h>
00006 #include "SUM.h"
00007 #include "keyU.h"
00008
00009
00010
00011 KEYU *newkeylistU () {
00012 return NULL;
00013 }
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 void freekeylistU (KEYU **list) {
00028 KEYU *node, *tmp;
00029 if (*list) {
00030 HASH_ITER(hh, *list, node, tmp) {
00031 HASH_DEL(*list, node);
00032 if(node->name) free(node->name);
00033 if(node->val) free(node->val);
00034 free(node);
00035 }
00036 *list = NULL;
00037 }
00038 }
00039
00040 KEYU *findkeyU (KEYU *list, char *key) {
00041 KEYU *thekey = NULL;
00042 HASH_FIND_STR(list, key, thekey);
00043 if (thekey)
00044 soi_errno = NO_ERROR;
00045 else
00046 soi_errno = KEY_NOT_FOUND;
00047 return thekey;
00048 }
00049
00050 void getkey_anyU (KEYU *list, char *key, void *valptr) {
00051 KEYU *the_one = findkeyU (list, key);
00052 if (the_one)
00053 if (the_one->type == KEYTYP_STRING_U)
00054 *(char **)valptr = strndup(the_one->val, strlen(the_one->val));
00055 else if (the_one->type == KEYTYP_FILEP_U)
00057 *(FILE **)valptr = *(FILE **)the_one->val;
00058 else if (the_one->type == KEYTYP_DOUBLE_U)
00059 *(double *)valptr = *(double *)the_one->val;
00060 else if (the_one->type == KEYTYP_FLOAT_U)
00061 *(float *)valptr = *(float *)the_one->val;
00062 else if (the_one->type == KEYTYP_INT_U)
00063 *(int *)valptr = *(int *)the_one->val;
00064 else if (the_one->type == KEYTYP_SHORT_U)
00065 *(short *)valptr = *(short *)the_one->val;
00066 else if (the_one->type == KEYTYP_BYTE_U)
00067 *(signed char *)valptr = *(signed char *)the_one->val;
00068 else if (the_one->type == KEYTYP_LONG_U)
00069 *(long *)valptr = *(long *)the_one->val;
00070 else if (the_one->type == KEYTYP_UINT_U)
00071 *(unsigned int *)valptr = *(unsigned int *)the_one->val;
00072 else if (the_one->type == KEYTYP_USHORT_U)
00073 *(unsigned short *)valptr = *(unsigned short *)the_one->val;
00074 else if (the_one->type == KEYTYP_UBYTE_U)
00075 *(unsigned char *)valptr = *(unsigned char *)the_one->val;
00076 else if (the_one->type == KEYTYP_ULONG_U)
00077 *(unsigned long *)valptr = *(unsigned long *)the_one->val;
00078 else if (the_one->type == KEYTYP_UINT64_U)
00079 *(uint64_t *)valptr = *(uint64_t *)the_one->val;
00080 else if (the_one->type == KEYTYP_UINT32_U)
00081 *(uint32_t *)valptr = *(uint32_t *)the_one->val;
00082 else
00083 soi_errno = KEY_WRONG_TYPE;
00084 else
00085 soi_errno = KEY_NOT_FOUND;
00086 }
00087
00088 void setkey_anyU (KEYU **list, char *key, void *val, int type) {
00089
00090 KEYU *the_one;
00091 KEYU *new_one;
00092
00093 if (!key) return;
00094 if (!val) return;
00095
00096 the_one = findkeyU (*list, key);
00097 soi_errno = NO_ERROR;
00098 if (the_one) {
00099 free (the_one->val);
00100 }
00101 else {
00102 new_one = (KEYU *)malloc (sizeof (KEYU));
00103 new_one->name = strndup (key,strlen(key));
00104 HASH_ADD_KEYPTR(hh, *list, new_one->name, strlen(new_one->name), new_one);
00105 the_one = new_one;
00106 }
00107 the_one->type = type;
00108 switch (type) {
00109 case KEYTYP_STRING_U:
00110 the_one->val = strndup (val,strlen(val));
00111 break;
00112 case KEYTYP_BYTE_U:
00113 the_one->val = (signed char *)malloc (1);
00114 *(signed char *)the_one->val = *(signed char *)val;
00115 break;
00116 case KEYTYP_UBYTE_U:
00117 the_one->val = (char *)malloc (1);
00118 *(unsigned char *)the_one->val = *(unsigned char *)val;
00119 break;
00120 case KEYTYP_SHORT_U:
00121 the_one->val = (short *)malloc (sizeof (short));
00122 *(short *)the_one->val = *(short *)val;
00123 break;
00124 case KEYTYP_USHORT_U:
00125 the_one->val =
00126 (unsigned short *)malloc (sizeof (unsigned short));
00127 *(unsigned short *)the_one->val = *(unsigned short *)val;
00128 break;
00129 case KEYTYP_INT_U:
00130 the_one->val = (int *)malloc (sizeof (int));
00131 *(int *)the_one->val = *(int *)val;
00132 break;
00133 case KEYTYP_UINT_U:
00134 the_one->val = (unsigned int *)malloc (sizeof (unsigned int));
00135 *(unsigned int *)the_one->val = *(unsigned int *)val;
00136 break;
00137 case KEYTYP_LONG_U:
00138 the_one->val = (long *)malloc (sizeof (long));
00139 *(long *)the_one->val = *(long *)val;
00140 break;
00141 case KEYTYP_ULONG_U:
00142 the_one->val =
00143 (unsigned long *)malloc (sizeof (unsigned long));
00144 *(unsigned long *)the_one->val = *(unsigned long *)val;
00145 break;
00146 case KEYTYP_UINT64_U:
00147 the_one->val = (uint64_t *)malloc (sizeof (uint64_t));
00148 *(uint64_t *)the_one->val = *(uint64_t *)val;
00149 break;
00150 case KEYTYP_UINT32_U:
00151 the_one->val = (uint32_t *)malloc (sizeof (uint32_t));
00152 *(uint32_t *)the_one->val = *(uint32_t *)val;
00153 break;
00154 case KEYTYP_FLOAT_U:
00155 the_one->val = (float *)malloc (sizeof (float));
00156 *(float *)the_one->val = *(float *)val;
00157 break;
00158 case KEYTYP_DOUBLE_U:
00159 the_one->val = (double *)malloc (sizeof (double));
00160 *(double *)the_one->val = *(double *)val;
00161 break;
00162 case KEYTYP_FILEP_U:
00164 the_one->val = (FILE **)malloc (sizeof (FILE *));
00165 *(FILE **)the_one->val = (FILE *)val;
00166 break;
00167 case KEYTYP_TIME_U:
00168 the_one->val = (TIME *)malloc (sizeof (TIME));
00169 *(TIME *)the_one->val = *(TIME *)val;
00170 break;
00171 default:
00172
00173 soi_errno = KEYTYPE_NOT_IMPLEMENTED;
00174 break;
00175 }
00176 }
00177
00178 void deletekeyU (KEYU **list, char *key) {
00179 KEYU *thekey;
00180
00181 if (!key) return;
00182 HASH_FIND_STR(*list, key, thekey);
00183 if (thekey) {
00184 HASH_DEL(*list, thekey);
00185 free(thekey);
00186 }
00187 }
00188
00189
00190 void keyiterateU (void (*action)(), KEYU *overlist) {
00191 KEYU * walker = overlist;
00192 while (walker) {
00193 (*action)(walker);
00194 walker = walker->hh.next;
00195 }
00196 }
00197
00198 int getkeytypeU (KEYU *list, char *key) {
00199 KEYU *the_one = findkeyU (list, key);
00200 if (the_one)
00201 return (the_one->type);
00202 return KEYTYP_VOID_U;
00203 }
00204
00205 char *GETKEY_strU(KEYU *params, char *key) {
00206 static char tmp[KEY_MAXSTR];
00207 char *c = getkey_strU(params,key);
00208 if (c) {
00209 strcpy(tmp, c);
00210 free(c);
00211 } else
00212 tmp[0] = '\0';
00213 return(tmp);
00214 }
00215
00216 char *getkey_strU (KEYU *list, char *key) {
00217 KEYU *the_one = findkeyU (list, key);
00218 if (the_one) {
00219 if (the_one->type == KEYTYP_STRING_U)
00220 return strndup (the_one->val,strlen(the_one->val));
00221 else
00222 soi_errno = KEY_WRONG_TYPE;
00223 }
00224 return NULL;
00225 }
00226
00227 FILE *getkey_fileptrU (KEYU *list, char *key) {
00228 KEYU *the_one = findkeyU (list, key);
00229 if (the_one) {
00230 if (the_one->type == KEYTYP_FILEP_U)
00231 return *(FILE **)(the_one->val);
00232 else
00233 soi_errno = KEY_WRONG_TYPE;
00234 }
00235 return NULL;
00236 }
00237
00238 int getkey_byteU (KEYU *list, char *key) {
00239 int return_val;
00240 KEYU *the_one = findkeyU (list, key);
00241 if (the_one) {
00242 switch (the_one->type) {
00243 case KEYTYP_BYTE_U:
00244 return_val = *(signed char *)the_one->val;
00245 return (return_val);
00246 case KEYTYP_UBYTE_U:
00247 return_val = *(unsigned char *)the_one->val;
00248 return (return_val);
00249 case KEYTYP_SHORT_U:
00250 return_val = *(short *)the_one->val;
00251 return (return_val);
00252 case KEYTYP_USHORT_U:
00253 return_val = *(unsigned short *)the_one->val;
00254 return (return_val);
00255 case KEYTYP_INT_U:
00256 return_val = *(int *)the_one->val;
00257 return (return_val);
00258 default:
00259 soi_errno = KEY_WRONG_TYPE;
00260 }
00261 }
00262 return INT_MIN;
00263 }
00264
00265 int getkey_ubyteU (KEYU *list, char *key) {
00266 int return_val;
00267 KEYU *the_one = findkeyU (list, key);
00268 if (the_one)
00269 switch (the_one->type) {
00270 case KEYTYP_UBYTE_U:
00271 return_val = *(unsigned char *)the_one->val;
00272 return (return_val);
00273 case KEYTYP_BYTE_U:
00274 return_val = *(signed char *)the_one->val;
00275 if (return_val >= 0)
00276 return (return_val);
00277 else
00278 soi_errno = KEY_WRONG_TYPE;
00279 break;
00280 case KEYTYP_SHORT_U:
00281 return_val = *(short *)the_one->val;
00282 if (return_val >= 0)
00283 return (return_val);
00284 else
00285 soi_errno = KEY_WRONG_TYPE;
00286 break;
00287 case KEYTYP_USHORT_U:
00288 return_val = *(unsigned short *)the_one->val;
00289 return (return_val);
00290 case KEYTYP_INT_U:
00291 return_val = *(int *)the_one->val;
00292 if (return_val >= 0)
00293 return (return_val);
00294 else
00295 soi_errno = KEY_WRONG_TYPE;
00296 break;
00297 default:
00298 soi_errno = KEY_WRONG_TYPE;
00299 }
00300 return INT_MIN;
00301 }
00302
00303 int getkey_shortU (KEYU *list, char *key) {
00304 int return_val;
00305 KEYU *the_one = findkeyU (list, key);
00306 if (the_one)
00307 switch (the_one->type) {
00308 case KEYTYP_SHORT_U:
00309 return_val = *(short *)the_one->val;
00310 return (return_val);
00311 case KEYTYP_BYTE_U:
00312 return_val = *(signed char *)the_one->val;
00313 return (return_val);
00314 case KEYTYP_UBYTE_U:
00315 return_val = *(unsigned char *)the_one->val;
00316 return (return_val);
00317 case KEYTYP_USHORT_U:
00318 return_val = *(unsigned short *)the_one->val;
00319 return (return_val);
00320 case KEYTYP_INT_U:
00321 return_val = *(int *)the_one->val;
00322 return (return_val);
00323 default:
00324 soi_errno = KEY_WRONG_TYPE;
00325 }
00326 return INT_MIN;
00327 }
00328
00329 int getkey_ushortU (KEYU *list, char *key) {
00330 int return_val;
00331 KEYU *the_one = findkeyU (list, key);
00332 soi_errno = NO_ERROR;
00333 if (the_one)
00334 switch (the_one->type) {
00335 case KEYTYP_USHORT_U:
00336 return_val = *(unsigned short *)the_one->val;
00337 return (return_val);
00338 case KEYTYP_BYTE_U:
00339 return_val = *(signed char *)the_one->val;
00340 if (return_val >= 0)
00341 return (return_val);
00342 else
00343 soi_errno = KEY_WRONG_TYPE;
00344 break;
00345 case KEYTYP_UBYTE_U:
00346 return_val = *(unsigned char *)the_one->val;
00347 return (return_val);
00348 case KEYTYP_SHORT_U:
00349 return_val = *(short *)the_one->val;
00350 if (return_val >= 0)
00351 return (return_val);
00352 else
00353 soi_errno = KEY_WRONG_TYPE;
00354 break;
00355 case KEYTYP_INT_U:
00356 return_val = *(int *)the_one->val;
00357 if (return_val >= 0)
00358 return (return_val);
00359 else
00360 soi_errno = KEY_WRONG_TYPE;
00361 break;
00362 default:
00363 soi_errno = KEY_WRONG_TYPE;
00364 }
00365 return INT_MIN;
00366 }
00367
00368 int getkey_intU (KEYU *list, char *key) {
00369 int return_val;
00370 KEYU *the_one = findkeyU (list, key);
00371 if (the_one)
00372 switch (the_one->type) {
00373 case KEYTYP_INT_U:
00374 return_val = *(int *)the_one->val;
00375 return (return_val);
00376 case KEYTYP_BYTE_U:
00377 return_val = *(signed char *)the_one->val;
00378 return (return_val);
00379 case KEYTYP_UBYTE_U:
00380 return_val = *(unsigned char *)the_one->val;
00381 return (return_val);
00382 case KEYTYP_SHORT_U:
00383 return_val = *(short *)the_one->val;
00384 return (return_val);
00385 case KEYTYP_USHORT_U:
00386 return_val = *(unsigned short *)the_one->val;
00387 return (return_val);
00388 default:
00389 soi_errno = KEY_WRONG_TYPE;
00390 }
00391 return INT_MIN;
00392 }
00393
00394 unsigned int getkey_uintU (KEYU *list, char *key) {
00395 unsigned int return_val;
00396 int int_val;
00397 KEYU *the_one = findkeyU (list, key);
00398 if (the_one)
00399 switch (the_one->type) {
00400 case KEYTYP_UINT_U:
00401 return_val = *(unsigned int *)the_one->val;
00402 return (return_val);
00403 case KEYTYP_BYTE_U:
00404 int_val = *(signed char *)the_one->val;
00405 if (int_val >= 0)
00406 return (return_val=int_val);
00407 else
00408 soi_errno = KEY_WRONG_TYPE;
00409 break;
00410 case KEYTYP_UBYTE_U:
00411 return_val = *(unsigned char *)the_one->val;
00412 return (return_val);
00413 case KEYTYP_SHORT_U:
00414 int_val = *(short *)the_one->val;
00415 if (int_val >= 0)
00416 return (return_val=int_val);
00417 else
00418 soi_errno = KEY_WRONG_TYPE;
00419 break;
00420 case KEYTYP_USHORT_U:
00421 return_val = *(unsigned short *)the_one->val;
00422 return (return_val);
00423 case KEYTYP_INT_U:
00424 int_val = *(int *)the_one->val;
00425 if (int_val >= 0)
00426 return (return_val=int_val);
00427 else
00428 soi_errno = KEY_WRONG_TYPE;
00429 break;
00430 default:
00431 soi_errno = KEY_WRONG_TYPE;
00432 }
00433 return UINT_MAX;
00434 }
00435
00436 int getkey_flagU (KEYU *list, char *key) {
00437 int return_val;
00438 KEYU *the_one = findkeyU (list, key);
00439 if (the_one)
00440 switch (the_one->type) {
00441 case KEYTYP_BYTE_U:
00442 return_val = *(signed char *)the_one->val;
00443 return (return_val);
00444 case KEYTYP_UBYTE_U:
00445 return_val = *(unsigned char *)the_one->val;
00446 return (return_val);
00447 case KEYTYP_SHORT_U:
00448 return_val = *(short *)the_one->val;
00449 return (return_val);
00450 case KEYTYP_USHORT_U:
00451 return_val = *(unsigned short *)the_one->val;
00452 return (return_val);
00453 case KEYTYP_INT_U:
00454 return_val = *(int *)the_one->val;
00455 return (return_val);
00456 default:
00457 soi_errno = KEY_WRONG_TYPE;
00458 }
00459 return INT_MIN;
00460 }
00461
00462 long getkey_longU (KEYU *list, char *key) {
00463 long return_val;
00464 KEYU *the_one = findkeyU (list, key);
00465 if (the_one)
00466 switch (the_one->type) {
00467 case KEYTYP_LONG_U:
00468 return_val = *(long *)the_one->val;
00469 return (return_val);
00470 case KEYTYP_BYTE_U:
00471 return_val = *(signed char *)the_one->val;
00472 return (return_val);
00473 case KEYTYP_UBYTE_U:
00474 return_val = *(unsigned char *)the_one->val;
00475 return (return_val);
00476 case KEYTYP_SHORT_U:
00477 return_val = *(short *)the_one->val;
00478 return (return_val);
00479 case KEYTYP_USHORT_U:
00480 return_val = *(unsigned short *)the_one->val;
00481 return (return_val);
00482 case KEYTYP_INT_U:
00483 return_val = *(int *)the_one->val;
00484 return (return_val);
00485 case KEYTYP_UINT_U:
00486 return_val = *(unsigned int *)the_one->val;
00487 return (return_val);
00488 default:
00489 soi_errno = KEY_WRONG_TYPE;
00490 }
00491 return LONG_MIN;
00492 }
00493
00494 unsigned long getkey_ulongU (KEYU *list, char *key) {
00495 unsigned long return_val;
00496 unsigned long long_val;
00497 KEYU *the_one = findkeyU (list, key);
00498 if (the_one)
00499 switch (the_one->type) {
00500 case KEYTYP_ULONG_U:
00501 return_val = *(unsigned long *)the_one->val;
00502 return (return_val);
00503 case KEYTYP_BYTE_U:
00504 long_val = *(signed char *)the_one->val;
00505 if (long_val >= 0)
00506 return (return_val=long_val);
00507 else
00508 soi_errno = KEY_WRONG_TYPE;
00509 break;
00510 case KEYTYP_UBYTE_U:
00511 return_val = *(unsigned char *)the_one->val;
00512 return (return_val);
00513 case KEYTYP_SHORT_U:
00514 long_val = *(short *)the_one->val;
00515 if (long_val >= 0)
00516 return (return_val=long_val);
00517 else
00518 soi_errno = KEY_WRONG_TYPE;
00519 break;
00520 case KEYTYP_USHORT_U:
00521 return_val = *(unsigned short *)the_one->val;
00522 return (return_val);
00523 case KEYTYP_INT_U:
00524 long_val = *(int *)the_one->val;
00525 if (long_val >= 0)
00526 return (return_val=long_val);
00527 else
00528 soi_errno = KEY_WRONG_TYPE;
00529 break;
00530 case KEYTYP_UINT_U:
00531 return_val = *(unsigned int *)the_one->val;
00532 return (return_val);
00533 case KEYTYP_LONG_U:
00534 long_val = *(long *)the_one->val;
00535 if (long_val >= 0)
00536 return (return_val=long_val);
00537 else
00538 soi_errno = KEY_WRONG_TYPE;
00539 break;
00540 default:
00541 soi_errno = KEY_WRONG_TYPE;
00542 }
00543 return ULONG_MAX;
00544 }
00545
00546 uint64_t getkey_uint64U (KEYU *list, char *key) {
00547 uint64_t return_val;
00548 KEYU *the_one = findkeyU (list, key);
00549 if (the_one)
00550 switch (the_one->type) {
00551 case KEYTYP_UINT64_U:
00552 return_val = *(uint64_t *)the_one->val;
00553 return (return_val);
00554 default:
00555 soi_errno = KEY_WRONG_TYPE;
00556 }
00557 return (uint64_t)ULONG_MAX;
00558 }
00559
00560 uint32_t getkey_uint32U (KEYU *list, char *key) {
00561 uint32_t return_val;
00562 KEYU *the_one = findkeyU (list, key);
00563 if (the_one)
00564 switch (the_one->type) {
00565 case KEYTYP_UINT32_U:
00566 return_val = *(uint32_t *)the_one->val;
00567 return (return_val);
00568 default:
00569 soi_errno = KEY_WRONG_TYPE;
00570 }
00571 return (uint32_t)ULONG_MAX;
00572 }
00573
00574 double getkey_floatU (KEYU *list, char *key) {
00575 double return_val;
00576 KEYU *the_one = findkeyU (list, key);
00577 if (the_one) {
00578 switch (the_one->type) {
00579 case KEYTYP_FLOAT_U:
00580 return_val = *(float *)the_one->val;
00581 return (return_val);
00582 case KEYTYP_DOUBLE_U:
00583 return_val = *(double *)the_one->val;
00584 return (return_val);
00585 default:
00586 soi_errno = KEY_WRONG_TYPE;
00587 }
00588 }
00589 return D_NAN;
00590 }
00591
00592 double getkey_doubleU (KEYU *list, char *key) {
00593 double return_val;
00594 KEYU *the_one = findkeyU (list, key);
00595 if (the_one)
00596 switch (the_one->type)
00597 {
00598 case KEYTYP_DOUBLE_U:
00599 return_val = *(double *)the_one->val;
00600 return (return_val);
00601 case KEYTYP_FLOAT_U:
00602 return_val = *(float *)the_one->val;
00603 return (return_val);
00604 default:
00605 soi_errno = KEY_WRONG_TYPE;
00606 }
00607 return D_NAN;
00608 }
00609
00610 TIME getkey_timeU (KEYU *list, char *key) {
00611 double return_val;
00612 KEYU *the_one = findkeyU (list, key);
00613 if (the_one) {
00614 if (the_one->type == KEYTYP_TIME_U) {
00615 return_val = *(TIME *)the_one->val;
00616 return (return_val);
00617 }
00618 else
00619 soi_errno = KEY_WRONG_TYPE;
00620 }
00621 return D_NAN;
00622 }
00623
00624 void setkey_strU (KEYU **list, char *key, char *val) {
00625 setkey_anyU (list, key, val, KEYTYP_STRING_U);
00626 }
00627
00628 void setkey_fileptrU (KEYU **list, char *key, FILE *val) {
00629 setkey_anyU (list, key, val, KEYTYP_FILEP_U);
00630 }
00631
00632 void setkey_byteU (KEYU **list, char *key, char val) {
00633 setkey_anyU (list, key, &val, KEYTYP_BYTE_U);
00634 }
00635
00636 void setkey_ubyteU (KEYU **list, char *key, unsigned char val) {
00637 setkey_anyU (list, key, &val, KEYTYP_UBYTE_U);
00638 }
00639
00640 void setkey_shortU (KEYU **list, char *key, short val) {
00641 setkey_anyU (list, key, &val, KEYTYP_SHORT_U);
00642 }
00643
00644 void setkey_ushortU (KEYU **list, char *key, unsigned short val) {
00645 setkey_anyU (list, key, &val, KEYTYP_USHORT_U);
00646 }
00647
00648 void setkey_intU (KEYU **list, char *key, int val) {
00649 setkey_anyU (list, key, &val, KEYTYP_INT_U);
00650 }
00651
00652 void setkey_uintU (KEYU **list, char *key, unsigned int val) {
00653 setkey_anyU (list, key, &val, KEYTYP_UINT_U);
00654 }
00655
00656 void setkey_longU (KEYU **list, char *key, long val) {
00657 setkey_anyU (list, key, &val, KEYTYP_LONG_U);
00658 }
00659
00660 void setkey_ulongU (KEYU **list, char *key, unsigned long val) {
00661 setkey_anyU (list, key, &val, KEYTYP_ULONG_U);
00662 }
00663
00664 void setkey_uint64U (KEYU **list, char *key, uint64_t val) {
00665 setkey_anyU (list, key, &val, KEYTYP_UINT64_U);
00666 }
00667
00668 void setkey_uint32U (KEYU **list, char *key, uint32_t val) {
00669 setkey_anyU (list, key, &val, KEYTYP_UINT32_U);
00670 }
00671
00672 void setkey_floatU (KEYU **list, char *key, float val) {
00673 setkey_anyU (list, key, &val, KEYTYP_FLOAT_U);
00674 }
00675
00676 void setkey_doubleU (KEYU **list, char *key, double val) {
00677 setkey_anyU (list, key, &val, KEYTYP_DOUBLE_U);
00678 }
00679
00680 void setkey_timeU (KEYU **list, char *key, TIME val) {
00681 setkey_anyU (list, key, &val, KEYTYP_TIME_U);
00682 }
00683
00684 void add_keysU (KEYU *inlist, KEYU **tolist) {
00685 KEYU *walker = inlist;
00686
00687 while (walker) {
00688 setkey_anyU (tolist, walker->name, walker->val, walker->type);
00689 walker = walker->hh.next;
00690 }
00691 }
00692
00693 void add_key2keyU (KEY *inlist, KEYU **tolist) {
00694 KEY *walker = inlist;
00695
00696 while (walker) {
00697 setkey_anyU (tolist, walker->name, walker->val, walker->type);
00698 walker = walker->next;
00699 }
00700 }
00701
00702 void add_keyU2key (KEYU *inlist, KEY **tolist) {
00703 KEYU *walker = inlist;
00704
00705 while (walker) {
00706 setkey_any (tolist, walker->name, walker->val, walker->type);
00707 walker = walker->hh.next;
00708 }
00709 }
00710
00711 void delete_keysU (KEYU *inlist, KEYU **fromlist) {
00712 KEYU *walker = inlist;
00713
00714 while (walker) {
00715 deletekeyU (fromlist, walker->name);
00716 walker = walker->hh.next;
00717 }
00718 }