⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 writin~1.txt

📁 一百个病毒的源代码 包括熊猫烧香等 极其具有研究价值
💻 TXT
字号:
                            Writing Plugins GuideLast updated: $Date: 2000/07/31 23:06:42 $0. Preface----------ModLogAn stands for Modular Logfile Analyser. Modular means that the wholeprogram is divided into piece that are put together by some glue code.0.1 The Glue code-----------------main.c		- main loop, history reading and writingmconfig.c	- configfile reading, init of pluginsmdatatypes.c	- datatype handlingmhash.c		- hashing routinesmisc.c		- conversion routines, strmatchmlist.c		- double linked listmlocale.c	- NLS support, country stringsmplugins.c	- plugin handlingmrecord.c	- framework for the record handlingmstate.c	- function to handle the internal state of modlogan0.1.1 datatypes---------------mdatatypes.c, mlist.c, mhash.c are providing some datatype that unify andsimplify the data handling inside of modlogan.mdatatypes.c provides the basic datatypes. every datatypes contains a blockcalled COMMON_DATA.0.1.1.1 COMMON_DATA-------------------#define COMMON_DATA     \        char *string;   \        int count;      \        int type;       \        int (*destructor)(void *); \        int (*write)(FILE *, void *); \        int (*read)(void *, FILE *);\        void* (*copy)(void *); \        int (*append)(void *, void*);'string' is the unique name of this element. most often it is the stringthat is used later for the sorting. 'count' is an integer that can be used to count the attemtes to insert anelement with same unique name (-> append function).'type' is an integer that carries some options like GROUPING and so on.'destructor' is a function that is called when the datatypes is removed frommemory. it takes care for the freeing of all by this datatype allocatedmemory. 'write' is used to put the datatype to the disk.'read' reconstructs the datatype again.'copy' is used to create a copy of the datatype.'append' is called by mlist_insert() if the 'to be insert' datatype has the same unique name like this datatype. 0.1.1.2 StrInt--------------The very basic datatype. It carries one string ('string') and one integer('count'). (+ 'type')It has 2 constructors:data_StrInt *createStr2Int(char *str, int count, int type);data_StrInt *createStrInt(char *str, int count); (deprecated)append-function:- adds the count to the already inserted count.0.1.1.3 Str3Int---------------one string ('string'), 3 integers ('count', 'vcount', 'type').constructors:data_Str3Int    *createStr3Int(char *str, int count, int type, int vcount);append function:- adds the count to the already inserted count.- adds the vcount to the already inserted vcount.0.1.1.4 Visit-------------0.1.1.5 History---------------1. Input Plugin---------------An input plugins has to provide the following functions:int mplugins_input_dlinit(mconfig *ext_conf);int mplugins_input_dlclose(mconfig *ext_conf);int mplugins_input_parse_config(mconfig *ext_conf, const char *key,   char *value);int mplugins_input_set_defaults(mconfig *ext_conf);int get_next_record(mconfig *ext_conf, mlogrec *record);There has to be a file named 'parse.c'. This only improtant for theconfigure script. It looks for this file and enables the selecting of thisplugin for the 'non-plugin' version.2. Output Plugin----------------An output plugin has to provide the following function:int mplugins_output_dlinit(mconfig *ext_conf);int mplugins_output_dlclose(mconfig *ext_conf);int mplugins_output_parse_config(mconfig *ext_conf, const char *key,   char *value);int mplugins_output_set_defaults(mconfig *ext_conf);int generate_monthly_output(mconfig *ext_conf, mstate *state);int generate_history_output(mconfig *ext_conf, mlist *history);There has to be a file named 'generate.c'. This only improtant for theconfigure script. It looks for this file and enables the selecting of thisplugin for the 'non-plugin' version.3. Processing Plugin--------------------int insert_record(mconfig *conf, mstate *state, mlogrec *record);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -