src/components/sde/sde.c
/** This helper function checks to see if a given library has already been initialized and exists
    in the global structure of the component.
  @param[in] a pointer to the global structure.
  @param[in] a string containing the name of the library.
  @return a pointer to the library handle.
  */
This helper function checks to see if a given library has already been initialized and exists
in the global structure of the component.
This helper function checks to see if a given library has already been initialized and exists in the global structure of the component .
papisde_library_desc_t *find_library_by_name(const char *library_name, papisde_control_t *gctl){
    if( (NULL == gctl) || (NULL == library_name) )
        return NULL;
    papisde_library_desc_t *tmp_lib = gctl->lib_list_head;
    while(NULL != tmp_lib){
        char *tmp_name = tmp_lib->libraryName;
        SUBDBG("Checking library: '%s' against registered library: '%s'\n",library_name, tmp_lib->libraryName);
        if( (NULL != tmp_name) && !strcmp(tmp_name, library_name) )
            return tmp_lib;
        tmp_lib = tmp_lib->next;
    }
    return NULL;
}
papisde_library_desc_t * find_library_by_name ( const char * library_name , papisde_control_t * gctl ) { if ( ( NULL == gctl ) || ( NULL == library_name ) ) return NULL ; papisde_library_desc_t * tmp_lib = gctl -> lib_list_head ; while ( NULL != tmp_lib ) { char * tmp_name = tmp_lib -> libraryName ; SUBDBG ( " \n " , library_name , tmp_lib -> libraryName ) ; if ( ( NULL != tmp_name ) && ! strcmp ( tmp_name , library_name ) ) return tmp_lib ; tmp_lib = tmp_lib -> next ; } return NULL ; }
This helper function checks to see if a given library has already been initialized and exists
in the global structure of the component.
This helper function checks to see if a given library has already been initialized and exists in the global structure of the component .
// Check to see if this library has already been initialized. // If we find the same library already registered, we do not create a new entry.