1: /*
2: * Guitar-ZyX(tm)::MasterControlProgram - portable guitar F/X controller
3: * Copyright (C) 2009 Douglas McClendon
4: *
5: * This program is free software: you can redistribute it and/or modify
6: * it under the terms of the GNU General Public License as published by
7: * the Free Software Foundation, version 3 of the License.
8: *
9: * This program is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12: * GNU General Public License for more details.
13: *
14: * You should have received a copy of the GNU General Public License
15: * along with this program. If not, see <http://www.gnu.org/licenses/>.
16: */
17: /*
18: #
19: #############################################################################
20: #############################################################################
21: ##
22: ## gzmcp: debug client (x86)
23: ##
24: #############################################################################
25: ##
26: ## Copyright 2007-2009 Douglas McClendon <dmc AT filteredperception DOT org>
27: ##
28: #############################################################################
29: #############################################################################
30: #
31: */
32:
33:
34:
35:
36: #define USER_CMD_MAXLEN 1023
37: #define PATH_MAXLEN 1023
38: #define STATUS_MSG_MAXLEN 1023
39:
40: #define UPD_RD_BUF_SZ 1024
41:
42:
43:
44: #include "gzmcp_protocol.h"
45:
46:
47:
48:
49:
50:
51:
52: void usage(void);
53:
54: long ec_strtol(char *str);
55:
56:
57: void basename(char *dest, char *path);
58:
59: void dirname(char *dest, char *path);
60:
61:
62: void status(const char *msg_fmt, ...);
63:
64: void die(const char *msg_fmt, ...);
65:
66:
67: void wait_for_bcast(int portnum, struct sockaddr_in* address);
68:
69:
70: void do_handshake(int cmd_socket_fd);
71:
72: void set_preset(int cmd_socket_fd,
73: char *preset_string);
74:
75: void set_parameter(int cmd_socket_fd,
76: char *parameter_string,
77: char *value_string);
78:
79: void get_update(int cmd_socket_fd,
80: char *destination_filename);
81:
82:
83: void connect_to_server(int portnum, struct sockaddr_in server_address);
84:
85: void get_and_handle_user_commands(void);
86:
87: void network_shutdown(void);
88: