global.h

来自「基于linux下的故障录波前置程序」· C头文件 代码 · 共 63 行

H
63
字号
#ifndef _GLOBAL_H_
#define _GLOBAL_H_
#include <sys/stat.h>
#include<dirent.h>
#include<stdlib.h>
#include<stdio.h>
#include <pcap.h>
#include "decode.h"



#define UBYTE unsigned char
#define BYTE char
#define UWORD unsigned short
#define MAX_BUFFER_SIZE        100000
#define MAX_VALUE_BUFFER_SIZE  128

typedef struct _YcChannelCfg
{
	int id;
	char *name;
	char * unit;
	float ratio;
	float max;
	int type;
	int controlword;
	float localvalue[8];
}YcChannelCfg;

typedef struct _YxChannelCfg
{
	int id;
	char *name;
	int type;
	UBYTE high;
	UBYTE low;
}YxChannelCfg;


static char szBuffer[MAX_BUFFER_SIZE];
static int  iBufferLen=0;
static int  bBufferChanged=0;
static FILE *fp1=NULL;

void GB_trim(char *buf );
int GB_getline( FILE *fd , int nLineLen , char *line);
int GB_SetIniString(char *fp,const char *pSection,const char *pIdent,const char *pValue);
int GB_SetIniInteger(char *fp,const char *pSection, const char *pIdent, const int pValue);
int GB_SetIniLong(char *fp,const char *pSection, const char *pIdent, const long pValue);
int GB_SetIniDouble(char *fp,const char *pSection, const char *pIdent, const double pValue);
int GB_getsection(char *line , char *section);
int GB_getkeyvalue(char *line ,char *thekey ,char *thevalue );
int GB_getkeyvalue_notrim(char *line ,char *thekey ,char *thevalue );
int GB_GetInfo_Str(char *section ,char *key , char *value , char *inifile);
int GB_GetInfo_Int(char *section ,char *key , int *nvalue , char *inifile);
void GB_CheckMySlef(char *Killname);

void SetValue(int cpu,UBYTE uclvalue,UBYTE uchvalue);
void GetValue(int cpu,UBYTE *uclvalue,UBYTE uchvalue);

#endif

⌨️ 快捷键说明

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