296 {
304
305
313
314
318
323 exit(0);
324 }
325
326
328
329#pragma GCC diagnostic push
330#pragma GCC diagnostic ignored "-Wformat-nonliteral"
331
332
334
338 }
339
340
344 }
345 } else {
346
351 }
352#pragma GCC diagnostic pop
353
354
357
358
359 if (
namepos != std::string::npos) {
360
363
365
371 if (
name.length() >= 32) {
373 "Equipment name %s%s%s too long, trimming down to %d characters",
375 32);
376 }
379 }
380
382
389 printf(
"ERROR: Cannot create equipment record \"%s\", db_set_record() status %d\n",
str,
status);
392 return 0;
393 }
395 cm_msg(
MINFO,
"register_equipment",
"Correcting \"%s\", db_check_record() status %d",
str,
status);
398 printf(
"ERROR: Cannot check equipment record \"%s\", db_check_record() status %d\n",
str,
status);
401 exit(0);
402 }
403
406 printf(
"ERROR: Cannot find \"%s\", db_find_key() status %d",
str,
status);
409 exit(0);
410 }
411
414 printf(
"ERROR: Cannot check record \"%s\", db_check_record() status %d",
str,
status);
417 exit(0);
418 }
419
420
422
426 int size;
435 printf(
"ERROR: Cannot set record \"%s\", db_set_record() status %d",
str,
status);
438 exit(0);
439 }
447 }
448 } else {
452 printf(
"ERROR: Cannot get record \"%s\", db_get_record() status %d",
str,
status);
455 exit(0);
456 }
457 }
458
459
462 printf(
"ERROR: Cannot hotlink \"%s\", db_watch() status %d",
str,
status);
465 exit(0);
466 }
467
470 else
472
483
484
486
488 cm_msg(
MERROR,
"register_equipment",
"Cannot update equipment Common, db_set_record() status %d",
status);
489 return 0;
490 }
491
492
498 cm_msg(
MERROR,
"register_equipment",
"Equipment \"%s\" contains RO_STOPPED or RO_ALWAYS. This can lead to undesired side-effect and should be removed.",
equipment[
idx].
name);
499 }
500
501
502
507 else {
508
510
511 for (; bank_list->
name[0]; bank_list++) {
512
513
514
515
516
522 printf(
"Cannot check/create record \"%s\", status = %d\n",
str,
525 }
526 } else {
532 }
533 }
534 }
535 } else
537
541
542
543
545
548 printf(
"Cannot create/check statistics record \'%s\', error %d\n",
str,
status);
550 }
551
554 printf(
"Cannot find statistics record \'%s\', error %d\n",
str,
status);
556 }
557
561
562
565
569 "Cannot change access mode for record \'%s\', error %d",
str,
status);
570 else
571 cm_msg(
MINFO,
"register_equipment",
"Recovered access mode for record \'%s\'",
str);
573 }
576 "Cannot open statistics record \'%s\', error %d",
str,
status);
578 }
579
580
581
582
586
589 "Not enough memory to allocate buffer for fragmented events");
591 }
592 }
593
598 return 0;
599 }
600 } else
602 }
603
605
607}
INT bm_open_buffer(const char *buffer_name, INT buffer_size, INT *buffer_handle)
#define DB_STRUCT_MISMATCH
std::string ss_gethostname()
std::string strcomb1(const char **list)
INT db_create_key(HNDLE hDB, HNDLE hKey, const char *key_name, DWORD type)
INT db_check_record(HNDLE hDB, HNDLE hKey, const char *keyname, const char *rec_str, BOOL correct)
INT db_get_record(HNDLE hDB, HNDLE hKey, void *data, INT *buf_size, INT align)
INT db_set_mode(HNDLE hDB, HNDLE hKey, WORD mode, BOOL recurse)
INT db_watch(HNDLE hDB, HNDLE hKey, void(*dispatcher)(INT, INT, INT, void *), void *info)
INT db_set_value(HNDLE hDB, HNDLE hKeyRoot, const char *key_name, const void *data, INT data_size, INT num_values, DWORD type)
INT db_open_record1(HNDLE hDB, HNDLE hKey, void *ptr, INT rec_size, WORD access_mode, void(*dispatcher)(INT, INT, void *), void *info, const char *rec_str)
INT db_set_record(HNDLE hDB, HNDLE hKey, void *data, INT buf_size, INT align)
INT db_create_record(HNDLE hDB, HNDLE hKey, const char *orig_key_name, const char *init_str)
static void eq_common_watcher(INT hDB, INT, INT, void *info)
const char * frontend_file_name
The frontend file name, don't change it.
BOOL equipment_common_overwrite
#define EQUIPMENT_STATISTICS_STR
#define DEFAULT_BUFFER_SIZE