1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748
|
Description: fix of FTBFS with gcc10
Author: Thorsten Alteholz <debian@alteholz.de>
Index: smstools/src/smsd_cfg.h
===================================================================
--- smstools.orig/src/smsd_cfg.h 2020-08-05 19:02:50.536596441 +0000
+++ smstools/src/smsd_cfg.h 2020-08-05 19:33:22.915005150 +0000
@@ -126,17 +126,17 @@
#define ALPHABET_UNKNOWN 4
#define ALPHABET_DEFAULT 0
-char process_title[32]; // smsd for main task, NOTIFIER or CHILD, name of a modem for other tasks.
-int process_id; // -1 for main task, all modems have numbers starting with 0.
+extern char process_title[32]; // smsd for main task, NOTIFIER or CHILD, name of a modem for other tasks.
+extern int process_id; // -1 for main task, all modems have numbers starting with 0.
// This is the same as device, can be used like devices[process_id] if IS_MODEM_PROCESS.
-time_t process_start_time;
+extern time_t process_start_time;
-int modem_handle; // Handle for modem.
+extern int modem_handle; // Handle for modem.
-int put_command_timeouts;
-unsigned long long put_command_sent; // 3.1.16beta.
-char tmpdir[PATH_MAX]; // 3.1.16beta.
+extern int put_command_timeouts;
+extern unsigned long long put_command_sent; // 3.1.16beta.
+extern char tmpdir[PATH_MAX]; // 3.1.16beta.
typedef struct
{
@@ -284,204 +284,204 @@
// NOTE for regular run intervals: effective value is at least delaytime.
-char configfile[PATH_MAX]; // Path to config file
-char d_spool[PATH_MAX]; // Spool directory
-char d_failed[PATH_MAX]; // Failed spool directory
-char d_failed_copy[PATH_MAX]; // 3.1.17.
-char d_incoming[PATH_MAX]; // Incoming spool directory
-char d_incoming_copy[PATH_MAX]; // 3.1.16beta2.
-char d_report[PATH_MAX]; // Incoming report spool directory
-char d_report_copy[PATH_MAX]; // 3.1.17.
-char d_phonecalls[PATH_MAX]; // Incoming phonecalls data directory
-char d_saved[PATH_MAX]; // Directory for smsd's internal use, concatenation storage files etc.
-char d_sent[PATH_MAX]; // Sent spool directory
-char d_sent_copy[PATH_MAX]; // 3.1.17.
-char d_checked[PATH_MAX]; // Spool directory for checked messages (only used when no provider queues used)
-char eventhandler[PATH_MAX]; // Global event handler program or script
-char alarmhandler[PATH_MAX]; // Global alarm handler program or script
-char checkhandler[PATH_MAX]; // Handler that checks if the sms file is valid.
-int alarmlevel; // Alarm Level (9=highest). Verbosity of alarm handler.
-char logfile[PATH_MAX]; // Name or Handle of Log File
-int loglevel; // Log Level (9=highest). Verbosity of log file.
-_queue queues[NUMBER_OF_MODEMS]; // Queues
-_device devices[NUMBER_OF_MODEMS]; // Modem devices
-int delaytime; // sleep-time after workless
-int delaytime_mainprocess; // sleep-time after workless, main process. If -1, delaytime is used.
-int blocktime; // sleep-time after multiple errors
-int blockafter; // Block modem after n errors
-int errorsleeptime; // sleep-time after each error
-int autosplit; // Splitting of large text messages 0=no, 1=yes 2=number with text, 3=number with UDH
-int receive_before_send; // if 1 smsd tries to receive one message before sending
-int store_received_pdu; // 0=no, 1=unsupported pdu's only, 2=unsupported and 8bit/unicode, 3=all
-int store_sent_pdu; // 0=no, 1=failed pdu's only, 2=failed and 8bit/unicode, 3=all
-int validity_period; // Validity period for messages.
-int decode_unicode_text; // 1 if unicode text is decoded internally.
-int internal_combine; // 1 if multipart message is combined internally.
-int internal_combine_binary; // 1 if multipart binary message is combined internally. Defaults to internal_combine.
-int keep_filename; // 0 if unique filename is created to each directory when a message file is moved.
-int store_original_filename; // 1 if an original filename is saved to message file when it's moved from
- // outgoing directory to spooler. Works together with keep_filename.
-int date_filename; // 1 or 2 if YYYYMMDD is included to the filename of incoming message.
-char regular_run[PATH_MAX]; // Script/program which is run regularly.
-int regular_run_interval; // Number of seconds between running a regular_run script/progdam.
-char admin_to[SIZE_TO]; // Destination number for administrative messages.
-int filename_preview; // Number of chars of message text to concatenate to filename.
-int incoming_utf8; // 1 if incoming files are saved using UTF-8 character set.
-int outgoing_utf8; // 1 if outgoing files are automatically converted from UTF-8 to ISO and GSM.
-int log_charconv; // 1 if character set conversion is logged.
-int log_single_lines; // 1 if linefeeds are removed from the modem response to be logged.
-int executable_check; // 0 if eventhandler and other executables are NOT checked during the startup checking.
-int keep_messages; // For testing purposes: messages are not deleted and smsd stops after first run.
-char priviledged_numbers[SIZE_PRIVILEDGED_NUMBERS]; // Priviledged numbers in incoming messages.
-int ic_purge_hours; // If internal_combine is used, concatenation storage is checked every ic_purge_interval minutes
-int ic_purge_minutes; // and if there is message parts older than defined, they are handled or deleted.
-int ic_purge_read; // 1 = message parts are stored as single messages. 0 = parts are just deleted.
-int ic_purge_interval; //
-char shell[PATH_MAX]; // Shell used to run eventhandler, defaults to /bin/sh
-char adminmessage_device[32]; // Name of device used to send administrative messages of mainspooler.
-int smart_logging; // 1 = if loglevel is less than 7, degug log is written is there has been any errors.
-int status_signal_quality; // 1 = signal quality is written to status file.
-int status_include_counters; // 1 = succeeded, failed and received counters are included in the status line.
-int status_include_uptime; // 3.1.16beta: 1 = include started & uptime line in the status file.
-int hangup_incoming_call; // 1 = if detected unexpected input contains RING and we want to end call.
-int max_continuous_sending; // Defines when sending is breaked to do check/do other tasks. Time in minutes.
-int voicecall_hangup_ath; // If ATH is used instead of AT+CHUP.
+extern char configfile[PATH_MAX]; // Path to config file
+extern char d_spool[PATH_MAX]; // Spool directory
+extern char d_failed[PATH_MAX]; // Failed spool directory
+extern char d_failed_copy[PATH_MAX]; // 3.1.17.
+extern char d_incoming[PATH_MAX]; // Incoming spool directory
+extern char d_incoming_copy[PATH_MAX]; // 3.1.16beta2.
+extern char d_report[PATH_MAX]; // Incoming report spool directory
+extern char d_report_copy[PATH_MAX]; // 3.1.17.
+extern char d_phonecalls[PATH_MAX]; // Incoming phonecalls data directory
+extern char d_saved[PATH_MAX]; // Directory for smsd's internal use, concatenation storage files etc.
+extern char d_sent[PATH_MAX]; // Sent spool directory
+extern char d_sent_copy[PATH_MAX]; // 3.1.17.
+extern char d_checked[PATH_MAX]; // Spool directory for checked messages (only used when no provider queues used)
+extern char eventhandler[PATH_MAX]; // Global event handler program or script
+extern char alarmhandler[PATH_MAX]; // Global alarm handler program or script
+extern char checkhandler[PATH_MAX]; // Handler that checks if the sms file is valid.
+extern int alarmlevel; // Alarm Level (9=highest). Verbosity of alarm handler.
+extern char logfile[PATH_MAX]; // Name or Handle of Log File
+extern int loglevel; // Log Level (9=highest). Verbosity of log file.
+extern _queue queues[NUMBER_OF_MODEMS]; // Queues
+extern _device devices[NUMBER_OF_MODEMS]; // Modem devices
+extern int delaytime; // sleep-time after workless
+extern int delaytime_mainprocess; // sleep-time after workless, main process. If -1, delaytime is used.
+extern int blocktime; // sleep-time after multiple errors
+extern int blockafter; // Block modem after n errors
+extern int errorsleeptime; // sleep-time after each error
+extern int autosplit; // Splitting of large text messages 0=no, 1=yes 2=number with text, 3=number with UDH
+extern int receive_before_send; // if 1 smsd tries to receive one message before sending
+extern int store_received_pdu; // 0=no, 1=unsupported pdu's only, 2=unsupported and 8bit/unicode, 3=all
+extern int store_sent_pdu; // 0=no, 1=failed pdu's only, 2=failed and 8bit/unicode, 3=all
+extern int validity_period; // Validity period for messages.
+extern int decode_unicode_text; // 1 if unicode text is decoded internally.
+extern int internal_combine; // 1 if multipart message is combined internally.
+extern int internal_combine_binary; // 1 if multipart binary message is combined internally. Defaults to internal_combine.
+extern int keep_filename; // 0 if unique filename is created to each directory when a message file is moved.
+extern int store_original_filename; // 1 if an original filename is saved to message file when it's moved from
+// outgoing directory to spooler. Works together with keep_filename.
+extern int date_filename; // 1 or 2 if YYYYMMDD is included to the filename of incoming message.
+extern char regular_run[PATH_MAX]; // Script/program which is run regularly.
+extern int regular_run_interval; // Number of seconds between running a regular_run script/progdam.
+extern char admin_to[SIZE_TO]; // Destination number for administrative messages.
+extern int filename_preview; // Number of chars of message text to concatenate to filename.
+extern int incoming_utf8; // 1 if incoming files are saved using UTF-8 character set.
+extern int outgoing_utf8; // 1 if outgoing files are automatically converted from UTF-8 to ISO and GSM.
+extern int log_charconv; // 1 if character set conversion is logged.
+extern int log_single_lines; // 1 if linefeeds are removed from the modem response to be logged.
+extern int executable_check; // 0 if eventhandler and other executables are NOT checked during the startup checking.
+extern int keep_messages; // For testing purposes: messages are not deleted and smsd stops after first run.
+extern char priviledged_numbers[SIZE_PRIVILEDGED_NUMBERS]; // Priviledged numbers in incoming messages.
+extern int ic_purge_hours; // If internal_combine is used, concatenation storage is checked every ic_purge_interval minutes
+extern int ic_purge_minutes; // and if there is message parts older than defined, they are handled or deleted.
+extern int ic_purge_read; // 1 = message parts are stored as single messages. 0 = parts are just deleted.
+extern int ic_purge_interval; //
+extern char shell[PATH_MAX]; // Shell used to run eventhandler, defaults to /bin/sh
+extern char adminmessage_device[32]; // Name of device used to send administrative messages of mainspooler.
+extern int smart_logging; // 1 = if loglevel is less than 7, degug log is written is there has been any errors.
+extern int status_signal_quality; // 1 = signal quality is written to status file.
+extern int status_include_counters; // 1 = succeeded, failed and received counters are included in the status line.
+extern int status_include_uptime; // 3.1.16beta: 1 = include started & uptime line in the status file.
+extern int hangup_incoming_call; // 1 = if detected unexpected input contains RING and we want to end call.
+extern int max_continuous_sending; // Defines when sending is breaked to do check/do other tasks. Time in minutes.
+extern int voicecall_hangup_ath; // If ATH is used instead of AT+CHUP.
// 3.1.5:
-int trust_outgoing; // 1 = it's _sure_ that files are created by rename AND permissions are correct. Speeds up spooling.
+extern int trust_outgoing; // 1 = it's _sure_ that files are created by rename AND permissions are correct. Speeds up spooling.
// 3.1.5:
-int ignore_outgoing_priority; // 1 = Priority: high header is not checked. Speeds up spooling.
+extern int ignore_outgoing_priority; // 1 = Priority: high header is not checked. Speeds up spooling.
// 3.1.7:
-int ignore_exec_output; // 1 = stdout and stderr of eventhandlers is _not_ checked.
+extern int ignore_exec_output; // 1 = stdout and stderr of eventhandlers is _not_ checked.
// 3.1.7:
-mode_t conf_umask; // File mode creation mask for smsd and modem processes.
+extern mode_t conf_umask; // File mode creation mask for smsd and modem processes.
// 3.1.7:
-int trim_text; // 1 = trailing whitespaces are removed from text:
+extern int trim_text; // 1 = trailing whitespaces are removed from text:
// 3.1.7:
-int use_linux_ps_trick; // 1 = change argv[0] to "smsd: MAINPROCESS", "smsd: GSM1" etc.
+extern int use_linux_ps_trick; // 1 = change argv[0] to "smsd: MAINPROCESS", "smsd: GSM1" etc.
// 3.1.7:
-int log_unmodified;
+extern int log_unmodified;
// 3.1.7:
-char suspend_filename[PATH_MAX];
+extern char suspend_filename[PATH_MAX];
// 3.1.9:
-int spool_directory_order;
+extern int spool_directory_order;
// 3.1.9: 1 if read_from_modem is logged.
-int log_read_from_modem;
+extern int log_read_from_modem;
// 3.1.16beta2: log_read_timing for performance tuning.
-int log_read_timing;
+extern int log_read_timing;
// 3.1.16beta:
-int log_response_time;
+extern int log_response_time;
// 3.1.16beta2:
-int default_alphabet;
+extern int default_alphabet;
// 3.1.17: Child process for the mainprocess:
-char mainprocess_child[PATH_MAX];
-char mainprocess_child_args[PATH_MAX];
+extern char mainprocess_child[PATH_MAX];
+extern char mainprocess_child_args[PATH_MAX];
// 3.1.17: Notifier for the mainprocess:
-int mainprocess_notifier;
+extern int mainprocess_notifier;
// 3.1.17: If *_copy was made, evenhandler can use it instead of original file:
-int eventhandler_use_copy;
+extern int eventhandler_use_copy;
// 3.1.17: This defines how long to sleep while looping:
-int sleeptime_mainprocess;
+extern int sleeptime_mainprocess;
// 3.1.17: Defines how often PID is checked to detect if another smsd is running:
-int check_pid_interval;
+extern int check_pid_interval;
// 3.1.18: start script/program for mainprocess:
-char mainprocess_start[PATH_MAX];
-char mainprocess_start_args[PATH_MAX];
+extern char mainprocess_start[PATH_MAX];
+extern char mainprocess_start_args[PATH_MAX];
-int message_count; // Counter for sent messages. Multipart message is one message.
+extern int message_count; // Counter for sent messages. Multipart message is one message.
-volatile sig_atomic_t break_workless_delay; // To break the delay when SIGCONT is received.
-volatile sig_atomic_t terminate; // To terminate when SIGTERM is received.
+extern volatile sig_atomic_t break_workless_delay; // To break the delay when SIGCONT is received.
+extern volatile sig_atomic_t terminate; // To terminate when SIGTERM is received.
-char username[65]; // user and group name which are used to run.
-char groupname[65]; // (max length is just a guess)
+extern char username[65]; // user and group name which are used to run.
+extern char groupname[65]; // (max length is just a guess)
-char infofile[PATH_MAX]; // Hepler file for stopping the smsd smoothly.
-char pidfile[PATH_MAX]; // File where a process id is stored.
+extern char infofile[PATH_MAX]; // Hepler file for stopping the smsd smoothly.
+extern char pidfile[PATH_MAX]; // File where a process id is stored.
// Command line arguments:
-char arg_username[65];
-char arg_groupname[65];
-char arg_infofile[PATH_MAX];
-char arg_pidfile[PATH_MAX];
-char arg_logfile[PATH_MAX];
-int arg_terminal;
+extern char arg_username[65];
+extern char arg_groupname[65];
+extern char arg_infofile[PATH_MAX];
+extern char arg_pidfile[PATH_MAX];
+extern char arg_logfile[PATH_MAX];
+extern int arg_terminal;
// 3.1.7:
-char arg_7bit_packed[512];
-int do_encode_decode_arg_7bit_packed;
+extern char arg_7bit_packed[512];
+extern int do_encode_decode_arg_7bit_packed;
-int terminal; // 1 if smsd is communicating with terminal.
-pid_t device_pids[NUMBER_OF_MODEMS]; // Pid's of modem processes.
-char run_info[PATH_MAX]; // Information about external script/program execution.
+extern int terminal; // 1 if smsd is communicating with terminal.
+extern pid_t device_pids[NUMBER_OF_MODEMS]; // Pid's of modem processes.
+extern char run_info[PATH_MAX]; // Information about external script/program execution.
-char communicate[32]; // Device name for terminal communication mode.
+extern char communicate[32]; // Device name for terminal communication mode.
-char international_prefixes[PATH_MAX +1];
-char national_prefixes[PATH_MAX +1];
+extern char international_prefixes[PATH_MAX +1];
+extern char national_prefixes[PATH_MAX +1];
// Storage for startup errors:
-char *startup_err_str;
-int startup_err_count;
+extern char *startup_err_str;
+extern int startup_err_count;
// Storage for PDU's:
-char *incoming_pdu_store;
-char *outgoing_pdu_store;
-char *routed_pdu_store;
+extern char *incoming_pdu_store;
+extern char *outgoing_pdu_store;
+extern char *routed_pdu_store;
// Storage for getfile errors:
-char *getfile_err_store;
+extern char *getfile_err_store;
// Text buffer for error messages:
-char tb[SIZE_TB];
+extern char tb[SIZE_TB];
// Buffer for SIM memory checking:
-char *check_memory_buffer;
-size_t check_memory_buffer_size;
+extern char *check_memory_buffer;
+extern size_t check_memory_buffer_size;
-int os_cygwin; // 1 if we are on Cygwin.
+extern int os_cygwin; // 1 if we are on Cygwin.
-char language_file[PATH_MAX]; // File name of translated headers.
-char yes_chars[SIZE_HEADER]; // Characters which mean "yes" in the yesno() question.
-char no_chars[SIZE_HEADER]; // See details inside read_translation() function.
-char yes_word[SIZE_HEADER]; // "yes" printed as an output.
-char no_word[SIZE_HEADER]; // "no"
-char datetime_format[SIZE_HEADER]; // strftime format string for time stamps (not inside status reports).
-char logtime_format[SIZE_HEADER]; // 3.1.7: strftime format string for logging time stamps
-char date_filename_format[SIZE_HEADER]; // 3.1.7: strftime format string for date_filename
-int translate_incoming; // 0 if incoming message headers are NOT transtaled.
+extern char language_file[PATH_MAX]; // File name of translated headers.
+extern char yes_chars[SIZE_HEADER]; // Characters which mean "yes" in the yesno() question.
+extern char no_chars[SIZE_HEADER]; // See details inside read_translation() function.
+extern char yes_word[SIZE_HEADER]; // "yes" printed as an output.
+extern char no_word[SIZE_HEADER]; // "no"
+extern char datetime_format[SIZE_HEADER]; // strftime format string for time stamps (not inside status reports).
+extern char logtime_format[SIZE_HEADER]; // 3.1.7: strftime format string for logging time stamps
+extern char date_filename_format[SIZE_HEADER]; // 3.1.7: strftime format string for date_filename
+extern int translate_incoming; // 0 if incoming message headers are NOT transtaled.
// 3.1.14:
-int logtime_us;
-int logtime_ms;
+extern int logtime_us;
+extern int logtime_ms;
// 3.1.14:
-int shell_test;
+extern int shell_test;
// Next two are for debugging purposes:
-int enable_smsd_debug;
-char smsd_debug[SIZE_SMSD_DEBUG]; // Header of an outgoing message file.
+extern int enable_smsd_debug;
+extern char smsd_debug[SIZE_SMSD_DEBUG]; // Header of an outgoing message file.
// 3.1.20: Alt keys in communication mode:
#define COMMUNICATE_A_KEY_COUNT 10
-char communicate_a_keys[COMMUNICATE_A_KEY_COUNT][256];
+extern char communicate_a_keys[COMMUNICATE_A_KEY_COUNT][256];
/* initialize all variable with default values */
Index: smstools/src/smsd_cfg.c
===================================================================
--- smstools.orig/src/smsd_cfg.c 2020-07-27 19:00:41.616207603 +0000
+++ smstools/src/smsd_cfg.c 2020-08-05 19:17:41.595712888 +0000
@@ -38,6 +38,221 @@
#include "modeminit.h"
#include "charshift.h"
+
+/* global variables */
+char process_title[32]; // smsd for main task, NOTIFIER or CHILD, name of a modem for other tasks.
+int process_id; // -1 for main task, all modems have numbers starting with 0.
+ // This is the same as device, can be used like devices[process_id] if IS_MODEM_PROCESS.
+
+time_t process_start_time;
+
+int modem_handle; // Handle for modem.
+
+int put_command_timeouts;
+unsigned long long put_command_sent; // 3.1.16beta.
+char tmpdir[PATH_MAX]; // 3.1.16beta.
+
+// NOTE for regular run intervals: effective value is at least delaytime.
+
+char configfile[PATH_MAX]; // Path to config file
+char d_spool[PATH_MAX]; // Spool directory
+char d_failed[PATH_MAX]; // Failed spool directory
+char d_failed_copy[PATH_MAX]; // 3.1.17.
+char d_incoming[PATH_MAX]; // Incoming spool directory
+char d_incoming_copy[PATH_MAX]; // 3.1.16beta2.
+char d_report[PATH_MAX]; // Incoming report spool directory
+char d_report_copy[PATH_MAX]; // 3.1.17.
+char d_phonecalls[PATH_MAX]; // Incoming phonecalls data directory
+char d_saved[PATH_MAX]; // Directory for smsd's internal use, concatenation storage files etc.
+char d_sent[PATH_MAX]; // Sent spool directory
+char d_sent_copy[PATH_MAX]; // 3.1.17.
+char d_checked[PATH_MAX]; // Spool directory for checked messages (only used when no provider queues used)
+char eventhandler[PATH_MAX]; // Global event handler program or script
+char alarmhandler[PATH_MAX]; // Global alarm handler program or script
+char checkhandler[PATH_MAX]; // Handler that checks if the sms file is valid.
+int alarmlevel; // Alarm Level (9=highest). Verbosity of alarm handler.
+char logfile[PATH_MAX]; // Name or Handle of Log File
+int loglevel; // Log Level (9=highest). Verbosity of log file.
+_queue queues[NUMBER_OF_MODEMS]; // Queues
+_device devices[NUMBER_OF_MODEMS]; // Modem devices
+int delaytime; // sleep-time after workless
+int delaytime_mainprocess; // sleep-time after workless, main process. If -1, delaytime is used.
+int blocktime; // sleep-time after multiple errors
+int blockafter; // Block modem after n errors
+int errorsleeptime; // sleep-time after each error
+int autosplit; // Splitting of large text messages 0=no, 1=yes 2=number with text, 3=number with UDH
+int receive_before_send; // if 1 smsd tries to receive one message before sending
+int store_received_pdu; // 0=no, 1=unsupported pdu's only, 2=unsupported and 8bit/unicode, 3=all
+int store_sent_pdu; // 0=no, 1=failed pdu's only, 2=failed and 8bit/unicode, 3=all
+int validity_period; // Validity period for messages.
+int decode_unicode_text; // 1 if unicode text is decoded internally.
+int internal_combine; // 1 if multipart message is combined internally.
+int internal_combine_binary; // 1 if multipart binary message is combined internally. Defaults to internal_combine.
+int keep_filename; // 0 if unique filename is created to each directory when a message file is moved.
+int store_original_filename; // 1 if an original filename is saved to message file when it's moved from
+ // outgoing directory to spooler. Works together with keep_filename.
+int date_filename; // 1 or 2 if YYYYMMDD is included to the filename of incoming message.
+char regular_run[PATH_MAX]; // Script/program which is run regularly.
+int regular_run_interval; // Number of seconds between running a regular_run script/progdam.
+char admin_to[SIZE_TO]; // Destination number for administrative messages.
+int filename_preview; // Number of chars of message text to concatenate to filename.
+int incoming_utf8; // 1 if incoming files are saved using UTF-8 character set.
+int outgoing_utf8; // 1 if outgoing files are automatically converted from UTF-8 to ISO and GSM.
+int log_charconv; // 1 if character set conversion is logged.
+int log_single_lines; // 1 if linefeeds are removed from the modem response to be logged.
+int executable_check; // 0 if eventhandler and other executables are NOT checked during the startup checking.
+int keep_messages; // For testing purposes: messages are not deleted and smsd stops after first run.
+char priviledged_numbers[SIZE_PRIVILEDGED_NUMBERS]; // Priviledged numbers in incoming messages.
+int ic_purge_hours; // If internal_combine is used, concatenation storage is checked every ic_purge_interval minutes
+int ic_purge_minutes; // and if there is message parts older than defined, they are handled or deleted.
+int ic_purge_read; // 1 = message parts are stored as single messages. 0 = parts are just deleted.
+int ic_purge_interval; //
+char shell[PATH_MAX]; // Shell used to run eventhandler, defaults to /bin/sh
+char adminmessage_device[32]; // Name of device used to send administrative messages of mainspooler.
+int smart_logging; // 1 = if loglevel is less than 7, degug log is written is there has been any errors.
+int status_signal_quality; // 1 = signal quality is written to status file.
+int status_include_counters; // 1 = succeeded, failed and received counters are included in the status line.
+int status_include_uptime; // 3.1.16beta: 1 = include started & uptime line in the status file.
+int hangup_incoming_call; // 1 = if detected unexpected input contains RING and we want to end call.
+int max_continuous_sending; // Defines when sending is breaked to do check/do other tasks. Time in minutes.
+int voicecall_hangup_ath; // If ATH is used instead of AT+CHUP.
+
+// 3.1.5:
+int trust_outgoing; // 1 = it's _sure_ that files are created by rename AND permissions are correct. Speeds up spooling.
+
+// 3.1.5:
+int ignore_outgoing_priority; // 1 = Priority: high header is not checked. Speeds up spooling.
+
+// 3.1.7:
+int ignore_exec_output; // 1 = stdout and stderr of eventhandlers is _not_ checked.
+
+// 3.1.7:
+mode_t conf_umask; // File mode creation mask for smsd and modem processes.
+
+// 3.1.7:
+int trim_text; // 1 = trailing whitespaces are removed from text:
+
+// 3.1.7:
+int use_linux_ps_trick; // 1 = change argv[0] to "smsd: MAINPROCESS", "smsd: GSM1" etc.
+
+// 3.1.7:
+int log_unmodified;
+
+// 3.1.7:
+char suspend_filename[PATH_MAX];
+
+// 3.1.9:
+int spool_directory_order;
+
+// 3.1.9: 1 if read_from_modem is logged.
+int log_read_from_modem;
+
+// 3.1.16beta2: log_read_timing for performance tuning.
+int log_read_timing;
+
+// 3.1.16beta:
+int log_response_time;
+
+// 3.1.16beta2:
+int default_alphabet;
+
+// 3.1.17: Child process for the mainprocess:
+char mainprocess_child[PATH_MAX];
+char mainprocess_child_args[PATH_MAX];
+
+// 3.1.17: Notifier for the mainprocess:
+int mainprocess_notifier;
+
+// 3.1.17: If *_copy was made, evenhandler can use it instead of original file:
+int eventhandler_use_copy;
+
+// 3.1.17: This defines how long to sleep while looping:
+int sleeptime_mainprocess;
+
+// 3.1.17: Defines how often PID is checked to detect if another smsd is running:
+int check_pid_interval;
+
+// 3.1.18: start script/program for mainprocess:
+char mainprocess_start[PATH_MAX];
+char mainprocess_start_args[PATH_MAX];
+
+int message_count; // Counter for sent messages. Multipart message is one message.
+
+volatile sig_atomic_t break_workless_delay; // To break the delay when SIGCONT is received.
+volatile sig_atomic_t terminate; // To terminate when SIGTERM is received.
+
+char username[65]; // user and group name which are used to run.
+char groupname[65]; // (max length is just a guess)
+
+char infofile[PATH_MAX]; // Hepler file for stopping the smsd smoothly.
+char pidfile[PATH_MAX]; // File where a process id is stored.
+
+// Command line arguments:
+char arg_username[65];
+char arg_groupname[65];
+char arg_infofile[PATH_MAX];
+char arg_pidfile[PATH_MAX];
+char arg_logfile[PATH_MAX];
+int arg_terminal;
+// 3.1.7:
+char arg_7bit_packed[512];
+int do_encode_decode_arg_7bit_packed;
+
+int terminal; // 1 if smsd is communicating with terminal.
+pid_t device_pids[NUMBER_OF_MODEMS]; // Pid's of modem processes.
+char run_info[PATH_MAX]; // Information about external script/program execution.
+
+char communicate[32]; // Device name for terminal communication mode.
+
+char international_prefixes[PATH_MAX +1];
+char national_prefixes[PATH_MAX +1];
+
+// Storage for startup errors:
+char *startup_err_str;
+int startup_err_count;
+
+// Storage for PDU's:
+char *incoming_pdu_store;
+char *outgoing_pdu_store;
+char *routed_pdu_store;
+
+// Storage for getfile errors:
+char *getfile_err_store;
+
+// Text buffer for error messages:
+char tb[SIZE_TB];
+
+// Buffer for SIM memory checking:
+char *check_memory_buffer;
+size_t check_memory_buffer_size;
+
+int os_cygwin; // 1 if we are on Cygwin.
+
+char language_file[PATH_MAX]; // File name of translated headers.
+char yes_chars[SIZE_HEADER]; // Characters which mean "yes" in the yesno() question.
+char no_chars[SIZE_HEADER]; // See details inside read_translation() function.
+char yes_word[SIZE_HEADER]; // "yes" printed as an output.
+char no_word[SIZE_HEADER]; // "no"
+char datetime_format[SIZE_HEADER]; // strftime format string for time stamps (not inside status reports).
+char logtime_format[SIZE_HEADER]; // 3.1.7: strftime format string for logging time stamps
+char date_filename_format[SIZE_HEADER]; // 3.1.7: strftime format string for date_filename
+int translate_incoming; // 0 if incoming message headers are NOT transtaled.
+
+// 3.1.14:
+int logtime_us;
+int logtime_ms;
+
+// 3.1.14:
+int shell_test;
+
+// Next two are for debugging purposes:
+int enable_smsd_debug;
+char smsd_debug[SIZE_SMSD_DEBUG]; // Header of an outgoing message file.
+
+// 3.1.20: Alt keys in communication mode:
+#define COMMUNICATE_A_KEY_COUNT 10
+char communicate_a_keys[COMMUNICATE_A_KEY_COUNT][256];
+
char *msg_dir = "%s directory %s cannot be opened.";
char *msg_file = "%s directory %s is not writable.";
char *msg_not_executable = "is not executable for smsd.";
Index: smstools/src/logging.c
===================================================================
--- smstools.orig/src/logging.c 2020-07-27 19:00:41.612207583 +0000
+++ smstools/src/logging.c 2020-08-05 19:27:38.373800111 +0000
@@ -25,6 +25,16 @@
#include "smsd_cfg.h"
#include "stats.h"
+
+// 3.1.16beta2: Moved logch() and prch() from charset.c to logging.c:
+char logch_buffer[8192];
+
+char prch(char ch);
+
+// 3.1.16beta: changed type:
+//int trouble_logging_started;
+time_t trouble_logging_started;
+
int Filehandle = -1;
int Level;
int SavedLevel;
Index: smstools/src/logging.h
===================================================================
--- smstools.orig/src/logging.h 2020-07-27 19:00:41.612207583 +0000
+++ smstools/src/logging.h 2020-08-05 19:27:52.077848035 +0000
@@ -18,7 +18,7 @@
#include <time.h>
// 3.1.16beta2: Moved logch() and prch() from charset.c to logging.c:
-char logch_buffer[8192];
+extern char logch_buffer[8192];
#ifdef __GNUC__
void logch(char* format, ...) __attribute__ ((format(printf, 1, 2)));
@@ -26,11 +26,11 @@
void logch(char* format, ...);
#endif
-char prch(char ch);
+extern char prch(char ch);
// 3.1.16beta: changed type:
//int trouble_logging_started;
-time_t trouble_logging_started;
+extern time_t trouble_logging_started;
int change_loglevel(int new_level);
void restore_loglevel();
Index: smstools/src/stats.c
===================================================================
--- smstools.orig/src/stats.c 2020-07-27 19:00:41.616207603 +0000
+++ smstools/src/stats.c 2020-08-05 19:28:58.094078936 +0000
@@ -29,6 +29,20 @@
#include <mm.h>
#endif
+
+_stats* statistics[NUMBER_OF_MODEMS]; // Statistic data (shared memory!)
+int rejected_counter; // Statistic counter, rejected SM, number does not fit into any queue
+time_t start_time; // Start time of smsd, allows statistic functions
+int printstatus; // if 1 smsd outputs status on stdout
+time_t last_stats; // time when the last stats file was created
+char d_stats[PATH_MAX]; // path to statistic files
+int stats_interval; // time between statistic files in seconds.
+int stats_no_zeroes; // Suppress files that contain only zeroes
+int status_interval; // time between updating status file in seconds
+
+char *shared_buffer;
+
+
char newstatus[NUMBER_OF_MODEMS +1] = {0};
char oldstatus[NUMBER_OF_MODEMS +1] = {0};
Index: smstools/src/stats.h
===================================================================
--- smstools.orig/src/stats.h 2020-07-27 19:00:41.616207603 +0000
+++ smstools/src/stats.h 2020-08-05 19:29:14.750137182 +0000
@@ -33,17 +33,17 @@
int ber;
} _stats;
-_stats* statistics[NUMBER_OF_MODEMS]; // Statistic data (shared memory!)
-int rejected_counter; // Statistic counter, rejected SM, number does not fit into any queue
-time_t start_time; // Start time of smsd, allows statistic functions
-int printstatus; // if 1 smsd outputs status on stdout
-time_t last_stats; // time when the last stats file was created
-char d_stats[PATH_MAX]; // path to statistic files
-int stats_interval; // time between statistic files in seconds.
-int stats_no_zeroes; // Suppress files that contain only zeroes
-int status_interval; // time between updating status file in seconds
+extern _stats* statistics[NUMBER_OF_MODEMS]; // Statistic data (shared memory!)
+extern int rejected_counter; // Statistic counter, rejected SM, number does not fit into any queue
+extern time_t start_time; // Start time of smsd, allows statistic functions
+extern int printstatus; // if 1 smsd outputs status on stdout
+extern time_t last_stats; // time when the last stats file was created
+extern char d_stats[PATH_MAX]; // path to statistic files
+extern int stats_interval; // time between statistic files in seconds.
+extern int stats_no_zeroes; // Suppress files that contain only zeroes
+extern int status_interval; // time between updating status file in seconds
-char *shared_buffer;
+extern char *shared_buffer;
/* Creates shared memory variables for statistic data */
Index: smstools/src/blacklist.c
===================================================================
--- smstools.orig/src/blacklist.c 2020-07-27 19:00:41.612207583 +0000
+++ smstools/src/blacklist.c 2020-08-05 19:34:13.903183463 +0000
@@ -23,6 +23,8 @@
#include "alarm.h"
#include "smsd_cfg.h"
+char blacklist[256]; // Filename of the black-list
+
int inblacklist(char* msisdn)
{
FILE* file;
Index: smstools/src/blacklist.h
===================================================================
--- smstools.orig/src/blacklist.h 2020-07-27 19:00:41.612207583 +0000
+++ smstools/src/blacklist.h 2020-08-05 19:34:04.903151994 +0000
@@ -15,7 +15,7 @@
#ifndef BLACK_H
#define BLACK_H
-char blacklist[256]; // Filename of the black-list
+extern char blacklist[256]; // Filename of the black-list
int inblacklist(char* msisdn);
Index: smstools/src/whitelist.c
===================================================================
--- smstools.orig/src/whitelist.c 2020-07-27 19:00:41.616207603 +0000
+++ smstools/src/whitelist.c 2020-08-05 19:39:23.436266057 +0000
@@ -23,6 +23,8 @@
#include "alarm.h"
#include "smsd_cfg.h"
+char whitelist[256]; // Filename of the white-list
+
/* Used with >= 3.1x */
int inwhitelist_q(char* msisdn, char *queuename)
{
Index: smstools/src/whitelist.h
===================================================================
--- smstools.orig/src/whitelist.h 2020-07-27 19:00:41.616207603 +0000
+++ smstools/src/whitelist.h 2020-08-05 19:34:29.959239624 +0000
@@ -15,7 +15,7 @@
#ifndef WHITE_H
#define WHITE_H
-char whitelist[256]; // Filename of the white-list
+extern char whitelist[256]; // Filename of the white-list
/* Used with >= 3.1x */
int inwhitelist_q(char* msisdn, char *queuename);
|