• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ FreeStrBuf函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: TestEncodeEmail

static void TestEncodeEmail(void)
{
	StrBuf *Target;
	StrBuf *Source;
	StrBuf *UserName = NewStrBuf();
	StrBuf *EmailAddress = NewStrBuf();
	StrBuf *EncBuf = NewStrBuf();
	
	Source = NewStrBuf();
 
// 	Source = NewStrBufPlain(HKEY("Art Cancro <[email protected]>, Art Cancro <[email protected]>"));

	Source = NewStrBufPlain(HKEY("\"Alexandra Weiz, Restless GmbH\" <[email protected]>, \"NetIN\" <[email protected]>, \" יריב ברקאי, מולטימדי\" <[email protected]>"));	
	Target = StrBufSanitizeEmailRecipientVector(
		Source,
		UserName, 
		EmailAddress,
		EncBuf
		);		
	
	TestRevalidateStrBuf(Target);
	printf("the source:>%s<\n", ChrPtr(Source));
	printf("the target:>%s<\n", ChrPtr(Target));
	FreeStrBuf(&Target);
	FreeStrBuf(&UserName);
	FreeStrBuf(&EmailAddress);
	FreeStrBuf(&EncBuf);

	FreeStrBuf(&Source);
}
开发者ID:mingodad,项目名称:citadel,代码行数:30,代码来源:stringbuf_conversion.c


示例2: TestRFC822DecodeStdin

static void TestRFC822DecodeStdin(void)
{
	int fdin = 0;// STDIN
	const char *Err;
	StrBuf *Target;
	StrBuf *Source;
	StrBuf *DefaultCharset;
	StrBuf *FoundCharset;
	
	DefaultCharset = NewStrBufPlain(HKEY("iso-8859-1"));
	FoundCharset = NewStrBuf();
	Source = NewStrBuf();

	while (fdin == 0) {

		StrBufTCP_read_line(Source, &fdin, 0, &Err);
		Target = NewStrBuf();
		
		StrBuf_RFC822_to_Utf8(Target, Source, DefaultCharset, FoundCharset);
		
		TestRevalidateStrBuf(Target);
		printf("the ugly multi:>%s<\n", ChrPtr(Target));
		FreeStrBuf(&Target);
	}
	FreeStrBuf(&Source);
	FreeStrBuf(&FoundCharset);
	FreeStrBuf(&DefaultCharset);
}
开发者ID:mingodad,项目名称:citadel,代码行数:28,代码来源:stringbuf_conversion.c


示例3: StrBufRFC2047encodeMessageStdin

static void StrBufRFC2047encodeMessageStdin(void)
{
	int fdin = 0;// STDIN
	const char *Err;
	StrBuf *Target;
	StrBuf *Source;
	StrBuf *Src;

	Source = NewStrBuf();
	Src = NewStrBuf();

	printf("[");
	while (fdin == 0) {

		StrBufTCP_read_line(Source, &fdin, 0, &Err);
		StrBufAppendBuf(Src, Source, 0);
		StrBufAppendBufPlain(Src, HKEY("\n"), 0);
				
	}

	Target = StrBufRFC2047encodeMessage(Src);

	printf("Target: \n%s\n", ChrPtr(Target));
	FreeStrBuf(&Source);
	FreeStrBuf(&Src);
	FreeStrBuf(&Target);
}
开发者ID:mingodad,项目名称:citadel,代码行数:27,代码来源:stringbuf_conversion.c


示例4: TestEncodeEmailSTDIN

static void TestEncodeEmailSTDIN(void)
{
	int fdin = 0;// STDIN
	const char *Err;
	StrBuf *Target;
	StrBuf *Source;
	StrBuf *UserName = NewStrBuf();
	StrBuf *EmailAddress = NewStrBuf();
	StrBuf *EncBuf = NewStrBuf();
	
	Source = NewStrBuf();

	while (fdin == 0) {

		StrBufTCP_read_line(Source, &fdin, 0, &Err);
		printf("the source:>%s<\n", ChrPtr(Source));
		Target = StrBufSanitizeEmailRecipientVector(
			Source,
			UserName, 
			EmailAddress,
			EncBuf
			);
		
		TestRevalidateStrBuf(Target);
		printf("the target:>%s<\n", ChrPtr(Target));
		FreeStrBuf(&Target);
	}
	FreeStrBuf(&UserName);
	FreeStrBuf(&EmailAddress);
	FreeStrBuf(&EncBuf);

	FreeStrBuf(&Source);
}
开发者ID:mingodad,项目名称:citadel,代码行数:33,代码来源:stringbuf_conversion.c


