diff options
author | David 'Digit' Turner <digit@google.com> | 2009-05-25 18:01:03 +0200 |
---|---|---|
committer | David 'Digit' Turner <digit@google.com> | 2009-05-26 17:23:25 +0200 |
commit | 318e4f294c181df33cf2541763904565b29bcccb (patch) | |
tree | 35b5085c9e35e91967e2d4a4db80e28ec086e1d3 /android/hw-qemud.h | |
parent | 0d47fe5756b1f243e8d65968cd73c0119363f909 (diff) | |
download | external_qemu-318e4f294c181df33cf2541763904565b29bcccb.zip external_qemu-318e4f294c181df33cf2541763904565b29bcccb.tar.gz external_qemu-318e4f294c181df33cf2541763904565b29bcccb.tar.bz2 |
This adds the '-prop <name>=<value>' option which is used to set
boot-time system properties from the command line. This is done
by implementing a new 'boot-properties' qemud service in the emulator.
This is to be used by the 'qemu-props' helper program that will be
invoked by /system/etc/init.goldfish.rc to read a list of system
properties from the emulator and set them in the emulated system
during boot.
Diffstat (limited to 'android/hw-qemud.h')
-rw-r--r-- | android/hw-qemud.h | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/android/hw-qemud.h b/android/hw-qemud.h index 5b45a94..8aae74d 100644 --- a/android/hw-qemud.h +++ b/android/hw-qemud.h @@ -62,28 +62,58 @@ typedef struct QemudClient QemudClient; typedef struct QemudService QemudService; +/* A function that will be called when the client running in the emulated + * system has closed its connection to qemud. + */ typedef void (*QemudClientClose)( void* opaque ); -typedef void (*QemudClientRecv) ( void* opaque, uint8_t* msg, int msglen ); +/* A function that will be called when the client sends a message to the + * service through qemud. + */ +typedef void (*QemudClientRecv) ( void* opaque, uint8_t* msg, int msglen, QemudClient* client ); + +/* Register a new client for a given service. + * 'clie_opaque' will be sent as the first argument to 'clie_recv' and 'clie_close' + * 'clie_recv' and 'clie_close' are both optional and may be NULL. + * + * You should typically use this function within a QemudServiceConnect callback + * (see below). + */ extern QemudClient* qemud_client_new( QemudService* service, int channel_id, void* clie_opaque, QemudClientRecv clie_recv, QemudClientClose clie_close ); +/* Enable framing on a given client channel. + */ extern void qemud_client_set_framing( QemudClient* client, int enabled ); +/* Send a message to a given qemud client + */ extern void qemud_client_send ( QemudClient* client, const uint8_t* msg, int msglen ); + +/* Force-close the connection to a given qemud client. + */ extern void qemud_client_close( QemudClient* client ); +/* A function that will be called each time a new client in the emulated + * system tries to connect to a given qemud service. This should typically + * call qemud_client_new() to register a new client. + */ typedef QemudClient* (*QemudServiceConnect)( void* opaque, QemudService* service, int channel ); +/* Register a new qemud service. + * 'serv_opaque' is the first parameter to 'serv_connect' + */ extern QemudService* qemud_service_register( const char* serviceName, int max_clients, void* serv_opaque, QemudServiceConnect serv_connect ); +/* Sends a message to all clients of a given service. + */ extern void qemud_service_broadcast( QemudService* sv, const uint8_t* msg, int msglen ); |