#define TEST_EML_PATH "/tmp/test.eml"
-
+/*
static void print_depth(int depth)
{
int i;
for (i = 0; i < depth; i++)
testapp_print(" \n");
}
-
+*/
+/*
static void print_mime_struct(GMimeObject *part, int depth)
{
const GMimeContentType *type;
}
}
}
-
+*/
static void
test_eml_parsing_foreach_callback(GMimeObject *parent, GMimeObject *part, gpointer user_data)
{
if ((fd = open(TEST_EML_PATH, O_RDONLY, 0)) == -1) {
testapp_print ("open fail\n");
- return 0;
+ return FALSE;
}
/* init the gmime library */
testapp_print("Header String:%s\n\n\n\n", g_mime_header_list_to_string(po->headers));
g_mime_message_foreach(message, test_eml_parsing_foreach_callback, &count);
+ return TRUE;
}
static gboolean testapp_test_interpret_command(int menu_number)
{
gboolean go_to_loop = TRUE;
int menu_number = 0;
- int result_from_scanf = 0;
-
while (go_to_loop) {
testapp_show_menu(EMAIL_GMIME_MENU);
testapp_show_prompt(EMAIL_GMIME_MENU);
- result_from_scanf = scanf("%d", &menu_number);
+ if(0 >= scanf("%d", &menu_number)){
+ testapp_print ("input fail\n");
+ continue;
+ }
go_to_loop = testapp_test_interpret_command(menu_number);
}