示例5: DeleteWebcitHandler

void DeleteWebcitHandler(void *vHandler)
{
	WebcitHandler *Handler = (WebcitHandler*) vHandler;
	FreeStrBuf(&Handler->Name);
	FreeStrBuf(&Handler->DisplayName);
	free (Handler);
}
开发者ID:henri14,项目名称:citadel,代码行数:7,代码来源:webcit.c


示例6: JournalBackgroundSubmit

/*
 * Hand off a copy of a message to be journalized.
 */
void JournalBackgroundSubmit(struct CtdlMessage *msg,
			StrBuf *saved_rfc822_version,
			recptypes *recps) {

	struct jnlq *jptr = NULL;

	/* Avoid double journaling! */
	if (!CM_IsEmpty(msg, eJournal)) {
		FreeStrBuf(&saved_rfc822_version);
		return;
	}

	jptr = (struct jnlq *)malloc(sizeof(struct jnlq));
	if (jptr == NULL) {
		FreeStrBuf(&saved_rfc822_version);
		return;
	}
	memset(jptr, 0, sizeof(struct jnlq));
	if (recps != NULL) memcpy(&jptr->recps, recps, sizeof(recptypes));
	if (!CM_IsEmpty(msg, eAuthor)) jptr->from = strdup(msg->cm_fields[eAuthor]);
	if (!CM_IsEmpty(msg, eNodeName)) jptr->node = strdup(msg->cm_fields[eNodeName]);
	if (!CM_IsEmpty(msg, erFc822Addr)) jptr->rfca = strdup(msg->cm_fields[erFc822Addr]);
	if (!CM_IsEmpty(msg, eMsgSubject)) jptr->subj = strdup(msg->cm_fields[eMsgSubject]);
	if (!CM_IsEmpty(msg, emessageId)) jptr->msgn = strdup(msg->cm_fields[emessageId]);
	jptr->rfc822 = SmashStrBuf(&saved_rfc822_version);

	/* Add to the queue */
	begin_critical_section(S_JOURNAL_QUEUE);
	jptr->next = jnlq;
	jnlq = jptr;
	end_critical_section(S_JOURNAL_QUEUE);
}
开发者ID:henri14,项目名称:citadel,代码行数:35,代码来源:journaling.c


示例7: HfreeFetchItem

void HfreeFetchItem(void *vItem)
{
	FetchItem *Item = (FetchItem*) vItem;
	FreeStrBuf(&Item->MsgUIDL);
	FreeStrBuf(&Item->MsgUID);
	free(Item);
}
开发者ID:henri14,项目名称:citadel,代码行数:7,代码来源:serv_pop3client.c


示例8: main

int main(int argc, char* argv[])
{
	StrBuf *WFBuf;
	StrBuf *OutBuf;
	StrBuf *Info;
	int nWildfireHeaders = 0;

	StartLibCitadel(8);
	printf("%s == %d?\n", libcitadel_version_string(), libcitadel_version_number());
       
	
	WildFireInitBacktrace(argv[0], 0);

	WFBuf = NewStrBuf();
	OutBuf = NewStrBuf();
	Info = NewStrBufPlain(HKEY("this is just a test message"));
	SerializeJson(WFBuf, WildFireException(HKEY(__FILE__), __LINE__, Info, 1), 1);
	SerializeJson(WFBuf, WildFireException(HKEY(__FILE__), __LINE__, Info, 1), 1);
	SerializeJson(WFBuf, WildFireException(HKEY(__FILE__), __LINE__, Info, 1), 1);
	SerializeJson(WFBuf, WildFireException(HKEY(__FILE__), __LINE__, Info, 1), 1);
	SerializeJson(WFBuf, WildFireException(HKEY(__FILE__), __LINE__, Info, 1), 1);
	SerializeJson(WFBuf, WildFireException(HKEY(__FILE__), __LINE__, Info, 1), 1);
	SerializeJson(WFBuf, WildFireException(HKEY(__FILE__), __LINE__, Info, 1), 1);
	
	WildFireSerializePayload(WFBuf, OutBuf, &nWildfireHeaders, NULL);

	CreateWildfireSampleMessage(OutBuf);
	printf("%s\n\n", ChrPtr(OutBuf));

	FreeStrBuf(&WFBuf);
	FreeStrBuf(&OutBuf);
	FreeStrBuf(&Info);
	ShutDownLibCitadel();
	return 0;
}
开发者ID:mingodad,项目名称:citadel,代码行数:35,代码来源:wildfire_test.c


