diff --git a/dispd/Makefile b/dispd/Makefile
index 4eb2d4f0..441b6afc 100644
--- a/dispd/Makefile
+++ b/dispd/Makefile
@@ -5,9 +5,9 @@ include ../build-aux/version.mak
include ../build-aux/dirs.mak
OPTLEVEL?=$(DEFAULT_OPTLEVEL)
-CXXFLAGS?=$(OPTLEVEL)
+CFLAGS?=$(OPTLEVEL)
-CXXFLAGS:=$(CXXFLAGS) -Wall -Wextra -fno-exceptions -fno-rtti
+CFLAGS:=$(CFLAGS) -Wall -Wextra
CPPFLAGS:=$(CPPFLAGS) -I include
CLIENT_OBJS:=\
@@ -15,16 +15,12 @@ client/library.o \
client/session.o \
client/window.o \
-SERVER_OBJS:=\
-server/dispd.o \
-
-BINS:=server/dispd client/libdispd.a
+BINS:=client/libdispd.a
all: $(BINS)
-.PHONY: all headers client server clean install install-include-dirs \
- install-headers install-client-dirs install-client install-server-dirs \
- install-server
+.PHONY: all headers client clean install install-include-dirs \
+ install-headers install-client-dirs install-client
headers:
@@ -33,21 +29,16 @@ client: client/libdispd.a
client/libdispd.a: $(CLIENT_OBJS)
$(AR) rcs $@ $(CLIENT_OBJS)
-server: server/dispd
-
-server/dispd: $(SERVER_OBJS)
- $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(SERVER_OBJS) -o $@
-
clean:
- rm -f $(CLIENT_OBJS) $(SERVER_OBJS)
+ rm -f $(CLIENT_OBJS)
rm -f $(BINS)
- rm -f *.o client/*.o server/*.o
+ rm -f *.o client/*.o
-%.o: %.cpp
- $(CXX) -std=gnu++11 -c $< -o $@ $(CPPFLAGS) $(CXXFLAGS)
+%.o: %.c
+ $(CC) -std=gnu11 $(CFLAGS) $(CPPFLAGS) -c $< -o $@
# Installation into sysroot
-install: install-headers install-client install-server
+install: install-headers install-client
install-include-dirs: headers
mkdir -p $(DESTDIR)$(INCLUDEDIR)
@@ -60,9 +51,3 @@ install-client-dirs:
install-client: install-client-dirs client
cp -P client/libdispd.a $(DESTDIR)$(LIBDIR)
-
-install-server-dirs:
- mkdir -p $(DESTDIR)$(BINDIR)
-
-install-server: install-server-dirs server
- install server/dispd $(DESTDIR)$(BINDIR)
diff --git a/dispd/client/framebuffer.h b/dispd/client/framebuffer.h
index d891e924..5c088687 100644
--- a/dispd/client/framebuffer.h
+++ b/dispd/client/framebuffer.h
@@ -25,10 +25,6 @@
#ifndef INCLUDE_DISPD_FRAMEBUFFER_H
#define INCLUDE_DISPD_FRAMEBUFFER_H
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
struct dispd_framebuffer
{
struct dispd_window* window;
@@ -40,8 +36,4 @@ struct dispd_framebuffer
int height;
};
-#if defined(__cplusplus)
-} /* extern "C" */
-#endif
-
#endif
diff --git a/dispd/client/library.cpp b/dispd/client/library.c
similarity index 93%
rename from dispd/client/library.cpp
rename to dispd/client/library.c
index 1450e252..f7cb39a2 100644
--- a/dispd/client/library.cpp
+++ b/dispd/client/library.c
@@ -17,11 +17,12 @@
You should have received a copy of the GNU Lesser General Public License
along with dispd. If not, see .
- library.cpp
+ library.c
Main entry point of the Sortix Display Daemon.
*******************************************************************************/
+#include
#include
#include
@@ -29,7 +30,7 @@
#include "session.h"
-extern "C" bool dispd_initialize(int* argc, char*** argv)
+bool dispd_initialize(int* argc, char*** argv)
{
if ( !dispd__session_initialize(argc, argv) )
return false;
diff --git a/dispd/client/session.cpp b/dispd/client/session.c
similarity index 94%
rename from dispd/client/session.cpp
rename to dispd/client/session.c
index 53f4a303..150bf612 100644
--- a/dispd/client/session.cpp
+++ b/dispd/client/session.c
@@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with dispd. If not, see .
- session.cpp
+ session.c
Handles session management.
*******************************************************************************/
@@ -28,6 +28,7 @@
#include
#include
+#include
#include
#include
#include
@@ -38,13 +39,15 @@
#include "session.h"
-const uint64_t ONE_AND_ONLY_DEVICE = 0;
-const uint64_t ONE_AND_ONLY_CONNECTOR = 0;
+static const uint64_t ONE_AND_ONLY_DEVICE = 0;
+static const uint64_t ONE_AND_ONLY_CONNECTOR = 0;
struct dispd_session* global_session = NULL;
-bool dispd__session_initialize(int* /*argc*/, char*** /*argv*/)
+bool dispd__session_initialize(int* argc, char*** argv)
{
+ (void) argc;
+ (void) argv;
size_t size = sizeof(struct dispd_session);
global_session = (struct dispd_session*) malloc(size);
if ( !global_session )
diff --git a/dispd/client/window.cpp b/dispd/client/window.c
similarity index 97%
rename from dispd/client/window.cpp
rename to dispd/client/window.c
index c86c47ea..beb433df 100644
--- a/dispd/client/window.cpp
+++ b/dispd/client/window.c
@@ -17,7 +17,7 @@
You should have received a copy of the GNU Lesser General Public License
along with dispd. If not, see .
- window.cpp
+ window.c
Handles windows.
*******************************************************************************/
@@ -27,6 +27,7 @@
#include
#include
+#include
#include
#include
#include
@@ -39,7 +40,6 @@
#include "session.h"
#include "window.h"
-extern "C"
struct dispd_window* dispd_create_window_game_rgba(struct dispd_session* session)
{
if ( session->current_window )
@@ -55,7 +55,7 @@ struct dispd_window* dispd_create_window_game_rgba(struct dispd_session* session
return session->current_window = window;
}
-extern "C" bool dispd_destroy_window(struct dispd_window* window)
+bool dispd_destroy_window(struct dispd_window* window)
{
free(window->cached_buffer);
free(window);
diff --git a/dispd/include/dispd.h b/dispd/include/dispd.h
index 9a7fecc7..0680cb75 100644
--- a/dispd/include/dispd.h
+++ b/dispd/include/dispd.h
@@ -41,7 +41,7 @@ struct dispd_framebuffer;
bool dispd_initialize(int* argc, char*** argv);
-struct dispd_session* dispd_attach_default_session();
+struct dispd_session* dispd_attach_default_session(void);
bool dispd_detach_session(struct dispd_session* session);
bool dispd_session_setup_game_rgba(struct dispd_session* session);
diff --git a/dispd/server/dispd.cpp b/dispd/server/dispd.cpp
deleted file mode 100644
index 872fbc7c..00000000
--- a/dispd/server/dispd.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
-
- Copyright(C) Jonas 'Sortie' Termansen 2012.
-
- This file is part of dispd.
-
- dispd is free software: you can redistribute it and/or modify it under the
- terms of the GNU Lesser General Public License as published by the Free
- Software Foundation, either version 3 of the License, or (at your option)
- any later version.
-
- dispd is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with dispd. If not, see .
-
- dispd.cpp
- Main entry point of the Sortix Display Daemon.
-
-*******************************************************************************/
-
-#include
-#include
-
-int main(int /*argc*/, char* /*argv*/[])
-{
- fprintf(stderr, "dispd is not implemented as a server yet.\n");
- exit(1);
-}