📄 stats.h
字号:
/*SMS Server Tools 3Copyright (C) Keijo Kasvihttp://smstools3.kekekasvi.com/Based on SMS Server Tools 2 from Stefan Fringshttp://www.meinemullemaus.de/This program is free software unless you got it under another license directlyfrom the author. You can redistribute it and/or modify it under the terms ofthe GNU General Public License as published by the Free Software Foundation.Either version 2 of the License, or (at your option) any later version.*/#ifndef STATS_H#define STATS_H#include <time.h>typedef struct{ int succeeded_counter; // Number of sent SM int failed_counter; // Number of not sent SM (ERROR from modem) int received_counter; // Number of received SM int multiple_failed_counter; // Number of multiple failed SM (3 consecutive ERROR's from modem) int usage_s; // Modem usage to send SM in seconds int usage_r; // Modem usage to receive SM in seconds char status; // s=send r=receive i=idle b=blocked -=not running} _stats;_stats* statistics[DEVICES]; // Statistic data (shared memory!)int rejected_counter; // Statistic counter, rejected SM, number does not fit into any queuetime_t start_time; // Start time of smsd, allows statistic functionsint printstatus; // if 1 smsd outputs status on stdouttime_t last_stats; // time when the last stats file was createdchar d_stats[256]; // path to statistic filesint stats_interval; // time between statistic files in seconds.int stats_no_zeroes; // Suppress files that contain only zeroes/* Creates shared memory variables for statistic data */void initstats();/* Resets statistic data to 0 */void resetstats();/* saves the current statistic counter into a tmp file */void savestats();/* load the statistic counter from the tmp file */void loadstats();/* Prints modem status to stdout */void print_status();/* Checks if next statistic file should be written and writes it */void checkwritestats();#endif // STATS_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -