RetroArch
Macros | Functions | Variables
platform_unix.c File Reference
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/utsname.h>
#include <sys/resource.h>
#include <signal.h>
#include <pthread.h>
#include <boolean.h>
#include <retro_dirent.h>
#include <retro_inline.h>
#include <compat/strl.h>
#include <compat/fopen_utf8.h>
#include <rhash.h>
#include <lists/file_list.h>
#include <file/file_path.h>
#include <streams/file_stream.h>
#include <string/stdstring.h>
#include <queues/task_queue.h>
#include <retro_timers.h>
#include "../frontend.h"
#include "../frontend_driver.h"
#include "../../defaults.h"
#include "../../retroarch.h"
#include "../../verbosity.h"
#include "../../paths.h"
#include "platform_unix.h"
#include "../../command.h"
Include dependency graph for platform_unix.c:

Macros

#define ACPI_VAL_CHARGING_DISCHARGING   0xf268327aU
 
#define ACPI_VAL_ONLINE   0x6842bf17U
 

Functions

int system_property_get (const char *command, const char *args, char *value)
 
static bool make_proc_acpi_key_val (char **_ptr, char **_key, char **_val)
 
static void check_proc_acpi_battery (const char *node, bool *have_battery, bool *charging, int *seconds, int *percent)
 
static void check_proc_acpi_sysfs_battery (const char *node, bool *have_battery, bool *charging, int *seconds, int *percent)
 
static void check_proc_acpi_ac_adapter (const char *node, bool *have_ac)
 
static void check_proc_acpi_sysfs_ac_adapter (const char *node, bool *have_ac)
 
static bool next_string (char **_ptr, char **_str)
 
static bool int_string (char *str, int *val)
 
static bool frontend_unix_powerstate_check_apm (enum frontend_powerstate *state, int *seconds, int *percent)
 
static bool frontend_unix_powerstate_check_acpi (enum frontend_powerstate *state, int *seconds, int *percent)
 
static bool frontend_unix_powerstate_check_acpi_sysfs (enum frontend_powerstate *state, int *seconds, int *percent)
 
static int frontend_unix_get_rating (void)
 
static enum frontend_powerstate frontend_unix_get_powerstate (int *seconds, int *percent)
 
static enum frontend_architecture frontend_unix_get_architecture (void)
 
static void frontend_unix_get_os (char *s, size_t len, int *major, int *minor)
 
static void frontend_unix_get_env (int *argc, char *argv[], void *data, void *params_data)
 
static void frontend_unix_deinit (void *data)
 
static void frontend_unix_init (void *data)
 
static int frontend_unix_parse_drive_list (void *data, bool load_content)
 
static bool frontend_unix_set_fork (enum frontend_fork fork_mode)
 
static void frontend_unix_exec (const char *path, bool should_load_game)
 
static void frontend_unix_exitspawn (char *core_path, size_t core_path_size)
 
static uint64_t frontend_unix_get_mem_total (void)
 
static uint64_t frontend_unix_get_mem_used (void)
 
static void frontend_unix_sighandler (int sig)
 
static void frontend_unix_install_signal_handlers (void)
 
static int frontend_unix_get_signal_handler_state (void)
 
static void frontend_unix_set_signal_handler_state (int value)
 
static void frontend_unix_destroy_signal_handler_state (void)
 
static void frontend_unix_watch_path_for_changes (struct string_list *list, int flags, path_change_data_t **change_data)
 
static bool frontend_unix_check_for_path_changes (path_change_data_t *change_data)
 
static void frontend_unix_set_sustained_performance_mode (bool on)
 

Variables

static const char * proc_apm_path = "/proc/apm"
 
static const char * proc_acpi_battery_path = "/proc/acpi/battery"
 
static const char * proc_acpi_sysfs_ac_adapter_path = "/sys/class/power_supply/ACAD"
 
static const char * proc_acpi_sysfs_battery_path = "/sys/class/power_supply"
 
static const char * proc_acpi_ac_adapter_path = "/proc/acpi/ac_adapter"
 
static volatile sig_atomic_t unix_sighandler_quit
 
static enum frontend_fork unix_fork_mode = FRONTEND_FORK_NONE
 
frontend_ctx_driver_t frontend_ctx_unix
 

Macro Definition Documentation

◆ ACPI_VAL_CHARGING_DISCHARGING

#define ACPI_VAL_CHARGING_DISCHARGING   0xf268327aU

◆ ACPI_VAL_ONLINE

#define ACPI_VAL_ONLINE   0x6842bf17U

Function Documentation

◆ check_proc_acpi_ac_adapter()

