Files
aaruremote/list_devices.c

68 lines
1.5 KiB
C
Raw Normal View History

2019-10-12 23:53:29 +01:00
/*
* This file is part of the DiscImageChef Remote Server.
2020-01-03 17:42:13 +00:00
* Copyright (c) 2019-2020 Natalia Portillo.
2019-10-12 23:53:29 +01:00
*
* 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"
2019-10-13 00:05:13 +01:00
#if defined(__linux__) && !defined(__ANDROID__)
#include "linux/linux.h"
2019-10-20 23:05:34 +01:00
#elif defined(GEKKO)
#include "wii/wii.h"
2019-10-27 03:30:13 +00:00
#elif defined(WIN32)
#include "win32/win32.h"
2019-10-13 00:05:13 +01:00
#endif
2019-10-13 14:11:54 +01:00
#include <stdlib.h>
2019-10-12 23:53:29 +01:00
DeviceInfoList* ListDevices()
{
2019-10-13 00:05:13 +01:00
#if defined(__linux__) && !defined(__ANDROID__)
2019-10-19 18:30:45 +01:00
return LinuxListDevices();
2019-10-20 23:05:34 +01:00
#elif defined(GEKKO)
return WiiListDevices();
2019-10-27 03:30:13 +00:00
#elif defined(WIN32)
return Win32ListDevices();
2019-10-13 00:05:13 +01:00
#else
2019-10-13 14:11:54 +01:00
return NULL;
2019-10-13 00:05:13 +01:00
#endif
2019-10-13 14:11:54 +01:00
}
void FreeDeviceInfoList(DeviceInfoList* start)
{
DeviceInfoList* current;
while(start)
{
current = start;
start = current->next;
free(current);
}
2019-10-13 15:11:45 +01:00
}
uint16_t DeviceInfoListCount(DeviceInfoList* start)
{
uint16_t count = 0;
DeviceInfoList* current;
while(start)
{
current = start;
start = current->next;
count++;
}
return count;
2019-10-12 23:53:29 +01:00
}