コード例 #1
0
ファイル: item_lib.c プロジェクト: chrishiestand/core
int IsItemInRegion(const char *item, const Item *begin_ptr, const Item *end_ptr, Attributes a, const Promise *pp)
{
    for (const Item *ip = begin_ptr; ((ip != end_ptr) && (ip != NULL)); ip = ip->next)
    {
        if (MatchPolicy(item, ip->name, a, pp))
        {
            return true;
        }
    }

    return false;
}
コード例 #2
0
ファイル: item_lib.c プロジェクト: lpefferkorn/core
int IsItemInRegion(EvalContext *ctx, const char *item, const Item *begin_ptr, const Item *end_ptr, Rlist *insert_match, const Promise *pp)
{
    for (const Item *ip = begin_ptr; ((ip != end_ptr) && (ip != NULL)); ip = ip->next)
    {
        if (MatchPolicy(ctx, item, ip->name, insert_match, pp))
        {
            return true;
        }
    }

    return false;
}
コード例 #3
0
ファイル: item_lib.c プロジェクト: lpefferkorn/core
int NeighbourItemMatches(EvalContext *ctx, const Item *file_start, const Item *location, const char *string, EditOrder pos, Rlist *insert_match,
                         const Promise *pp)
{
/* Look for a line matching proposed insert before or after location */

    for (const Item *ip = file_start; ip != NULL; ip = ip->next)
    {
        if (pos == EDIT_ORDER_BEFORE)
        {
            if ((ip->next) && (ip->next == location))
            {
                if (MatchPolicy(ctx, string, ip->name, insert_match, pp))
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
        }

        if (pos == EDIT_ORDER_AFTER)
        {
            if (ip == location)
            {
                if ((ip->next) && (MatchPolicy(ctx, string, ip->next->name, insert_match, pp)))
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
        }
    }

    return false;
}
コード例 #4
0
ファイル: item_lib.c プロジェクト: FancsalMelinda/core
int NeighbourItemMatches(const Item *file_start, const Item *location, const char *string, enum cfeditorder pos, Attributes a,
                         const Promise *pp)
{
/* Look for a line matching proposed insert before or after location */

    for (const Item *ip = file_start; ip != NULL; ip = ip->next)
    {
        if (pos == cfe_before)
        {
            if ((ip->next) && (ip->next == location))
            {
                if (MatchPolicy(string, ip->name, a, pp))
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
        }

        if (pos == cfe_after)
        {
            if (ip == location)
            {
                if ((ip->next) && (MatchPolicy(string, ip->next->name, a, pp)))
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
        }
    }

    return false;
}