Ejemplo n.º 1
0
void exit_handler(NOPH_Exception_t exception, void *arg){
	char msg[512];
	NOPH_String_toCharPtr(NOPH_Throwable_toString(exception), msg, sizeof(msg));
	roadmap_log(ROADMAP_ERROR,"Exception in main_exit!! Exception mesage :%s", msg);
	NOPH_Throwable_printStackTrace(exception);
	NOPH_delete(exception);
	exit(0);
}
Ejemplo n.º 2
0
void exception_handler(NOPH_Exception_t exception, void *arg)
{
  char msg[512];

  NOPH_String_toCharPtr(NOPH_Throwable_toString(exception), msg, sizeof(msg));
  roadmap_messagebox("Error", msg);
  NOPH_Throwable_printStackTrace(exception);
  NOPH_delete(exception);
}
Ejemplo n.º 3
0
const char *cibyl_select_fs_root(void)
{
	NOPH_Display_t display = NOPH_Display_getDisplay(NOPH_MIDlet_get());
	NOPH_Displayable_t cur = NOPH_Display_getCurrent(display);
	NOPH_CommandMgr_t cm = NOPH_CommandMgr_getInstance();
	NOPH_Enumeration_t en = NOPH_FileSystemRegistry_listRoots();
	FILE *conf;
	int i = 0;

	fs_root = NULL;

	fs_list = NOPH_List_new("Select fs root", NOPH_Choice_IMPLICIT);

	while (NOPH_Enumeration_hasMoreElements(en))
	{
		NOPH_Object_t o = NOPH_Enumeration_nextElement(en);

		NOPH_String_toCharPtr(o, roots[i], 40);
		NOPH_List_append(fs_list, roots[i], 0);
		NOPH_delete(o);
		i++;
	}
	NOPH_delete(en);
	NOPH_Display_setCurrent(display, fs_list);
	NOPH_CommandMgr_setList(cm, fs_list, select_fs_callback, NULL);

	while(fs_root == NULL)
	{
		NOPH_Thread_sleep(250);
	}
#if 0
	conf = fopen("recordstore://sarien-conf:1", "w");
	if (conf)
	{
		char buf[40];

		strncpy(buf, fs_root, 40);
		fwrite(buf, 1, 40, conf);
		fclose(conf);
	}
#endif
	NOPH_Display_setCurrent(display, cur);
	NOPH_delete(fs_list);

        return fs_root;
}