Lines Matching +defs:val +defs:sp
57 static void put_time(Namval_t* np, const char* val, int flag, Namfun_t* nfp)
61 if(val)
67 t = *(Sfdouble_t*)val;
69 t = *(double*)val;
73 t = tmdate(val, &last, (time_t*)0);
75 errormsg(SH_DICT, ERROR_exit(1),"%s: invalid date/time string", val);
83 nv_putv(np, val, flag, nfp);
130 static void put_mode(Namval_t* np, const char* val, int flag, Namfun_t* nfp)
132 if(val)
139 mode = *(Sfdouble_t*)val;
141 mode = *(double*)val;
145 mode = strperm(val, &last,0);
147 errormsg(SH_DICT, ERROR_exit(1),"%s: invalid mode string", val);
152 nv_putv(np,val,flag,nfp);
226 char *val = np->nvalue + fp->offset;
234 val = *(char**)val;
235 nv_putval(nq,val,fp->flags|NV_NOFREE);
244 Shclass_t *sp = &dcp->sclass;
245 Shfield_t *fp = sh_findfield(sp->fields,sp->nelem,name);
247 int n = fp-sp->fields;
260 static void genvalue(Sfio_t *out, Shclass_t *sp, int indent, Namval_t *npar)
262 Shfield_t *fp = sp->fields;
263 Namval_t *np, **nodes= (Namval_t**)(sp+1);
270 for(i=0; i < sp->nelem; i++,fp++)
352 static void put_classval(Namval_t* np, const char* val, int flag, Namfun_t* nfp)
361 if(val)
362 nv_putval(np,val,flag);
375 static int mkclass(Namval_t *np, Shclass_t *sp)
377 struct dcclass *tcp = newof(NULL,struct dcclass,1,sp->nelem*sizeof(Namval_t*));
380 memset((void*)(tcp+1),0,sp->nelem*sizeof(Namval_t*));
382 tcp->sclass = *sp;
383 np->nvalue = (char*)calloc(sp->dsize,1);