~gpanders/iboot

ee1b2812999316a472e97a65154aa2780afeff12 — Greg Anders 23 days ago a4cdc45 master
Place function return types on separate line
1 files changed, 8 insertions(+), 4 deletions(-)

M iboot.c
M iboot.c => iboot.c +8 -4
@@ 25,7 25,8 @@ enum action {
	QUERY   = 'q',
};

int create_socket()
int
create_socket()
{
	int sockfd = socket(AF_INET, SOCK_STREAM, 0);
	if (sockfd < 0) {


@@ 47,7 48,8 @@ int create_socket()
	return sockfd;
}

void send_command(int sockfd, enum action action)
void
send_command(int sockfd, enum action action)
{
	char buf[BUF_SIZE];
	sprintf(buf, "\x1b%s\x1b%c\r", PASSWORD, action);


@@ 66,7 68,8 @@ void send_command(int sockfd, enum action action)
	printf("%s\n", buf);
}

enum action get_action(const char *action)
enum action
get_action(const char *action)
{
	if (!strcmp(action, ACTION_ON)) {
		return ON;


@@ 87,7 90,8 @@ enum action get_action(const char *action)
	return 0;
}

int main(int argc, char *argv[])
int
main(int argc, char *argv[])
{
	if (argc < 2) {
		fprintf(stderr, "Usage: %s <on|off|cycle|query>\n", argv[0]);