Exemplo n.º 1
0
/*! \brief Get pointer to system library structure for named library.
 *  \ingroup iopmgr 
 *
 *  \param name Stringname of library (eg "ioman").
 *  \return Pointer to IOP library structure.
 *
 * return values:
 *   0 if not found.
 *   pointer to library structure for registered library if found.
 */
iop_library_t *slib_get_lib_by_name(const char *name)
{
  iop_library_table_t *libtable;
  iop_library_t *libptr;
  int len = strlen(name) + 1;

  libtable = GetLibraryEntryTable();
  libptr = libtable->tail;
  while ((libptr != 0))
  {
    if (!memcmp(libptr->name, name, len))
	return libptr;
    libptr = libptr->prev;
  }
  return 0;
}
Exemplo n.º 2
0
//--------------------------------------------------------------
int getModInfo(u8 *modname, modinfo_t *info)
{
	iop_library_table_t *libtable;
	iop_library_t *libptr;
	register int i;

	libtable = GetLibraryEntryTable();
	libptr = libtable->tail;
	while (libptr != 0) {
		for (i=0; i<8; i++) {
			if (libptr->name[i] != modname[i])
				break;
		} 
		if (i==8)
			break;
		libptr = libptr->prev;
	}

	if(!libptr) return 0;
	
	info->version = libptr->version;
	info->exports = (void **)(((struct irx_export_table *)libptr)->fptrs); 
	return 1;
}