mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 10:37:38 -04:00
Add support for errno in plugins.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24109 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
eeb1f3e25e
commit
081da63d09
3 changed files with 7 additions and 0 deletions
|
@ -40,6 +40,7 @@
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
#include "storage.h"
|
#include "storage.h"
|
||||||
#include "pcmbuf.h"
|
#include "pcmbuf.h"
|
||||||
|
#include "errno.h"
|
||||||
|
|
||||||
#if CONFIG_CHARGING
|
#if CONFIG_CHARGING
|
||||||
#include "power.h"
|
#include "power.h"
|
||||||
|
@ -680,6 +681,7 @@ static const struct plugin_api rockbox_api = {
|
||||||
viewportmanager_theme_enable,
|
viewportmanager_theme_enable,
|
||||||
viewportmanager_theme_undo,
|
viewportmanager_theme_undo,
|
||||||
#endif
|
#endif
|
||||||
|
&errno
|
||||||
};
|
};
|
||||||
|
|
||||||
int plugin_load(const char* plugin, const void* parameter)
|
int plugin_load(const char* plugin, const void* parameter)
|
||||||
|
|
|
@ -860,6 +860,7 @@ struct plugin_api {
|
||||||
struct viewport *viewport);
|
struct viewport *viewport);
|
||||||
void (*viewportmanager_theme_undo)(enum screen_type screen, bool force_redraw);
|
void (*viewportmanager_theme_undo)(enum screen_type screen, bool force_redraw);
|
||||||
#endif
|
#endif
|
||||||
|
int* __errno;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* plugin header */
|
/* plugin header */
|
||||||
|
|
|
@ -10,7 +10,11 @@
|
||||||
|
|
||||||
#ifndef _SYS_ERRNO_H_
|
#ifndef _SYS_ERRNO_H_
|
||||||
|
|
||||||
|
#ifdef PLUGIN
|
||||||
|
#define errno (*rb->__errno)
|
||||||
|
#else
|
||||||
extern int errno;
|
extern int errno;
|
||||||
|
#endif
|
||||||
|
|
||||||
#define EPERM 1 /* Not super-user */
|
#define EPERM 1 /* Not super-user */
|
||||||
#define ENOENT 2 /* No such file or directory */
|
#define ENOENT 2 /* No such file or directory */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue