Separate list devices for Linux.

This commit is contained in:
2019-10-13 00:05:13 +01:00
parent 782c2b1e20
commit 321cd275ee
4 changed files with 63 additions and 1 deletions

View File

@@ -3,4 +3,10 @@ project(dicremote C)
set(CMAKE_C_STANDARD 90) set(CMAKE_C_STANDARD 90)
add_executable(dicremote main.c list_devices.c) set(PLATFORM_SOURCES )
IF("${CMAKE_SYSTEM}" MATCHES "Linux")
list(APPEND PLATFORM_SOURCES linux/list_devices.c linux/linux.h)
endif()
add_executable(dicremote main.c list_devices.c ${PLATFORM_SOURCES})

25
linux/linux.h Normal file
View File

@@ -0,0 +1,25 @@
/*
* This file is part of the DiscImageChef Remote Server.
* Copyright (c) 2019 Natalia Portillo.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DICREMOTE_LINUX_H
#define DICREMOTE_LINUX_H
#include "../dicmote.h"
DeviceInfoList* linux_list_devices();
#endif // DICREMOTE_LINUX_H

23
linux/list_devices.c Normal file
View File

@@ -0,0 +1,23 @@
/*
* This file is part of the DiscImageChef Remote Server.
* Copyright (c) 2019 Natalia Portillo.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program 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
* General Public License for more details.
*
* 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 "../dicmote.h"
DeviceInfoList* linux_list_devices()
{
return 0;
}

View File

@@ -17,7 +17,15 @@
#include "dicmote.h" #include "dicmote.h"
#if defined(__linux__) && !defined(__ANDROID__)
#include "linux/linux.h"
#endif
DeviceInfoList* ListDevices() DeviceInfoList* ListDevices()
{ {
#if defined(__linux__) && !defined(__ANDROID__)
return linux_list_devices();
#else
return 0; return 0;
#endif
} }