当前位置: 首页>>代码示例>>C++>>正文


C++ VARSIZE_ANY_EXHDR函数代码示例

本文整理汇总了C++中VARSIZE_ANY_EXHDR函数的典型用法代码示例。如果您正苦于以下问题:C++ VARSIZE_ANY_EXHDR函数的具体用法?C++ VARSIZE_ANY_EXHDR怎么用?C++ VARSIZE_ANY_EXHDR使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了VARSIZE_ANY_EXHDR函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: textnlike

Datum
textnlike(PG_FUNCTION_ARGS)
{
	text	   *str = PG_GETARG_TEXT_PP(0);
	text	   *pat = PG_GETARG_TEXT_PP(1);
	bool		result;
	char	   *s,
			   *p;
	int			slen,
				plen;

	s = VARDATA_ANY(str);
	slen = VARSIZE_ANY_EXHDR(str);
	p = VARDATA_ANY(pat);
	plen = VARSIZE_ANY_EXHDR(pat);

	result = (GenericMatchText(s, slen, p, plen) != LIKE_TRUE);

	PG_RETURN_BOOL(result);
}
开发者ID:AllenDou,项目名称:postgresql,代码行数:20,代码来源:like.c

示例2: byteanlike

Datum
byteanlike(PG_FUNCTION_ARGS)
{
	bytea	   *str = PG_GETARG_BYTEA_PP(0);
	bytea	   *pat = PG_GETARG_BYTEA_PP(1);
	bool		result;
	char	   *s,
			   *p;
	int			slen,
				plen;

	s = VARDATA_ANY(str);
	slen = VARSIZE_ANY_EXHDR(str);
	p = VARDATA_ANY(pat);
	plen = VARSIZE_ANY_EXHDR(pat);

	result = (SB_MatchText(s, slen, p, plen) != LIKE_TRUE);

	PG_RETURN_BOOL(result);
}
开发者ID:adunstan,项目名称:pg-cvs-mirror,代码行数:20,代码来源:like.c

示例3: pg_file_write

Datum
pg_file_write(PG_FUNCTION_ARGS)
{
	FILE	   *f;
	char	   *filename;
	text	   *data;
	int64		count = 0;

	requireSuperuser();

	filename = convert_and_check_filename(PG_GETARG_TEXT_PP(0), false);
	data = PG_GETARG_TEXT_PP(1);

	if (!PG_GETARG_BOOL(2))
	{
		struct stat fst;

		if (stat(filename, &fst) >= 0)
			ereport(ERROR,
					(ERRCODE_DUPLICATE_FILE,
					 errmsg("file \"%s\" exists", filename)));

		f = AllocateFile(filename, "wb");
	}
	else
		f = AllocateFile(filename, "ab");

	if (!f)
		ereport(ERROR,
				(errcode_for_file_access(),
				 errmsg("could not open file \"%s\" for writing: %m",
						filename)));

	count = fwrite(VARDATA_ANY(data), 1, VARSIZE_ANY_EXHDR(data), f);
	if (count != VARSIZE_ANY_EXHDR(data) || FreeFile(f))
		ereport(ERROR,
				(errcode_for_file_access(),
				 errmsg("could not write file \"%s\": %m", filename)));

	PG_RETURN_INT64(count);
}
开发者ID:AmiGanguli,项目名称:postgres,代码行数:41,代码来源:adminpack.c

示例4: plvdate_unset_nonbizday_dow

Datum
plvdate_unset_nonbizday_dow (PG_FUNCTION_ARGS)
{
	text *day_txt = PG_GETARG_TEXT_PP(0);

	int d = ora_seq_search(VARDATA_ANY(day_txt), ora_days, VARSIZE_ANY_EXHDR(day_txt));
	CHECK_SEQ_SEARCH(d, "DAY/Day/day");

	nonbizdays = (nonbizdays | (1 << d)) ^ (1 << d);

	PG_RETURN_VOID();
}
开发者ID:KinoSun,项目名称:orafce,代码行数:12,代码来源:plvdate.c

