Exemple #1
0
struct Body *AppendBody(struct Body **start,char *name, char *type, struct Rlist *args)

{   struct Body *bp,*lp;
    struct Rlist *rp;

    Debug("Appending new promise body %s %s(",type,name);

    CheckBody(name,type);

    for (rp = args; rp!= NULL; rp=rp->next)
    {
        Debug("%s,",(char *)rp->item);
    }
    Debug(")\n");

    if ((bp = (struct Body *)malloc(sizeof(struct Body))) == NULL)
    {
        CfOut(cf_error,"malloc","Unable to allocate Body");
        FatalError("");
    }

    if (*start == NULL)
    {
        *start = bp;
    }
    else
    {
        for (lp = *start; lp->next != NULL; lp=lp->next)
        {
        }

        lp->next = bp;
    }

    bp->name = strdup(name);
    bp->next = NULL;
    bp->type = strdup(type);
    bp->args = args;
    bp->conlist = NULL;
    return bp;
}
Exemple #2
0
Body *AppendBody(Body **start, char *name, char *type, Rlist *args)
{
    Body *bp, *lp;
    Rlist *rp;

    CfDebug("Appending new promise body %s %s(", type, name);

    CheckBody(name, type);

    for (rp = args; rp != NULL; rp = rp->next)
    {
        CfDebug("%s,", (char *) rp->item);
    }
    CfDebug(")\n");

    bp = xcalloc(1, sizeof(Body));

    if (*start == NULL)
    {
        *start = bp;
    }
    else
    {
        for (lp = *start; lp->next != NULL; lp = lp->next)
        {
        }

        lp->next = bp;
    }

    bp->name = xstrdup(name);
    bp->type = xstrdup(type);
    bp->args = args;

    return bp;
}