示例9: CreateWildfireSampleMessage

static void CreateWildfireSampleMessage(StrBuf *OutBuf)
{
	JsonValue *Error;
		
	StrBuf *Buf;
	StrBuf *Header;
	StrBuf *Json;
	int n = 1;

	Header = NewStrBuf();
	Json = NewStrBuf();

	Error = WildFireMessagePlain(HKEY(__FILE__), __LINE__, HKEY("Info message"), eINFO);
	SerializeJson(Json, Error, 1);
	WildFireSerializePayload(Json, Header, &n, NULL);
	StrBufAppendBuf(OutBuf, Header, 0);
	FlushStrBuf(Json);
	FlushStrBuf(Header);

	Error = WildFireMessagePlain(HKEY(__FILE__), __LINE__,  HKEY("Warn message"), eWARN);
	SerializeJson(Json, Error, 1);
	WildFireSerializePayload(Json, Header, &n, NULL);
	StrBufAppendBuf(OutBuf, Header, 0);
	FlushStrBuf(Json);
	FlushStrBuf(Header);

	Error = WildFireMessagePlain(HKEY(__FILE__), __LINE__, HKEY("Error message"), eERROR);
	SerializeJson(Json, Error, 1);
	WildFireSerializePayload(Json, Header, &n, NULL);
	StrBufAppendBuf(OutBuf, Header, 0);
	FlushStrBuf(Json);
	FlushStrBuf(Header);

	Error = WildFireMessagePlain(HKEY(__FILE__), __LINE__, HKEY("Info message"), eINFO);
	SerializeJson(Json, Error, 1);
	WildFireSerializePayload(Json, Header, &n, NULL);
	StrBufAppendBuf(OutBuf, Header, 0);
	FlushStrBuf(Json);
	FlushStrBuf(Header);

	Error = WildFireMessagePlain(HKEY(__FILE__), __LINE__, HKEY("Info message"), eINFO);
	SerializeJson(Json, Error, 1);
	WildFireSerializePayload(Json, Header, &n, NULL);
	StrBufAppendBuf(OutBuf, Header, 0);
	FlushStrBuf(Json);
	FlushStrBuf(Header);


	Buf = NewStrBufPlain(HKEY("test error message"));
	Error = WildFireException(HKEY(__FILE__), __LINE__, Buf, 1);
	SerializeJson(Json, Error, 1);
	WildFireSerializePayload(Json, Header, &n, NULL);
	StrBufAppendBuf(OutBuf, Header, 0);

	FreeStrBuf(&Buf);
	FreeStrBuf(&Json);
	FreeStrBuf(&Header);

}
开发者ID:mingodad,项目名称:citadel,代码行数:59,代码来源:wildfire_test.c


示例10: DeleteConflict

void DeleteConflict(void *vConflict)
{
	CalendarConflict *c = (CalendarConflict *) vConflict;

	FreeStrBuf(&c->conflict_event_uid);
	FreeStrBuf(&c->conflict_event_summary);
	free(c);
}
开发者ID:mingodad,项目名称:citadel,代码行数:8,代码来源:ical_subst.c


示例11: do_graphics_upload