示例5: similarity

Datum
similarity(PG_FUNCTION_ARGS)
{
	text	   *in1 = PG_GETARG_TEXT_PP(0);
	text	   *in2 = PG_GETARG_TEXT_PP(1);
	TRGM	   *trg1,
			   *trg2;
	float4		res;

	trg1 = generate_trgm(VARDATA_ANY(in1), VARSIZE_ANY_EXHDR(in1));
	trg2 = generate_trgm(VARDATA_ANY(in2), VARSIZE_ANY_EXHDR(in2));

	res = cnt_sml(trg1, trg2, false);

	pfree(trg1);
	pfree(trg2);
	PG_FREE_IF_COPY(in1, 0);
	PG_FREE_IF_COPY(in2, 1);

	PG_RETURN_FLOAT4(res);
}
开发者ID:RingsC,项目名称:postgres,代码行数:21,代码来源:trgm_op.c

示例6: dbms_output_next

static text *
dbms_output_next(void)
{
	if (buffer_get < buffer_len)
	{
		text *line = cstring_to_text(buffer + buffer_get);
		buffer_get += VARSIZE_ANY_EXHDR(line) + 1;
		return line;
	}
	else
		return NULL;
}
开发者ID:50wu,项目名称:gpdb,代码行数:12,代码来源:putline.c

示例7: pg_logical_emit_message_bytea

/*
 * SQL function for writing logical decoding message into WAL.
 */
Datum
pg_logical_emit_message_bytea(PG_FUNCTION_ARGS)
{
	bool		transactional = PG_GETARG_BOOL(0);
	char	   *prefix = text_to_cstring(PG_GETARG_TEXT_PP(1));
	bytea	   *data = PG_GETARG_BYTEA_PP(2);
	XLogRecPtr	lsn;

	lsn = LogLogicalMessage(prefix, VARDATA_ANY(data), VARSIZE_ANY_EXHDR(data),
							transactional);
	PG_RETURN_LSN(lsn);
}
开发者ID:RingsC,项目名称:postgres,代码行数:15,代码来源:logicalfuncs.c

示例8: texticregexne

Datum
texticregexne(PG_FUNCTION_ARGS)
{
	text	   *s = PG_GETARG_TEXT_PP(0);
	text	   *p = PG_GETARG_TEXT_PP(1);

	PG_RETURN_BOOL(!RE_compile_and_execute(p,
										   VARDATA_ANY(s),
										   VARSIZE_ANY_EXHDR(s),
										   regex_flavor | REG_ICASE,
										   0, NULL));
}
开发者ID:KMU-embedded,项目名称:mosbench-ext,代码行数:12,代码来源:regexp.c

示例9: be_lowrite

Datum
be_lowrite(PG_FUNCTION_ARGS)
{
	int32		fd = PG_GETARG_INT32(0);
	bytea	   *wbuf = PG_GETARG_BYTEA_PP(1);
	int			bytestowrite;
	int			totalwritten;

	bytestowrite = VARSIZE_ANY_EXHDR(wbuf);
	totalwritten = lo_write(fd, VARDATA_ANY(wbuf), bytestowrite);
	PG_RETURN_INT32(totalwritten);
}
开发者ID:eubide,项目名称:postgres,代码行数:12,代码来源:be-fsstubs.c

示例10: rtrim1

Datum
rtrim1(PG_FUNCTION_ARGS)
{
	text	   *string = PG_GETARG_TEXT_PP(0);
	text	   *ret;

	ret = dotrim(VARDATA_ANY(string), VARSIZE_ANY_EXHDR(string),
				 " ", 1,
				 false, true);

	PG_RETURN_TEXT_P(ret);
}
开发者ID:42penguins,项目名称:postgres,代码行数:12,代码来源:oracle_compat.c

示例11: hstore_defined

