Lines Matching refs:fakemodem
67 static const gchar *handle_cmd (FakeModem *fakemodem, const gchar *cmd);
69 static gboolean send_unsolicited (FakeModem* fakemodem, const gchar* text);
70 static gboolean set_response (FakeModem* fakemodem, const gchar* command,
72 static gboolean remove_response (FakeModem* fakemodem, const gchar* command);
221 FakeModem *fakemodem; in main() local
254 fakemodem = g_object_new (FAKEMODEM_TYPE, NULL); in main()
256 fakemodem->patterns = parse_pattern_files (pattern_files, &err); in main()
257 if (fakemodem->patterns == NULL) { in main()
263 fakemodem->patterns = g_ptr_array_sized_new (0); in main()
288 G_OBJECT (fakemodem)); in main()
309 g_io_add_watch (ioc, G_IO_IN, master_read, fakemodem); in main()
315 g_object_unref (fakemodem); in main()
352 FakeModem *fakemodem = data; in master_read() local
390 if (fakemodem->echo) { in master_read()
415 response = handle_cmd (fakemodem, cmd); in master_read()
431 if (fakemodem->verbose) { in master_read()
453 handle_cmd(FakeModem *fakemodem, const gchar *cmd) in handle_cmd() argument
464 fakemodem->echo = FALSE; in handle_cmd()
466 fakemodem->echo = TRUE; in handle_cmd()
472 fakemodem->verbose = FALSE; in handle_cmd()
474 fakemodem->verbose = TRUE; in handle_cmd()
479 fakemodem->echo = TRUE; in handle_cmd()
480 fakemodem->verbose = TRUE; in handle_cmd()
485 for (i = 0 ; i < fakemodem->patterns->len; i++) { in handle_cmd()
486 pat = (Pattern *)g_ptr_array_index (fakemodem->patterns, i); in handle_cmd()
492 if (i == fakemodem->patterns->len) in handle_cmd()
509 send_unsolicited (FakeModem *fakemodem, const gchar* text) in send_unsolicited() argument
523 set_response (FakeModem *fakemodem, in set_response() argument
534 for (i = 0 ; i < fakemodem->patterns->len; i++) { in set_response()
535 pat = (Pattern *)g_ptr_array_index (fakemodem->patterns, i); in set_response()
545 if (i == fakemodem->patterns->len) { in set_response()
562 g_ptr_array_add (fakemodem->patterns, pat); in set_response()
569 remove_response (FakeModem* fakemodem, const gchar* command) in remove_response() argument
576 for (i = 0 ; i < fakemodem->patterns->len; i++) { in remove_response()
577 pat = (Pattern *)g_ptr_array_index (fakemodem->patterns, i); in remove_response()
579 g_ptr_array_remove_index (fakemodem->patterns, i); in remove_response()