244
int encode_rcost(attr, phead, atname, rsname, mode)
245
attribute *attr; /* ptr to attribute */
246
tlist_head *phead; /* head of attrlist list */
247
char *atname; /* attribute name */
248
char *rsname; /* resource name or null */
249
int mode; /* encode mode, unused here */
246
attribute *attr, /* ptr to attribute */
247
tlist_head *phead, /* head of attrlist list */
248
char *atname, /* attribute name */
249
char *rsname, /* resource name or null */
250
int mode) /* encode mode, unused here */
253
255
struct resource_cost *pcost;
258
264
if (!(attr->at_flags & ATR_VFLAG_SET))
261
271
pcost = (struct resource_cost *)GET_NEXT(attr->at_val.at_list);
273
while (pcost != NULL)
265
275
rsname = pcost->rc_def->rs_name;
267
if ((pal = attrlist_create(atname, rsname, 23)) == (svrattrl *)0)
270
(void)sprintf(pal->al_value, "%ld", pcost->rc_cost);
277
if ((pal = attrlist_create(atname, rsname, 23)) == NULL)
284
sprintf(pal->al_value, "%ld",
272
288
pal->al_flags = attr->at_flags;
276
292
pcost = (struct resource_cost *)GET_NEXT(pcost->rc_link);
283
303
* set_rcost - set attribute A to attribute B,
284
304
* either A=B, A += B, or A -= B