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; }
/* * 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; }
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); } }
/* * Makes the string empty. */ void Sempty(char *text) { if(text==0) return; Scopy(text,""); }
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; }
String Scopyof(String s) { String n=Snew(Slen(s)); Scopy(s,n); return n; }