summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2009-07-18 00:43:22 -0700
committerKeith Packard <keithp@keithp.com>2009-07-18 00:43:22 -0700
commit1e5e98bd8f5ea0bc15592de454e3629383462371 (patch)
treef9a3088baebc0f2d3f5f0654dc4e8a526d0744c1
parent08f37056deec25d77062bc411a04033401b033a5 (diff)
Trim aoview_serial_set_callback args down to just port and callback
-rw-r--r--aoview/aoview.h4
-rw-r--r--aoview/aoview_eeprom.c2
-rw-r--r--aoview/aoview_monitor.c4
-rw-r--r--aoview/aoview_serial.c10
4 files changed, 7 insertions, 13 deletions
diff --git a/aoview/aoview.h b/aoview/aoview.h
index 800349ec..4ed0ffab 100644
--- a/aoview/aoview.h
+++ b/aoview/aoview.h
@@ -160,9 +160,7 @@ typedef void (*aoview_serial_callback)(gpointer user_data, struct aoview_serial
void
aoview_serial_set_callback(struct aoview_serial *serial,
- aoview_serial_callback func,
- gpointer data,
- GDestroyNotify notify);
+ aoview_serial_callback func);
void
aoview_serial_printf(struct aoview_serial *serial, char *format, ...);
diff --git a/aoview/aoview_eeprom.c b/aoview/aoview_eeprom.c
index 826afc43..34e2deed 100644
--- a/aoview/aoview_eeprom.c
+++ b/aoview/aoview_eeprom.c
@@ -140,7 +140,7 @@ aoview_eeprom_save(const char *device)
serial = aoview_serial_open(device);
if (!serial)
return FALSE;
- aoview_serial_set_callback(serial, aoview_eeprom_callback, serial, NULL);
+ aoview_serial_set_callback(serial, aoview_eeprom_callback);
aoview_serial_printf(serial, "v\nl\n");
return TRUE;
}
diff --git a/aoview/aoview_monitor.c b/aoview/aoview_monitor.c
index 8d120091..dd0e6019 100644
--- a/aoview/aoview_monitor.c
+++ b/aoview/aoview_monitor.c
@@ -189,8 +189,6 @@ aoview_monitor_connect(char *tty)
aoview_table_clear();
aoview_state_reset();
aoview_serial_set_callback(monitor_serial,
- aoview_monitor_callback,
- monitor_serial,
- NULL);
+ aoview_monitor_callback);
return TRUE;
}
diff --git a/aoview/aoview_serial.c b/aoview/aoview_serial.c
index 1d8fefce..f5142ea5 100644
--- a/aoview/aoview_serial.c
+++ b/aoview/aoview_serial.c
@@ -250,6 +250,7 @@ aoview_serial_open(const char *tty)
serial->poll_fd.events = G_IO_IN | G_IO_OUT | G_IO_HUP | G_IO_ERR;
g_source_attach(&serial->source, NULL);
g_source_add_poll(&serial->source,&serial->poll_fd);
+ aoview_serial_set_callback(serial, NULL);
return serial;
}
@@ -257,16 +258,13 @@ void
aoview_serial_close(struct aoview_serial *serial)
{
g_source_remove_poll(&serial->source, &serial->poll_fd);
+ close(serial->fd);
g_source_destroy(&serial->source);
- g_source_unref(&serial->source);
- free(serial);
}
void
aoview_serial_set_callback(struct aoview_serial *serial,
- aoview_serial_callback func,
- gpointer data,
- GDestroyNotify notify)
+ aoview_serial_callback func)
{
- g_source_set_callback(&serial->source, (GSourceFunc) func, data, notify);
+ g_source_set_callback(&serial->source, (GSourceFunc) func, serial, NULL);
}