Ejemplo n.º 1
0
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;
}
Ejemplo n.º 2
0
/*
 * 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;
}
Ejemplo n.º 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);
	}
}
Ejemplo n.º 4
0
/*
 * Makes the string empty.
 */
void Sempty(char *text)
{
    if(text==0) return;

    Scopy(text,"");
}
Ejemplo n.º 5
0
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;
}
Ejemplo n.º 6
0
String Scopyof(String s) {
	String n=Snew(Slen(s));
	Scopy(s,n);
	return n;
}