コード例 #1
0
ファイル: container.c プロジェクト: FFTEAM/evolux-spark-sh4
static int selectContainer(Context_t  *context, char * extension) {
    int i, j;
    int ret = -1;

    container_printf(10, "%s::%s\n", FILENAME, __FUNCTION__);

    for (i = 0; AvailableContainer[i] != NULL; i++)
    {
        for (j = 0; AvailableContainer[i]->Capabilities[j] != NULL; j++)
            if (!strcasecmp(AvailableContainer[i]->Capabilities[j], extension)) {
                context->container->selectedContainer = AvailableContainer[i];

                container_printf(10, "Selected Container: %s\n", context->container->selectedContainer->Name);
                ret = 0;
                break;
            }
        if (ret == 0)
            break;
    }

    if (ret != 0) {
        container_err("No Container found :-(\n");
    }

    return ret;
}
コード例 #2
0
ファイル: container.c プロジェクト: Raxone/STB8000_TDT_SH4
static void printContainerCapabilities()
{
	int i, j;
	container_printf(10, "%s::%s\n", FILENAME, __FUNCTION__);
	container_printf(10, "Capabilities: ");
	for (i = 0; AvailableContainer[i] != NULL; i++)
		for (j = 0; AvailableContainer[i]->Capabilities[j] != NULL; j++)
			container_printf(10, "%s ", AvailableContainer[i]->Capabilities[j]);
	container_printf(10, "\n");
}
コード例 #3
0
ファイル: container.c プロジェクト: Raxone/STB8000_TDT_SH4
static int Command(Context_t *context, ContainerCmd_t command, void *argument)
{
	int ret = 0;
	container_printf(10, "%s::%s\n", FILENAME, __FUNCTION__);
	switch (command)
	{
		case CONTAINER_ADD:
		{
			ret = selectContainer(context, (char *) argument);
			break;
		}
		case CONTAINER_CAPABILITIES:
		{
			printContainerCapabilities();
			break;
		}
		case CONTAINER_DEL:
		{
			context->container->selectedContainer = NULL;
			break;
		}
		default:
			container_err("%s::%s ContainerCmd %d not supported!\n", FILENAME, __FUNCTION__, command);
			break;
	}
	return ret;
}