File tree Expand file tree Collapse file tree 3 files changed +17
-4
lines changed
Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -363,10 +363,6 @@ static void exitSignalHandler(int signal)
363363
364364void ffStart (FFinstance * instance )
365365{
366- ffPrepareCPUUsage ();
367- ffPreparePublicIp (instance );
368- ffPrepareWeather (instance );
369-
370366 if (instance -> config .multithreading )
371367 startDetectionThreads (instance );
372368
Original file line number Diff line number Diff line change @@ -1485,6 +1485,19 @@ int main(int argc, const char** argv)
14851485 if (data .structure .length == 0 )
14861486 ffStrbufAppendS (& data .structure , FASTFETCH_DATATEXT_STRUCTURE );
14871487
1488+ #define FF_CONTAINS_MODULE_NAME (moduleName )\
1489+ ffStrbufContainIgnCaseS(&data.structure, ":" #moduleName ":") ||\
1490+ ffStrbufStartsWithIgnCaseS(&data.structure, #moduleName ":") ||\
1491+ ffStrbufEndsWithIgnCaseS(&data.structure, ":" #moduleName)
1492+
1493+ if (FF_CONTAINS_MODULE_NAME (CPUUsage ))
1494+ ffPrepareCPUUsage ();
1495+ if (FF_CONTAINS_MODULE_NAME (PublicIp ))
1496+ ffPreparePublicIp (& instance );
1497+ if (FF_CONTAINS_MODULE_NAME (Weather ))
1498+ ffPrepareWeather (& instance );
1499+ #undef FF_CONTAINS_MODULE_NAME
1500+
14881501 ffStart (& instance );
14891502
14901503 //Parse the structure and call the modules
Original file line number Diff line number Diff line change @@ -10,6 +10,10 @@ int main(int argc, char** argv)
1010
1111 //Modify instance.config here
1212
13+ // ffPrepareCPUUsage();
14+ // ffPreparePublicIp(&instance);
15+ // ffPrepareWeather(&instance);
16+
1317 //Does things like starting detection threads, disabling line wrap, etc
1418 ffStart (& instance );
1519
You can’t perform that action at this time.
0 commit comments