mirror of
https://github.com/stupidcomputer/jsfw.git
synced 2024-12-26 21:42:23 -06:00
commit before cleaning
This commit is contained in:
parent
fd719fc1b1
commit
2297685cd6
2
Makefile
2
Makefile
@ -1,6 +1,6 @@
|
|||||||
Q=@
|
Q=@
|
||||||
CC=gcc
|
CC=gcc
|
||||||
CFLAGS=-g -Wall -Wno-format-truncation
|
CFLAGS=-g -Wall -Wno-format-truncation -pthread
|
||||||
LDFLAGS=
|
LDFLAGS=
|
||||||
BUILD_DIR=./objects
|
BUILD_DIR=./objects
|
||||||
BIN=jsfw
|
BIN=jsfw
|
||||||
|
6
client.c
6
client.c
@ -0,0 +1,6 @@
|
|||||||
|
#include<stdint.h>
|
||||||
|
#include "client.h"
|
||||||
|
|
||||||
|
void client_run(char * address, uint16_t port) {
|
||||||
|
|
||||||
|
}
|
3
client.h
3
client.h
@ -1,7 +1,8 @@
|
|||||||
// vi: set ft=c
|
// vi: set ft=c
|
||||||
#ifndef CLIENT_H
|
#ifndef CLIENT_H
|
||||||
#define CLIENT_H
|
#define CLIENT_H
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
void client_run(char * address, uint16_t port);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
20
main.c
20
main.c
@ -1,16 +1,17 @@
|
|||||||
#include<stdio.h>
|
|
||||||
#include<sys/ioctl.h>
|
|
||||||
#include<linux/joystick.h>
|
|
||||||
#include<stdint.h>
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <linux/joystick.h>
|
||||||
|
#include <pthread.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include<stdarg.h>
|
#include <sys/ioctl.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include<pthread.h>
|
|
||||||
|
|
||||||
#include "main.h"
|
#include "client.h"
|
||||||
#include "hid.h"
|
#include "hid.h"
|
||||||
|
#include "main.h"
|
||||||
#include "server.h"
|
#include "server.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
@ -28,7 +29,7 @@ uint16_t parse_port(const char * str) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void server(uint16_t port) {
|
void server(uint16_t port) {
|
||||||
printf("Server (port: %u).\n", port);
|
printf("Server (port: %u).\n\n", port);
|
||||||
|
|
||||||
pthread_t thread;
|
pthread_t thread;
|
||||||
pthread_create(&thread, NULL, hid_thread, NULL);
|
pthread_create(&thread, NULL, hid_thread, NULL);
|
||||||
@ -36,7 +37,8 @@ void server(uint16_t port) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void client(char *address, uint16_t port) {
|
void client(char *address, uint16_t port) {
|
||||||
printf("JSFW Client (%s:%d)\n", address, port);
|
printf("Client (%s:%d)\n\n", address, port);
|
||||||
|
client_run(address, port);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
|
Loading…
Reference in New Issue
Block a user