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

📄 dict_snowball.c.in

📁 PostgreSQL 8.1.4的源码 适用于Linux下的开源数据库系统
💻 IN
字号:
/*  * example of Snowball dictionary * http://snowball.tartarus.org/  * Teodor Sigaev <teodor@sigaev.ru> */#include <stdlib.h>#include <string.h>#include "postgres.h"#include "dict.h"#include "common.h"#include "snowball/header.h"#include "subinclude.h"typedef struct {	struct SN_env *z;	StopList	stoplist;	int	(*stem)(struct SN_env * z);} DictSnowball;PG_FUNCTION_INFO_V1(dinit_CFG_MODNAME);Datum dinit_CFG_MODNAME(PG_FUNCTION_ARGS);Datum dinit_CFG_MODNAME(PG_FUNCTION_ARGS) {	DictSnowball	*d = (DictSnowball*)malloc( sizeof(DictSnowball) );	if ( !d )		ereport(ERROR,				(errcode(ERRCODE_OUT_OF_MEMORY),				 errmsg("out of memory")));	memset(d,0,sizeof(DictSnowball));	d->stoplist.wordop=lowerstr;			if ( !PG_ARGISNULL(0) && PG_GETARG_POINTER(0)!=NULL ) {		text       *in = PG_GETARG_TEXT_P(0);		readstoplist(in, &(d->stoplist));		sortstoplist(&(d->stoplist));		PG_FREE_IF_COPY(in, 0);	}	d->z = CFG_PREFIX_create_env();	if (!d->z) {		freestoplist(&(d->stoplist));		ereport(ERROR,				(errcode(ERRCODE_OUT_OF_MEMORY),				 errmsg("out of memory")));	}	d->stem=CFG_PREFIX_stem;	PG_RETURN_POINTER(d);}

⌨️ 快捷键说明

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