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
387 if (
eq_info->write_cache_size == 0)
391 printf(
"ERROR: Cannot create equipment record \"%s\", db_set_record() status %d\n",
str,
status);
394 return 0;
395 }
397 cm_msg(
MINFO,
"register_equipment",
"Correcting \"%s\", db_check_record() status %d",
str,
status);
400 printf(
"ERROR: Cannot check equipment record \"%s\", db_check_record() status %d\n",
str,
status);
403 exit(0);
404 }
405
408 printf(
"ERROR: Cannot find \"%s\", db_find_key() status %d",
str,
status);
411 exit(0);
412 }
413
416 printf(
"ERROR: Cannot check record \"%s\", db_check_record() status %d",
str,
status);
419 exit(0);
420 }
421
422
424
428 int size;
437 printf(
"ERROR: Cannot set record \"%s\", db_set_record() status %d",
str,
status);
440 exit(0);
441 }
449 }
450 } else {
454 printf(
"ERROR: Cannot get record \"%s\", db_get_record() status %d",
str,
status);
457 exit(0);
458 }
459 }
460
461
464 printf(
"ERROR: Cannot hotlink \"%s\", db_watch() status %d",
str,
status);
467 exit(0);
468 }
469
472 else
474
485
486
488
490 cm_msg(
MERROR,
"register_equipment",
"Cannot update equipment Common, db_set_record() status %d",
status);
491 return 0;
492 }
493
494
500 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);
501 }
502
503
504
509 else {
510
512
513 for (; bank_list->
name[0]; bank_list++) {
514
515
516
517
518
524 printf(
"Cannot check/create record \"%s\", status = %d\n",
str,
527 }
528 } else {
534 }
535 }
536 }
537 } else
539
543
544
545
547
550 printf(
"Cannot create/check statistics record \'%s\', error %d\n",
str,
status);
552 }
553
556 printf(
"Cannot find statistics record \'%s\', error %d\n",
str,
status);
558 }
559
563
564
567
571 "Cannot change access mode for record \'%s\', error %d",
str,
status);
572 else
573 cm_msg(
MINFO,
"register_equipment",
"Recovered access mode for record \'%s\'",
str);
575 }
578 "Cannot open statistics record \'%s\', error %d",
str,
status);
580 }
581
582
583
584
588
591 "Not enough memory to allocate buffer for fragmented events");
593 }
594 }
595
600 return 0;
601 }
602
603
607 } else
609 }
610
611
615 for (
j = 0;
j <
idx;
j++) {
619 }
620 }
621 }
622 }
623 }
624
626
628}
INT bm_open_buffer(const char *buffer_name, INT buffer_size, INT *buffer_handle)
INT bm_set_cache_size(INT buffer_handle, size_t read_size, size_t write_size)
#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 MIN_WRITE_CACHE_SIZE
#define EQUIPMENT_STATISTICS_STR
#define DEFAULT_BUFFER_SIZE