Datum
hstore_defined(PG_FUNCTION_ARGS)
{
    HStore	   *hs = PG_GETARG_HS(0);
    text	   *key = PG_GETARG_TEXT_PP(1);
    HEntry	   *entries = ARRPTR(hs);
    int			idx = hstoreFindKey(hs, NULL,
                                    VARDATA_ANY(key), VARSIZE_ANY_EXHDR(key));
    bool		res = (idx >= 0 && !HS_VALISNULL(entries, idx));

    PG_RETURN_BOOL(res);
}
开发者ID:nathanwadhwani,项目名称:recdb-postgresql,代码行数:12,代码来源:hstore_op.c

示例12: textregexne

Datum
textregexne(PG_FUNCTION_ARGS)
{
	text	   *s = PG_GETARG_TEXT_PP(0);
	text	   *p = PG_GETARG_TEXT_PP(1);

	PG_RETURN_BOOL(!RE_compile_and_execute(p,
										   VARDATA_ANY(s),
										   VARSIZE_ANY_EXHDR(s),
										   REG_ADVANCED,
										   0, NULL));
}
开发者ID:Joe-xXx,项目名称:postgres-old-soon-decommissioned,代码行数:12,代码来源:regexp.c

示例13: dbms_random_seed_varchar

/*
 * Atention! 
 *
 * Hash function should be changed between mayor pg versions,
 * don't use text based seed for regres tests!
 */
Datum
dbms_random_seed_varchar(PG_FUNCTION_ARGS)
{
	text *key = PG_GETARG_TEXT_P(0);
	Datum seed;
	
	seed = hash_any((unsigned char *) VARDATA_ANY(key), VARSIZE_ANY_EXHDR(key));
	
	srand((int) seed);
					    
	PG_RETURN_VOID();
}
开发者ID:50wu,项目名称:gpdb,代码行数:18,代码来源:random.c

示例14: levenshtein_less_equal

Datum
levenshtein_less_equal(PG_FUNCTION_ARGS)
{
	text	   *src = PG_GETARG_TEXT_PP(0);
	text	   *dst = PG_GETARG_TEXT_PP(1);
	int			max_d = PG_GETARG_INT32(2);
	const char *s_data;
	const char *t_data;
	int			s_bytes,
				t_bytes;

	/* Extract a pointer to the actual character data */
	s_data = VARDATA_ANY(src);
	t_data = VARDATA_ANY(dst);
	/* Determine length of each string in bytes and characters */
	s_bytes = VARSIZE_ANY_EXHDR(src);
	t_bytes = VARSIZE_ANY_EXHDR(dst);

	PG_RETURN_INT32(varstr_levenshtein_less_equal(s_data, s_bytes, t_data,
												  t_bytes, 1, 1, 1, max_d));
}
开发者ID:JiannengSun,项目名称:postgres,代码行数:21,代码来源:fuzzystrmatch.c

示例15: plvstr_rstrip

Datum
plvstr_rstrip (PG_FUNCTION_ARGS)
{
	text *str = PG_GETARG_TEXT_PP(0);
	text *pat = PG_GETARG_TEXT_PP(1);
	int num = PG_GETARG_INT32(2);
	int count = 0;
	int len_p, len_s, i;

	char *str_p, *aux_str_p, *pat_p;
	len_p = VARSIZE_ANY_EXHDR(pat);
	len_s = VARSIZE_ANY_EXHDR(str);

	str_p = VARDATA_ANY(str) + len_s - 1;

	while (count < num)
	{
		pat_p = VARDATA_ANY(pat) + len_p - 1;
		aux_str_p = str_p;

		if (len_s < len_p)
			break;

		for (i = 0; i < len_p; i++)
			if (*aux_str_p-- != *pat_p--)
				break;

		if (i >= len_p)
		{
			count++;
			/* found */
			str_p = aux_str_p;
			len_s -= len_p;
			continue;
		}
		break;
	}

	PG_RETURN_TEXT_P(cstring_to_text_with_len(VARDATA_ANY(str),len_s));
}
开发者ID:protodef,项目名称:orafce,代码行数:40,代码来源:plvstr.c


注:本文中的VARSIZE_ANY_EXHDR函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。