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

PUBLIC void* csoundQueryGlobalVariable ( CSOUND *  csnd,
const char *  name 
)

Get pointer to space allocated with the name "name". Returns NULL if the specified name is not defined.

Definition at line 915 of file namedins.c.

{
    GlobalVariableEntry_t *p;
    unsigned char         h;
    /* check if there is an actual database to search */
    if (csnd->namedGlobals == NULL)
      return NULL;
    /* check for a valid name */
    if (name == NULL)
      return NULL;
    if (name[0] == '\0')
      return NULL;
    /* calculate hash value */
    h = name_hash_2(csnd, name);
    /* search tree */
    p = (GlobalVariableEntry_t*) (csnd->namedGlobals[(int) h]);
    if (p == NULL)
      return NULL;
    while (sCmp(name, (char*) (p->name)) != 0) {
      p = (GlobalVariableEntry_t*) p->nxt;
      if (p == NULL)
        return NULL;
    }
    return (void*) (p->p);
}


Generated by  Doxygen 1.6.0   Back to index