Lines Matching refs:num

275 		mc->num = sfgetu(ip);
286 if (!(mc->set = vmnewof(vm, 0, Mcset_t, mc->num + 1, 0)))
290 if (!(mp = vmnewof(vm, 0, char*, mc->nmsgs + mc->num + 1, 0)))
301 if (i > mc->num)
304 mc->set[i].num = n;
313 for (i = 1; i <= mc->num; i++)
314 for (j = 1; j <= mc->set[i].num; j++)
339 * return the <set,num> message in mc
345 mcget(register Mc_t* mc, int set, int num, const char* msg)
351 if (!mc || set < 0 || set > mc->num || num < 1 || num > mc->set[set].num || !(s = mc->set[set].msg[num]))
366 * set message <set,num> to msg
373 mcput(register Mc_t* mc, int set, int num, const char* msg)
384 if (!mc || set > MC_SET_MAX || num > MC_NUM_MAX)
393 if (set <= mc->num && num <= mc->set[set].num && (s = mc->set[set].msg[num]))
399 mc->set[set].msg[num] = 0;
401 if (mc->set[set].num == num)
404 * decrease the max msg num
407 mp = mc->set[set].msg + num;
408 while (num && !mp[--num]);
409 mc->nmsgs -= mc->set[set].num - num;
410 if (!(mc->set[set].num = num) && mc->num == set)
413 * decrease the max set num
416 while (num && !mc->set[--num].num);
417 mc->num = num;
428 if (set > mc->num)
436 for (i = 1; i <= mc->num; i++)
440 mc->num = set;
448 if (num > sp->num)
450 if (num > sp->gen)
455 if (i <= num)
456 i = 2 * num;
463 for (i = 1; i <= sp->num; i++)
477 mc->nmsgs += num - sp->num;
478 sp->num = num;
485 if (s = sp->msg[num])
502 sp->msg[num] = s;
548 sfputu(op, mc->num);
554 for (i = 1; i <= mc->num; i++)
555 if (mc->set[i].num)
558 sfputu(op, mc->set[i].num);
566 for (i = 1; i <= mc->num; i++)
567 if (mc->set[i].num)
570 for (j = 1; j <= sp->num; j++)
581 for (i = 1; i <= mc->num; i++)
582 if (mc->set[i].num)
585 for (j = 1; j <= sp->num; j++)