common.h

来自「Linux下的类似softice的调试工具」· C头文件 代码 · 共 76 行

H
76
字号
/******************************************************************************/
/*                                                                            */
/*               Common (C) by Gerhard W. Gruber in Vienna 2003               */
/*                          All rights reserved                               */
/*                                                                            */
/******************************************************************************/

/******************************************************************************
 *
 * PROJECT: Common functions, which are usefull for a variety of modules.
 * $Source: /cvsroot/pice/pice/module/common.h,v $
 * $Revision: 1.1 $
 * $Date: 2004/02/17 23:12:25 $
 * $Author: lightweave $
 * $Name:  $
 *
 * $Log: common.h,v $ * Revision 1.1  2004/02/17 23:12:25  lightweave * New configuration handler for reading config files. See CHANGES.txt for * details. *
 *
 *****************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the 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 _COMMON_H
#define _COMMON_H

#ifdef __KERNEL__

#define SEEK_SET       0       /* Seek from beginning of file.  */
#define SEEK_CUR       1       /* Seek from current position.  */
#define SEEK_END       2       /* Seek from end of file.  */

typedef struct file FILE;
//typedef long FILE;
#define BAD_FILE   NULL

#define fopen      filp_open
#define fclose(pf) filp_close(pf, 0)

ULONG fread(BYTE *buffer, ULONG cs, ULONG blen, FILE *pf);
ULONG fwrite(BYTE *buffer, ULONG cs, ULONG blen, FILE *pf);

BYTE toupper(UBYTE b);
int stricmp(const char *p1, const char *p2);

#endif

#ifdef __cplusplus
extern "C" {
#endif

/**
 *  Allocates and copies a string.
 */
char *StrAlloc(char *str);

LONG FindChar(BYTE *s, BYTE *p, BOOLEAN Case, BOOLEAN Find, BYTE SkipChar);
BYTE *Strip(BYTE *s, int Start);
BYTE *StrStrip(BYTE *s, int Start, char *p);

#ifdef __cplusplus
};
#endif

#endif // _PROFILE_H

⌨️ 快捷键说明

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