示例#1
0
文件: strings.c 项目: 10crimes/code
bool Sdoremove(String x,String s) {
	int i=Sinstr(x,s);
	if (i==0)
		return false;
	Scopy(Sfrom(x,i+Slen(s)),&x[i-1]);
	return true;
}
示例#2
0
文件: smatch.c 项目: KHATEEBNSIT/AP
/*
 * Creates and copies an existing string.
 */
char *Sduplicate(char *source)
{
    char *result = 0;

    if( source != 0 )
    {
	result = (char *)Hallocate(strlen(source) + 1);
	if( result != 0 )
        {
	    Scopy(result, source);
        }
    }
    return result;
}
示例#3
0
static void ErrorList(struct _Error *mptr)
{
	char full[MBUFFER];
    char eol[20];
	int length;
	int type;

	if(mptr!=0)
	{
		//
		// suppress end of line if alraedy included in the message
		//
		Scopy(eol,"\n");
		length=Slength(mptr->format);
		if(mptr->format[length-1]=='\n')
		{
			eol[0]=0;
		}
        type=mptr->type&0xff;
		SformatOutput(full,MBUFFER-1,"%04d %s %s%s",mptr->code,ErrorTypePrint(type),mptr->format,eol);
		full[MBUFFER-1]=0;
		UserPrintIt(full);
	}
}
示例#4
0
文件: smatch.c 项目: KHATEEBNSIT/AP
/*
 * Makes the string empty.
 */
void Sempty(char *text)
{
    if(text==0) return;

    Scopy(text,"");
}
示例#5
0
文件: stringsa.c 项目: 10crimes/code
String Srepeat(String s,int x) {
  String n=Snew(x*Slen(s));
  for (int i=0;i<x;i++)
  Scopy(s,&n[i*Slen(s)]);
  return n;
}
示例#6
0
文件: strings.c 项目: 10crimes/code
String Scopyof(String s) {
	String n=Snew(Slen(s));
	Scopy(s,n);
	return n;
}