#include "test.h" #include #include #include static gint test_main (int args_length1, char** args); static gint test_main (int args_length1, char** args) { gboolean pass; if (args_length1 < 2) { g_message ("/home/master/Sources/vala-test/test.vala:9: You can specify file (or files) name"); return 0; } pass = TRUE; { char** filename_collection; int filename_it; filename_collection = args; for (filename_it = 0; (args_length1 != -1 && filename_it < args_length1) || (args_length1 == -1 && filename_collection[filename_it] != NULL); filename_it = filename_it + 1) { const char* _tmp2; char* filename; _tmp2 = NULL; filename = (_tmp2 = filename_collection[filename_it], (_tmp2 == NULL ? NULL : g_strdup (_tmp2))); { FILE* file; FILE* _tmp1; gchar code; if (pass) { pass = FALSE; (filename = (g_free (filename), NULL)); continue; } file = g_new0 (FILE, 1); _tmp1 = NULL; (_tmp1 = fopen (filename, "r")); (_tmp1 == NULL ? NULL : (_tmp1 = (fclose (_tmp1), NULL))); code = '\0'; while (!feof (file)) { code = ((gchar) fgetc (file)); fprintf (stdout, ":%c\n", code); } fclose (file); (filename = (g_free (filename), NULL)); (file == NULL ? NULL : (file = (fclose (file), NULL))); } } } } int main (int argc, char ** argv) { g_type_init (); return test_main (argc, argv); } test* test_new (void) { test* self; self = g_slice_new0 (test); return self; } void test_free (test* self) { g_slice_free (test, self); }