aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-06-16 17:26:01 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-06-16 17:26:01 +0200
commit071220857ef563eeb2d69006c547ff45abf376e2 (patch)
tree0468d79ff39758b533004a95fa983cbcc13f0073
parent91e0989879dadf8a8fe49ba3cafebec5fd8744f9 (diff)
downloadirc-071220857ef563eeb2d69006c547ff45abf376e2.zip
irc-071220857ef563eeb2d69006c547ff45abf376e2.tar.bz2
Woops, forgot.
-rw-r--r--CMakeLists.txt4
-rw-r--r--src/main.c3
-rw-r--r--src/meta_net/meta_net.c17
-rw-r--r--src/parameters/parameters.c9
-rw-r--r--src/parameters/parameters.h5
-rw-r--r--src/parameters/parameters_getters.c8
-rw-r--r--src/parameters/parameters_types.h1
7 files changed, 44 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5b994db..6f58fe9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,11 +12,13 @@ add_definitions(-D_POSIX_SOURCE)
add_definitions(-D_POSIX_C_SOURCE=200809L)
find_package(LibIRCClient REQUIRED)
+set(CMAKE_C_FLAGS $ENV{CFLAGS})
if(CMAKE_COMPILER_IS_GNUCC)
- set(CMAKE_C_FLAGS "-g -Wall -Wpedantic -Wconversion")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall -Wpedantic -Wconversion")
#message(STATUS "GNUCC detected. Adding '-O3' parameter.")
#set(CMAKE_C_FLAGS "-O3")
endif()
+message(STATUS "CFLAGS=${CMAKE_C_FLAGS}")
# ${SRC_FILES} is recursively defined in the subdirectories.
# Each subdirectory only adds the source files that are present at its level.
diff --git a/src/main.c b/src/main.c
index 732ad20..2646809 100644
--- a/src/main.c
+++ b/src/main.c
@@ -33,6 +33,9 @@ static void print_help (const char runnable [const restrict static 1])
" IRC_PORT:\tPort to use for the IRC connection.\n"
"\nOptions:\n"
" -6, --ipv6:\tEnables IPv6.\n"
+/*
+ " -l, --request-pipelining:\tRequests the JabberHive pipelining mode.\n"
+*/
" -c, --print-chat:\tDisplays IRC conversations on stdout.\n"
" -i, --print-additional-info:\tDisplays received JH info messages on"
" stdout.\n"
diff --git a/src/meta_net/meta_net.c b/src/meta_net/meta_net.c
index 8f290a8..a297eee 100644
--- a/src/meta_net/meta_net.c
+++ b/src/meta_net/meta_net.c
@@ -123,12 +123,25 @@ int JH_meta_net_connect
const struct JH_parameters params [const restrict static 1]
)
{
- return
+ if
+ (
open_socket
(
socket,
JH_parameters_get_socket_name(params)
- );
+ )
+ < 0
+ )
+ {
+ return -1;
+ }
+/*
+ if (JH_parameters_get_request_pipelining(params) == 1)
+ {
+ return JH_meta_net_send_
+ }
+*/
+ return 0;
}
void JH_meta_net_initialize
diff --git a/src/parameters/parameters.c b/src/parameters/parameters.c
index 83602cb..18f88c2 100644
--- a/src/parameters/parameters.c
+++ b/src/parameters/parameters.c
@@ -53,6 +53,7 @@ static void set_default_to_all_fields
struct JH_parameters param [const restrict static 1]
)
{
+ param->request_pipelining = 0;
param->print_chat = 0;
param->print_additional_info = 0;
param->socket_name = (const char *) NULL;
@@ -178,6 +179,14 @@ static int set_options
}
else if
(
+ JH_STRING_EQUALS("-l", argv[i])
+ || JH_STRING_EQUALS("--request-pipelining", argv[i])
+ )
+ {
+ param->request_pipelining = 1;
+ }
+ else if
+ (
JH_STRING_EQUALS("-c", argv[i])
|| JH_STRING_EQUALS("--print-chat", argv[i])
)
diff --git a/src/parameters/parameters.h b/src/parameters/parameters.h
index 5993fba..14c1dc1 100644
--- a/src/parameters/parameters.h
+++ b/src/parameters/parameters.h
@@ -10,6 +10,11 @@ int JH_parameters_initialize
const char * argv [const static argc]
);
+const int JH_parameters_get_request_pipelining
+(
+ const struct JH_parameters param [const restrict static 1]
+);
+
const int JH_parameters_get_print_additional_info
(
const struct JH_parameters param [const restrict static 1]
diff --git a/src/parameters/parameters_getters.c b/src/parameters/parameters_getters.c
index 4cd422e..868a059 100644
--- a/src/parameters/parameters_getters.c
+++ b/src/parameters/parameters_getters.c
@@ -1,5 +1,13 @@
#include "parameters.h"
+const int JH_parameters_get_request_pipelining
+(
+ const struct JH_parameters param [const restrict static 1]
+)
+{
+ return param->request_pipelining;
+}
+
const int JH_parameters_get_print_additional_info
(
const struct JH_parameters param [const restrict static 1]
diff --git a/src/parameters/parameters_types.h b/src/parameters/parameters_types.h
index 6b17df6..0d70b73 100644
--- a/src/parameters/parameters_types.h
+++ b/src/parameters/parameters_types.h
@@ -5,6 +5,7 @@
struct JH_parameters
{
+ int request_pipelining;
int print_chat;
int print_additional_info;