void do_graphics_upload(char *filename)
{
	StrBuf *Line;
	const char *MimeType;
	wcsession *WCC = WC;
	int bytes_remaining;
	int pos = 0;
	int thisblock;
	bytes_remaining = WCC->upload_length;

	if (havebstr("cancel_button")) {
		AppendImportantMessage(_("Graphics upload has been cancelled."), -1);
		display_main_menu();
		return;
	}

	if (WCC->upload_length == 0) {
		AppendImportantMessage(_("You didn't upload a file."), -1);
		display_main_menu();
		return;
	}
	
	MimeType = GuessMimeType(ChrPtr(WCC->upload), bytes_remaining);
	serv_printf("UIMG 1|%s|%s", MimeType, filename);

	Line = NewStrBuf();
	StrBuf_ServGetln(Line);
	if (GetServerStatusMsg(Line, NULL, 1, 2) != 2) {
		display_main_menu();
		FreeStrBuf(&Line);
		return;
	}
	while (bytes_remaining) {
		thisblock = ((bytes_remaining > 4096) ? 4096 : bytes_remaining);
		serv_printf("WRIT %d", thisblock);
		StrBuf_ServGetln(Line);
		if (GetServerStatusMsg(Line, NULL, 1, 7) != 7) {
			serv_puts("UCLS 0");
			StrBuf_ServGetln(Line);
			display_main_menu();
			FreeStrBuf(&Line);
			return;
		}
		thisblock = extract_int(ChrPtr(Line) +4, 0);
		serv_write(&ChrPtr(WCC->upload)[pos], thisblock);
		pos += thisblock;
		bytes_remaining -= thisblock;
	}

	serv_puts("UCLS 1");
	StrBuf_ServGetln(Line);
	if (*ChrPtr(Line) != 'x') {
		display_success(ChrPtr(Line) + 4);
	
	}
	FreeStrBuf(&Line);

}
开发者ID:zcw159357,项目名称:citadel,代码行数:58,代码来源:graphics.c


示例12: DeleteNodeConf

void DeleteNodeConf(void *vNode)
{
	NodeConf *Node = (NodeConf*) vNode;
	FreeStrBuf(&Node->NodeName);
	FreeStrBuf(&Node->Secret);
	FreeStrBuf(&Node->Host);
	FreeStrBuf(&Node->Port);
	free(Node);
}
开发者ID:mingodad,项目名称:citadel,代码行数:9,代码来源:netconf.c


示例13: FreeStrBuf

void 
SessionDestroyModule_WEBCIT
(wcsession *sess)
{
	FreeStrBuf(&sess->WBuf);
	FreeStrBuf(&sess->HBuf);
	FreeStrBuf(&sess->ImportantMsg);
	FreeStrBuf(&sess->PushedDestination);
}
开发者ID:henri14,项目名称:citadel,代码行数:9,代码来源:webcit.c


示例14: memset

OneQueItem *DeserializeQueueItem(StrBuf *RawQItem, long QueMsgID)
{
	OneQueItem *Item;
	const char *pLine = NULL;
	StrBuf *Line;
	StrBuf *Token;
	void *v;

	Item = (OneQueItem*)malloc(sizeof(OneQueItem));
	memset(Item, 0, sizeof(OneQueItem));
	Item->Retry = SMTP_RETRY_INTERVAL;
	Item->MessageID = -1;
	Item->QueMsgID = QueMsgID;

	Token = NewStrBuf();
	Line = NewStrBufPlain(NULL, 128);
	while (pLine != StrBufNOTNULL) {
		const char *pItemPart = NULL;
		void *vHandler;

		StrBufExtract_NextToken(Line, RawQItem, &pLine, '\n');
		if (StrLength(Line) == 0) continue;
		StrBufExtract_NextToken(Token, Line, &pItemPart, '|');
		if (GetHash(QItemHandlers, SKEY(Token), &vHandler))
		{
			QItemHandlerStruct *HS;
			HS = (QItemHandlerStruct*) vHandler;
			HS->H(Item, Line, &pItemPart);
		}
	}
	FreeStrBuf(&Line);
	FreeStrBuf(&Token);

	if (Item->Retry >= MaxRetry)
		Item->FailNow = 1;

	pthread_mutex_lock(&ActiveQItemsLock);
	if (GetHash(ActiveQItems,
		    LKEY(Item->MessageID),
		    &v))
	{
		/* WHOOPS. somebody else is already working on this. */
		pthread_mutex_unlock(&ActiveQItemsLock);
		FreeQueItem(&Item);
		return NULL;
	}
	else {
		/* mark our claim on this. */
		Put(ActiveQItems,
		    LKEY(Item->MessageID),
		    Item,
		    HFreeQueItem);
		pthread_mutex_unlock(&ActiveQItemsLock);
	}

	return Item;
}
开发者ID:mingodad,项目名称:citadel,代码行数:57,代码来源:serv_smtpqueue.c


