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

📄 clean.c

📁 在linux下的聊天软件
💻 C
字号:
/*
  clean.c
  
  For Free Chat
  
  By Bill Kendrick, ported to NT by Patrick Stepp
  kendrick@zippy.sonoma.edu, stepp@adelphia.net
  http://zippy.sonoma.edu/kendrick/
  
  September 29, 1996 - June 10, 1997
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "clean.h"
#include "defines.h"


void clean(char * str)
{
  char newstr[STRLEN], temp[10];
  int i, l;
  int c;
  
  strcpy(newstr, "");
  
  for (i = 0; i < strlen(str); i++)
    {
      c = str[i];
      
      if ((c < 32 || c > 127) && INTERNATIONAL == NO)
	c = ' ';
    
      if (c == '<')
	strcat(newstr, "&lt;");
      else if (c == '>')
	strcat(newstr, "&gt;");
      else if (c == '&')
	strcat(newstr, "&amp;");
      else
	{
	  sprintf(temp, "%c", c);
	  strcat(newstr, temp);
	}
    }
  
  while (isspace(newstr[0]))
    {
      strcpy(str, newstr + 1);
      strcpy(newstr, str);
    }
  
  while (isspace(newstr[strlen(newstr) - 1]))
    newstr[strlen(newstr) - 1] = '\0';
  
  strcpy(str, newstr);
}

⌨️ 快捷键说明

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