コード例 #1
0
ファイル: osdmodule.cpp プロジェクト: ccmurray/mame
osd_module *osd_module_manager::get_module_generic(const char *type, const char *name)
{
	int i = get_module_index(type, name);
	if (i>=0)
		return m_modules[i];
	else
		return nullptr;
}
コード例 #2
0
ファイル: commons.c プロジェクト: alertisme/goaccess
/* Find the next module given the current module.
 *
 * The next available module in the array is returned. */
int
get_next_module (GModule module)
{
  int next = get_module_index (module) + 1;

  if (next == TOTAL_MODULES || module_list[next] == -1)
    return module_list[0];

  return module_list[next];
}
コード例 #3
0
static struct msm_adsp_module *find_adsp_module_by_id(
	struct adsp_info *info, uint32_t id)
{
	if (id > info->max_module_id) {
		return NULL;
	} else {
		id = get_module_index(id);
		if (id < 0)
			return NULL;
		return info->id_to_module[id];
	}
}
コード例 #4
0
ファイル: commons.c プロジェクト: alertisme/goaccess
/* Remove the given module from the module_list array.
 *
 * If the module is not within the array, 1 is returned.
 * If the module is within the array, it is removed from the array and
 * 0 is returned. */
int
remove_module (GModule module)
{
  int index = get_module_index (module);
  if (index == -1)
    return 1;

  if (index < TOTAL_MODULES - 1)
    memmove (&module_list[index], &module_list[index + 1],
             ((TOTAL_MODULES - 1) - index) * sizeof (module_list[0]));
  module_list[TOTAL_MODULES - 1] = -1;

  return 0;
}
コード例 #5
0
static struct msm_adsp_module *find_adsp_module_by_id(
    struct adsp_info *info, uint32_t id)
{
    int mod_idx;

    if (id > info->max_module_id) {
        return NULL;
    } else {
        mod_idx = get_module_index(id);
        if (mod_idx < 0)
            return NULL;
        return info->id_to_module[mod_idx];
    }
}
コード例 #6
0
ファイル: adsp.c プロジェクト: Conap30/htc_kernel_desirec_bfs
static struct msm_adsp_module *find_adsp_module_by_id(
	struct adsp_info *info, uint32_t id)
{
	if (id > info->max_module_id) {
		return NULL;
	} else {
#if CONFIG_MSM_AMSS_VERSION >= 6350
		id = get_module_index(id);
		if (id < 0)
			return NULL;
#endif
		return info->id_to_module[id];
	}
}
コード例 #7
0
ファイル: commons.c プロジェクト: alertisme/goaccess
/* Find the previous module given the current module.
 *
 * The previous available module in the array is returned. */
int
get_prev_module (GModule module)
{
  int i;
  int next = get_module_index (module) - 1;

  if (next >= 0 && module_list[next] != -1)
    return module_list[next];

  for (i = TOTAL_MODULES - 1; i >= 0; i--) {
    if (module_list[i] != -1) {
      return module_list[i];
    }
  }

  return 0;
}
コード例 #8
0
ファイル: osdmodule.cpp プロジェクト: ccmurray/mame
bool osd_module_manager::type_has_name(const char *type, const char *name)
{
	return (get_module_index(type, name) >= 0);
}