示例15: Free_ctdl_openid

void Free_ctdl_openid(ctdl_openid **FreeMe)
{
	if (*FreeMe == NULL) {
		return;
	}
	FreeStrBuf(&(*FreeMe)->op_url);
	FreeStrBuf(&(*FreeMe)->claimed_id);
	DeleteHash(&(*FreeMe)->sreg_keys);
	free(*FreeMe);
	*FreeMe = NULL;
}
开发者ID:mingodad,项目名称:citadel,代码行数:11,代码来源:serv_openid_rp.c


示例16: FreeStrBuf

void 
HttpDestroyModule_CONTEXT
(ParsedHttpHdrs *httpreq)
{
	FreeStrBuf(&httpreq->this_page);
	FreeStrBuf(&httpreq->PlainArgs);
	FreeStrBuf(&httpreq->this_page);
	FreeStrBuf(&httpreq->PlainArgs);
	FreeStrBuf(&httpreq->HostHeader);
	DeleteHash(&httpreq->HTTPHeaders);

}
开发者ID:henri14,项目名称:citadel,代码行数:12,代码来源:context_loop.c


示例17: FreeMailQEntry

void FreeMailQEntry(void *qv)
{
	MailQEntry *Q = qv;
/*
	SMTPC_syslog(LOG_DEBUG, "---------------%s--------------", __FUNCTION__);
	cit_backtrace();
*/
	FreeStrBuf(&Q->Recipient);
	FreeStrBuf(&Q->StatusMessage);
	FreeStrBuf(&Q->AllStatusMessages);
	memset(Q, 0, sizeof(MailQEntry));
	free(Q);
}
开发者ID:mingodad,项目名称:citadel,代码行数:13,代码来源:serv_smtpqueue.c


示例18: FreeQueItem

void FreeQueItem(OneQueItem **Item)
{
/*
	SMTPC_syslog(LOG_DEBUG, "---------------%s--------------", __FUNCTION__);
	cit_backtrace();
*/
	DeleteHash(&(*Item)->MailQEntries);
	FreeStrBuf(&(*Item)->EnvelopeFrom);
	FreeStrBuf(&(*Item)->BounceTo);
	FreeStrBuf(&(*Item)->SenderRoom);
	FreeURL(&(*Item)->URL);
	memset(*Item, 0, sizeof(OneQueItem));
	free(*Item);
	Item = NULL;
}
开发者ID:mingodad,项目名称:citadel,代码行数:15,代码来源:serv_smtpqueue.c


示例19: DestroyHttpHeaderHandler

void DestroyHttpHeaderHandler(void *V)
{
	OneHttpHeader *pHdr;
	pHdr = (OneHttpHeader*) V;
	FreeStrBuf(&pHdr->Val);
	free(pHdr);
}
开发者ID:henri14,项目名称:citadel,代码行数:7,代码来源:context_loop.c


示例20: xmpp_store_mortuary

/*
 * Fetch the "mortuary" - a list of dead buddies which we keep around forever
 * so we can remove them from any client's roster that still has them listed
 */
void xmpp_store_mortuary(HashList *mortuary) {
	HashPos *HashPos;
	long len;
	void *Value;
	const char *Key;
	StrBuf *themsg;

	themsg = NewStrBuf();
	StrBufPrintf(themsg,	"Content-type: " XMPPMORTUARY "\n"
				"Content-transfer-encoding: 7bit\n"
				"\n"
	);

	HashPos = GetNewHashPos(mortuary, 0);
	while (GetNextHashPos(mortuary, HashPos, &len, &Key, &Value) != 0)
	{
		StrBufAppendPrintf(themsg, "%s\n", (char *)Value);
	}
	DeleteHashPos(&HashPos);

	/* Delete the old mortuary */
	CtdlDeleteMessages(USERCONFIGROOM, NULL, 0, XMPPMORTUARY);

	/* And save the new one to disk */
	quickie_message("Citadel", NULL, NULL, USERCONFIGROOM, ChrPtr(themsg), 4, "XMPP Mortuary");
	FreeStrBuf(&themsg);
}
开发者ID:henri14,项目名称:citadel,代码行数:31,代码来源:xmpp_presence.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ FreeString函数代码示例发布时间:2022-05-30
下一篇:
C++ FreeSid函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap