strmatch.h

来自「求2个或多个文本间的公共子串」· C头文件 代码 · 共 54 行

H
54
字号
#include <unistd.h>#include <sys/stat.h>#include <sys/types.h>#include <errno.h>#include <fcntl.h>#include <malloc.h>#include <stdlib.h>#include <stdio.h>#include <string.h>#include "publib.h"#ifndef NULL#define NULL (void *)0#endif#ifndef min#define min(x, y) ((x > y)? y:x)#endif#ifndef max#define max(x, y) ((x > y)? x:y)#endif#ifndef _STRMATCH_HEADER_#define _STRMATCH_HEADER_typedef struct StrNode{	smch_t * pSmch;         /* the begin address */	size_t uiBegPos;        /* the begin pos for the common string in the shortest string */	size_t uiSmchLen;       /* smch_t */}StrNode;typedef struct StrList{	StrNode * pNodeArray;	size_t memLen;	size_t memUse;}StrList;/*extract all same substringsinput:	strOne: the first string address	nOneLen: the first string's length	strTwo: the second string address	nTwoLen: the second string's length	nItv: the minimun element sizeoutput: 0 successful; or -1 indicates failure **********/int strmatch(smch_t * strLong, const size_t nLongLen, smch_t * strShort,const size_t offset, const size_t nShortLen, StrList * pStrList, const size_t listSize);#endif

⌨️ 快捷键说明

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