int lpm_preset (char *host, char *prog, int wait) { LpmPset arg; setstring (arg.name, prog); setstring (arg.host, host); arg.wait = wait; lpm_call_int (LPMPRESET); }
int lpm_sendmsg (char *host, int pid, char *mesg) { LpmMsg arg; setstring (arg.mesg, mesg); setstring (arg.host, host); arg.pid = pid; lpm_call_int (LPMSENDMSG); }
int lpm_pque (int pri, char *prog, char *msg) { LpmQue arg; setstring (arg.name, prog); setstring (arg.mesg, msg); arg.pid = getmypid (); arg.pri = pri; lpm_call_int (LPMQUE); }
/*FUNCTION*/ LVAL c_newnode(tpLspObject pLSP, unsigned char type ){ /*noverbatim CUT*/ LVAL p; if( null((p = getnode())) ) return NIL; settype(p,type); switch( type ) { case NTYPE_CON: return NULL; case NTYPE_FLO: setfloat(p,0.0); break; case NTYPE_INT: setint(p,0); break; case NTYPE_STR: setstring(p,NULL); break; case NTYPE_SYM: setsymbol(p,NULL); break; case NTYPE_CHR: setchar(p,(char)0); break; default: return NULL; } return p; }
LpmKeys *lpm_getkeys (char *host) { xhost arg; setstring (arg, host); lpm_call_agg (LPMGETKEYS, LpmKeys); }
QUEUE *lpm_getmsgq (char *host) { xhost arg; setstring (arg, host); lpm_call_agg (LPMGETMSGQ, QUEUE); }
QUEUE *lpm_gethostq (char *host) { xhost arg; setstring (arg, host); lpm_call_agg (LPMGETHOSTQ, QUEUE); }
QUEUE *lpm_getpidq (char *host) { xhost arg; setstring (arg, host); lpm_call_agg (LPMGETPIDQ, QUEUE); }
QUEUE *lpm_getreqq (char *host) { xhost arg; setstring (arg, host); lpm_call_agg (LPMGETREQQ, QUEUE); }
int lpm_checkpid (char *host, int pid) { LpmCkpid arg; setstring (arg.host, host); arg.pid = pid; lpm_call_int (LPMCHECKPID); }
inline Container(char *s) { _vtype = LX_TYPE_STRING; setstring(s, strlen(s)); printf("implicit length: %u\n", val.lxs.len); }
inline Container(Sbuf &s) { _vtype = LX_TYPE_STRING; setstring(s.p, s.l); }
/* * local function to read an expression */ static LVAL _readexpr(tpLspObject pLSP,FILE *f) { int ch,ch1,ch2,i; LVAL p; char *s; double dval; long lval; spaceat(ch,f); if( ch == EOF ) { return NIL; } if( ch == pLSP->cClose ) { return NIL; } if( ch == pLSP->cOpen )/* Read a cons node. */ return readcons(pLSP,f); /**** Note: XLISP allows 1E++10 as a symbol. This is dangerous. We do not change XLISP (so far), but here I exclude all symbol names starting with numeral. */ if( const_p1(ch) )/* Read a symbol. */ { for( i = 0 ; const_p(ch) ; i++ ){ if( storech(pLSP,i,ch) )return NIL; ch = getC(pLSP,f); } UNGETC(ch); /* Recognize NIL and nil symbols. */ if( !strcmp(BUFFER,"NIL") || !strcmp(BUFFER,"nil") ) return NIL; p = newsymbol(); s = StrDup( BUFFER ); if( null(p) || s == NULL )return NIL; setsymbol(p,s); return p; } if( ch == '\"' ){ ch = GETC(f); storech(pLSP,0,0); /* inititalize the buffer */ if( ch != '\"' )goto SimpleString; ch = GETC(f); if( ch != '\"' ){ UNGETC(ch); ch = '\"';/* ch should hold the first character of the string that is " now */ goto SimpleString; } ch = GETC(f); /* multi line string */ for( i = 0 ; ch != EOF ; i++ ){ if( ch == '\"' ){ ch1 = GETC(f); ch2 = GETC(f); if( ch1 == '\"' && ch2 == '\"' )break; UNGETC(ch2); UNGETC(ch1); } if( ch == '\\' ){ ch = GETC(f); s = escapers; while( *s ){ if( *s++ == ch ){ ch = *s; break; } if( *s )s++; } } if( storech(pLSP,i,ch) )return NIL; ch = GETC(f); } p = newstring(); s = StrDup( BUFFER ); if( null(p) || s == NULL )return NIL; setstring(p,s); return p; } if( ch == '\"' ){/* Read a string. */ ch = GETC(f);/* Eat the " character. */ SimpleString: for( i = 0 ; ch != '\"' && ch != EOF ; i++ ){ if( ch == '\\' ){ ch = GETC(f); s = escapers; while( *s ){ if( *s++ == ch ){ ch = *s; break; } if( *s )s++; } } if( ch == '\n' )return NIL; if( storech(pLSP,i,ch) )return NIL; ch = GETC(f); } p = newstring(); s = StrDup( BUFFER ); if( null(p) || s == NULL ) { return NIL; } setstring(p,s); return p; } if( numeral1(ch) ) { for( i = 0 ; isinset(ch,"0123456789+-eE.") ; i++ ) { if( storech(pLSP,i,ch) )return NIL; ch = getC(pLSP,f); } UNGETC(ch); cnumeric(BUFFER,&i,&dval,&lval); switch( i ) { case 0: return NIL; case 1: /* A float number is coming. */ p = newfloat(); if( null(p) ) { return NIL; } setfloat(p,dval); return p; case 2: /* An integer is coming. */ p = newint(); if( null(p) ) { return NIL; } setint(p,lval); return p; default: return NIL; } } return NIL; }
inline Container(const char *s, unsigned long len) { _vtype = LX_TYPE_STRING; setstring(s, len); printf("explicit length: %lu\n", len); }
Line * inlist(FILE *fp) { int c,i; char *s; Point p; Line *l=0; while (1) { c=fgetc(fp); switch (c) { case '\n': break; default: do c = fgetc(fp); while (c != '\n'); break; case 'w': case 'l': l = newline(inpoint(fp),l); l->Q = inpoint(fp); break; case 'b': l = newbox(inpoint(fp),l); l->Q = inpoint(fp); break; case 'd': l = newdots(inpoint(fp),l); l->Q = inpoint(fp); break; case 'z': l = newmacro(inpoint(fp),l); l->Q = inpoint(fp); break; case 's': s = instring(fp); i = inint(fp); p = inpoint(fp); if (*s != 0) { l = newstring(p,i,l); setstring((String *)l,s); } break; case 't': /* turn a jraw text into two graw strings */ s = instring(fp); i = jtog(inint(fp)); p = Pt(0,(showgrey ? GRID*2 : GRID)); l = newstring(p,i,l); setstring((String *)l,s); s = instring(fp); inint(fp); p = inpoint(fp); if (*s != 0) { /* gad, what a mess */ l = newstring(add(p,l->P),i,l); setstring((String *)l,s); l->next->P = p; } else /* watch carefully */ l->P = p; break; case 'r': l = newref(intern(instring(fp)),l); break; case 'i': s = intern(instring(fp)); l = newinst(inpoint(fp),s,l); break; case 'm': nest = 1; l = newmaster(intern(instring(fp)),l); ((Master *)l)->dl = inlist(fp); break; case 'e': if (nest == 0) dprint("found end of no macro\n"); nest = 0; case -1: return l; } } }
bool cmoorecoinsecret::setstring(const std::string& strsecret) { return setstring(strsecret.c_str()); }
bool cbase58data::setstring(const std::string& str) { return setstring(str.c_str()); }
void fun_arg_head () { arghead = setstring (arghead); }
Container(const char (&s)[N]) : _vtype(LX_TYPE_STRING) { setstring(s, N-1); printf("array length: %d\n", N-1); };