static void check_proc_acpi_ac_adapter ( const char *  node,
bool have_ac 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_proc_acpi_battery()

static void check_proc_acpi_battery ( const char *  node,
bool have_battery,
bool charging,
int *  seconds,
int *  percent 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_proc_acpi_sysfs_ac_adapter()

static void check_proc_acpi_sysfs_ac_adapter ( const char *  node,
bool have_ac 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_proc_acpi_sysfs_battery()

static void check_proc_acpi_sysfs_battery ( const char *  node,
bool have_battery,
bool charging,
int *  seconds,
int *  percent 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ frontend_unix_check_for_path_changes()

static bool frontend_unix_check_for_path_changes ( path_change_data_t change_data)
static
Here is the call graph for this function:

◆ frontend_unix_deinit()

static void frontend_unix_deinit ( void data)
static
Here is the caller graph for this function:

◆ frontend_unix_destroy_signal_handler_state()

static void frontend_unix_destroy_signal_handler_state ( void  )
static

◆ frontend_unix_exec()

static void frontend_unix_exec ( const char *  path,
bool  should_load_game 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ frontend_unix_exitspawn()

static void frontend_unix_exitspawn ( char *  core_path,
size_t  core_path_size 
)
static
Here is the call graph for this function:

◆ frontend_unix_get_architecture()

static enum frontend_architecture frontend_unix_get_architecture ( void  )
static
Here is the call graph for this function:

◆ frontend_unix_get_env()

static void frontend_unix_get_env ( int *  argc,
char *  argv[],
void data,
void params_data 
)
static
Here is the call graph for this function:

◆ frontend_unix_get_mem_total()

static uint64_t frontend_unix_get_mem_total ( void  )
static

◆ frontend_unix_get_mem_used()

static uint64_t frontend_unix_get_mem_used ( void  )
static

◆ frontend_unix_get_os()

static void frontend_unix_get_os ( char *  s,
size_t  len,
int *  major,
int *  minor 
)
static

◆ frontend_unix_get_powerstate()

static enum frontend_powerstate frontend_unix_get_powerstate ( int *  seconds,
int *  percent 
)
static
Here is the call graph for this function:

◆ frontend_unix_get_rating()

static int frontend_unix_get_rating ( void  )
static
Here is the call graph for this function:

◆ frontend_unix_get_signal_handler_state()

static int frontend_unix_get_signal_handler_state ( void  )
static

◆ frontend_unix_init()

static void frontend_unix_init ( void data)
static
Here is the call graph for this function:

◆ frontend_unix_install_signal_handlers()

static void frontend_unix_install_signal_handlers ( void  )
static
Here is the call graph for this function:

◆ frontend_unix_parse_drive_list()

static int frontend_unix_parse_drive_list ( void data,
bool  load_content 
)
static
Here is the call graph for this function:

◆ frontend_unix_powerstate_check_acpi()

static bool frontend_unix_powerstate_check_acpi ( enum frontend_powerstate state,
int *  seconds,
int *  percent 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ frontend_unix_powerstate_check_acpi_sysfs()

static bool frontend_unix_powerstate_check_acpi_sysfs ( enum frontend_powerstate state,
int *  seconds,
int *  percent 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ frontend_unix_powerstate_check_apm()

static bool frontend_unix_powerstate_check_apm ( enum frontend_powerstate state,
int *  seconds,
int *  percent 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ frontend_unix_set_fork()

static bool frontend_unix_set_fork ( enum frontend_fork  fork_mode)
static
Here is the call graph for this function:

◆ frontend_unix_set_signal_handler_state()

static void frontend_unix_set_signal_handler_state ( int  value)
static

◆ frontend_unix_set_sustained_performance_mode()

static void frontend_unix_set_sustained_performance_mode ( bool  on)
static

◆ frontend_unix_sighandler()

static void frontend_unix_sighandler ( int  sig)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ frontend_unix_watch_path_for_changes()

static void frontend_unix_watch_path_for_changes ( struct string_list list,
int  flags,
path_change_data_t **  change_data 
)
static
Here is the call graph for this function:

◆ int_string()

static bool int_string ( char *  str,
int *  val 
)
static
Here is the caller graph for this function:

◆ make_proc_acpi_key_val()

static bool make_proc_acpi_key_val ( char **  _ptr,
char **  _key,
char **  _val 
)
static
Here is the caller graph for this function:

◆ next_string()

static bool next_string ( char **  _ptr,
char **  _str 
)
static
Here is the caller graph for this function:

◆ system_property_get()

int system_property_get ( const char *  command,
const char *  args,
char *  value 
)
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ frontend_ctx_unix

frontend_ctx_driver_t frontend_ctx_unix

◆ proc_acpi_ac_adapter_path

const char* proc_acpi_ac_adapter_path = "/proc/acpi/ac_adapter"
static

◆ proc_acpi_battery_path

const char* proc_acpi_battery_path = "/proc/acpi/battery"
static

◆ proc_acpi_sysfs_ac_adapter_path

const char* proc_acpi_sysfs_ac_adapter_path = "/sys/class/power_supply/ACAD"
static

◆ proc_acpi_sysfs_battery_path

const char* proc_acpi_sysfs_battery_path = "/sys/class/power_supply"
static

◆ proc_apm_path

const char* proc_apm_path = "/proc/apm"
static

◆ unix_fork_mode

enum frontend_fork unix_fork_mode = FRONTEND_FORK_NONE
static

◆ unix_sighandler_quit

volatile sig_atomic_t unix_sighandler_quit
static