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

📄 chop.cpp

📁 用linux开发的安防暴警的有关代码
💻 CPP
字号:
//===============================================================================// POSTOFFICE - X11 Office Communication Handler// ---------------------------------------------// All sourcecode, unless differently annotated, written by Pim van Riezen// Sourcecode and resulting binaries are covered by the GNU Lesser General Public// License (GNU LGPL). For more information and the literal text of the license// agreement, check the Free Software Foundation's website on http://www.fsf.org///// Copyright (C) 1999 Mad Sciene Labs - Rotterdam, The Netherlands//===============================================================================#include "chop.h"#include <string.h>#include <stdio.h>extern "C" {	#include <ctype.h>}//===============================================================================// FUNCTION		choplf// SYNOPSIS		Removes redundant linefeed information from a string.//// ARGUMENTS	string		(char *)	The string to be altered//// RETURNS		No return values, direct data manipulation is used.//===============================================================================void choplf (char *str){	int ln = strlen (str);	while ( (ln>0) && ((str[ln-1] =='\r')||(str[ln-1] =='\n')) ) str[--ln] = 0;}//===============================================================================// FUNCTION		chopwhitespace// SYNOPSIS		Removes redundant trailing and leading whitespace from a string.//// ARGUMENTS	string		(char *)	The string to be altered//// RETURNS		No return values, direct data manipulation is used.//===============================================================================void chopwhitespace (char *str){	int ln = strlen (str);	while ( (ln>0) && ( (str[ln]==' ') ) ) str[--ln] = 0;	while ((str[0] == ' ')||(str[0] == '\t'))	{		memmove (str,str+1,(size_t) strlen(str));	}}//===============================================================================// FUNCTION		chopquote// SYNOPSIS		clean double quoted mard.//// ARGUMENTS	string		(char *)	The original string.//// RETURNS		void////===============================================================================void chopquote (char *str){	char *work_pointer=new char [strlen(str)+2];	int src_crsr = 0;	int dst_crsr = 0;	for (; src_crsr<(int)strlen(str);src_crsr++)	{		if (str[src_crsr]!='\"')			{				work_pointer[dst_crsr++]=str[src_crsr];			}	}	work_pointer[dst_crsr] = 0;	strcpy(str,work_pointer);	str[dst_crsr]=0;	delete[] work_pointer;}

⌨️ 快捷键说明

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