Logo Search packages:      
Sourcecode: madman version File versions  Download package

struct tag* apefrm_get ( apetag mem_cnt,
char *  name 
) [read]

search in apetag for name and return tag

2 special names APE_TAG_LIB_FIRST and APE_TAG_LIB_NEXT. FIRST return first frame and set counter to 1 NEXT return ++counter frame

for ((framka = apefrm_get(ape, APE_TAG_LIB_FIRST)); framka!=NULL;) {
    do_something();
    framka = apefrm_get(ape, APE_TAG_LIB_NEXT);
}
return NULL if no more frame exist

Parameters:
mem_cnt object apetag
name frame name for search
Returns:
pointer to struct tag if name exist or NULL if don't
Warning:
don't change anything in this struct make copy and work

Definition at line 362 of file apetaglib.c.

References APE_TAG_LIB_FIRST, APE_TAG_LIB_NEXT, _ape_mem_cnt::countTag, _ape_mem_cnt::currentPosition, and _ape_mem_cnt::tag.

{
    int n;
    struct tag **mTag;

    mTag = (mem_cnt->tag);

    if (mem_cnt->countTag == 0)
        return NULL;

    if (strcmp (name, APE_TAG_LIB_FIRST) == 0) {
        mem_cnt->currentPosition = 0;
        return (mTag[mem_cnt->currentPosition++]);
    }

    if (strcmp (name, APE_TAG_LIB_NEXT) == 0) {
        if (mem_cnt->currentPosition >= mem_cnt->countTag)
            return NULL;
        return (mTag[mem_cnt->currentPosition++]);
    }

    for (n = 0; (mem_cnt->countTag) > n; n++) { 
        if (strcasecmp (mTag[n]->name, name) == 0) {
            return (mTag[n]);
        }
    }

    return NULL;
}


Generated by  Doxygen 1.6.0   Back to index