Copy server params

This is a preliminary step necessary to move the server to a separate
thread.
This commit is contained in:
Romain Vimont
2021-10-27 23:40:52 +02:00
parent 9fa4d1cd4a
commit 882e4cff5f
3 changed files with 72 additions and 26 deletions

View File

@@ -40,7 +40,8 @@ struct server_params {
};
struct server {
char *serial;
// The internal allocated strings are copies owned by the server
struct server_params params;
sc_pid process;
// alive only between start() and stop()
@@ -54,13 +55,13 @@ struct server {
bool tunnel_forward; // use "adb forward" instead of "adb reverse"
};
// init default values
// init the server with the given params
bool
server_init(struct server *server);
server_init(struct server *server, const struct server_params *params);
// push, enable tunnel et start the server
bool
server_start(struct server *server, const struct server_params *params);
server_start(struct server *server);
// block until the communication with the server is established
bool