#include #include #include #include #include #include #include #include #include #include #include "../attr_api/Attr_API.h" #include "StatAttn.h" #include "StatClient.h" #include "DtcStatAlarmReporter.h" #ifndef LONG_MAX #define LONG_MAX (long)2147483647 #endif struct CStatAttn { int attnId; CStatClient::iterator info; unsigned char hide; unsigned char add; unsigned char subid; unsigned char cat; }; static std::vector attnInfo; int ReloadConfigFile(CStatClient &stc, const char *filename) { /* timestamp checking */ { static time_t mtime = 0; struct stat st; if(stat(filename, &st) != 0) st.st_mtime = 0; if(st.st_mtime == mtime) return 0; mtime = st.st_mtime; } FILE *fp = fopen(filename, "r"); if(fp == NULL) return -1; // hide all info for(unsigned int i=0; i= 0x10000000) continue; sub = lsub; } if(sub < 0) continue; if(!si->issample() && sub > 0) continue; if(si->issample() && (unsigned)sub >= si->count() + 2) continue; while(isblank(*p)) p++; int cat = SCC_10S; if(!strncmp(p, "[cur]", 5)) cat = SC_CUR; if(!strncmp(p, "[10s]", 5)) cat = SCC_10S; if(!strncmp(p, "[10m]", 5)) cat = SCC_10M; if(!strncmp(p, "[all]", 5)) cat = SCC_ALL; unsigned int i; for(i=0; iInitAlarmCfg(std::string(filename)); ALARM_REPORTER->ReportAlarm(); } return 0; }