summaryrefslogtreecommitdiffstats
path: root/src/blueshift_drm_c.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-04-01 12:37:14 +0200
committerMattias Andrée <maandree@operamail.com>2014-04-01 12:37:20 +0200
commit0ab50d5887cb94138239bb1991b86adcabe3c3d2 (patch)
treebbac43b8dd5f35d10637c5aa8b74e29f5e011274 /src/blueshift_drm_c.c
parentRANDR => RandR (diff)
downloadblueshift-0ab50d5887cb94138239bb1991b86adcabe3c3d2.tar.gz
blueshift-0ab50d5887cb94138239bb1991b86adcabe3c3d2.tar.bz2
blueshift-0ab50d5887cb94138239bb1991b86adcabe3c3d2.tar.xz
enable more warnings and add .h files
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/blueshift_drm_c.c45
1 files changed, 3 insertions, 42 deletions
diff --git a/src/blueshift_drm_c.c b/src/blueshift_drm_c.c
index a521545..1d04f86 100644
--- a/src/blueshift_drm_c.c
+++ b/src/blueshift_drm_c.c
@@ -14,46 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <alloca.h>
-
-#ifndef O_CLOEXEC
- #define O_CLOEXEC 02000000
-#endif
-
-/* Requires video group */
-#include <xf86drm.h>
-#include <xf86drmMode.h>
-
-
-
-/**
- * Resources for an open connection to a graphics card
- */
-typedef struct _card_connection
-{
- /**
- * File descriptor for the connection
- */
- int fd;
-
- /**
- * Card resources
- */
- drmModeRes* res;
-
- /**
- * Resources for open connectors
- */
- drmModeConnector** connectors;
-
-} card_connection;
+#include "blueshift_drm_c.h"
/**
@@ -91,7 +52,7 @@ static long card_connection_reuse_size = 0;
/**
* Free all resources, but you need to close all connections first
*/
-void blueshift_drm_close()
+void blueshift_drm_close(void)
{
if (card_connections)
free(card_connections);
@@ -113,7 +74,7 @@ void blueshift_drm_close()
*
* @return The number of cards present on the system
*/
-int blueshift_drm_card_count()
+int blueshift_drm_card_count(void)
{
long maxlen = strlen(DRM_DIR_NAME) + strlen(DRM_DEV_NAME) + 10;
char* pathname = alloca(maxlen * sizeof(char));