forked from len0rd/rockbox
Plugin parameters should be const.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17492 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
a94e40d515
commit
6526577818
159 changed files with 363 additions and 371 deletions
|
@ -600,7 +600,7 @@ static const struct plugin_api rockbox_api = {
|
|||
#endif /* HAVE_BUTTON_LIGHT */
|
||||
};
|
||||
|
||||
int plugin_load(const char* plugin, void* parameter)
|
||||
int plugin_load(const char* plugin, const void* parameter)
|
||||
{
|
||||
int rc;
|
||||
struct plugin_header *hdr;
|
||||
|
@ -719,8 +719,7 @@ int plugin_load(const char* plugin, void* parameter)
|
|||
|
||||
invalidate_icache();
|
||||
|
||||
rc = hdr->entry_point((struct plugin_api*) &rockbox_api, parameter);
|
||||
/* explicitly casting the pointer here to avoid touching every plugin. */
|
||||
rc = hdr->entry_point(&rockbox_api, parameter);
|
||||
|
||||
button_clear_queue();
|
||||
|
||||
|
|
|
@ -120,12 +120,12 @@
|
|||
#define PLUGIN_MAGIC 0x526F634B /* RocK */
|
||||
|
||||
/* increase this every time the api struct changes */
|
||||
#define PLUGIN_API_VERSION 111
|
||||
#define PLUGIN_API_VERSION 112
|
||||
|
||||
/* update this to latest version if a change to the api struct breaks
|
||||
backwards compatibility (and please take the opportunity to sort in any
|
||||
new function which are "waiting" at the end of the function table) */
|
||||
#define PLUGIN_MIN_API_VERSION 108
|
||||
#define PLUGIN_MIN_API_VERSION 112
|
||||
|
||||
/* plugin return codes */
|
||||
enum plugin_status {
|
||||
|
@ -754,7 +754,7 @@ struct plugin_header {
|
|||
unsigned short api_version;
|
||||
unsigned char *load_addr;
|
||||
unsigned char *end_addr;
|
||||
enum plugin_status(*entry_point)(struct plugin_api*, void*);
|
||||
enum plugin_status(*entry_point)(const struct plugin_api*, const void*);
|
||||
};
|
||||
|
||||
#ifdef PLUGIN
|
||||
|
@ -792,7 +792,7 @@ extern unsigned char plugin_end_addr[];
|
|||
#endif /* PLUGIN_USE_IRAM */
|
||||
#endif /* PLUGIN */
|
||||
|
||||
int plugin_load(const char* plugin, void* parameter);
|
||||
int plugin_load(const char* plugin, const void* parameter);
|
||||
void* plugin_get_buffer(size_t *buffer_size);
|
||||
void* plugin_get_audio_buffer(size_t *buffer_size);
|
||||
#ifdef PLUGIN_USE_IRAM
|
||||
|
@ -806,7 +806,7 @@ void plugin_iram_init(char *iramstart, char *iramcopy, size_t iram_size,
|
|||
void plugin_tsr(bool (*exit_callback)(bool reenter));
|
||||
|
||||
/* defined by the plugin */
|
||||
enum plugin_status plugin_start(struct plugin_api* rockbox, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* rockbox, const void* parameter)
|
||||
NO_PROF_ATTR;
|
||||
|
||||
/* Use this macro in plugins where gcc tries to optimize by calling
|
||||
|
|
|
@ -133,8 +133,8 @@ void sound_neutral(void); /* set to everything flat and 0 dB volume */
|
|||
void sound_normal(void); /* return to user settings */
|
||||
|
||||
void thread(void); /* the thread running it all */
|
||||
int main(void* parameter); /* main loop */
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter); /* entry */
|
||||
int main(const void* parameter); /* main loop */
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter); /* entry */
|
||||
|
||||
|
||||
/****************** data types ******************/
|
||||
|
@ -207,7 +207,7 @@ struct
|
|||
struct thread_entry *thread; /* worker thread id */
|
||||
} gTread;
|
||||
|
||||
static struct plugin_api* rb; /* here is the global API struct pointer */
|
||||
static const struct plugin_api* rb; /* here is the global API struct pointer */
|
||||
|
||||
|
||||
/****************** implementation ******************/
|
||||
|
@ -1133,7 +1133,7 @@ bool exit_tsr(bool reenter)
|
|||
/****************** main ******************/
|
||||
|
||||
|
||||
int main(void* parameter)
|
||||
int main(const void* parameter)
|
||||
{
|
||||
(void)parameter;
|
||||
#ifdef DEBUG
|
||||
|
@ -1189,7 +1189,7 @@ int main(void* parameter)
|
|||
/***************** Plugin Entry Point *****************/
|
||||
|
||||
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
rb = api; /* copy to global api pointer */
|
||||
|
||||
|
|
|
@ -169,14 +169,14 @@ PLUGIN_HEADER
|
|||
#endif
|
||||
|
||||
/****************************** Plugin Entry Point ****************************/
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
MEM_FUNCTION_WRAPPERS(rb);
|
||||
int main(void);
|
||||
bool exit_tsr(bool);
|
||||
void thread(void);
|
||||
|
||||
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
(void)parameter;
|
||||
rb = api;
|
||||
|
|
|
@ -178,7 +178,7 @@ const unsigned char * drumNames[]={
|
|||
long gmbuf[BUF_SIZE*NBUF];
|
||||
|
||||
int quit=0;
|
||||
struct plugin_api * rb;
|
||||
const struct plugin_api * rb;
|
||||
|
||||
|
||||
#define STATE_STOPPED 0
|
||||
|
@ -232,7 +232,7 @@ int editState=EDITSTATE_PATTERN;
|
|||
int playState=STATE_STOPPED, stepFlag=0;
|
||||
|
||||
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
int retval = 0;
|
||||
|
||||
|
|
|
@ -313,7 +313,7 @@ extern const fb_data card_back[];
|
|||
#define NEXT_CARD bj->player_cards[done][bj->num_player_cards[done]]
|
||||
|
||||
/* global rockbox api */
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
|
||||
MEM_FUNCTION_WRAPPERS(rb);
|
||||
|
||||
|
@ -1529,7 +1529,8 @@ static int blackjack(struct game_context* bj) {
|
|||
/*****************************************************************************
|
||||
* plugin entry point.
|
||||
******************************************************************************/
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter) {
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
struct game_context bj;
|
||||
bool exit = false;
|
||||
unsigned int position;
|
||||
|
|
|
@ -167,7 +167,7 @@ PLUGIN_HEADER
|
|||
#endif
|
||||
#endif
|
||||
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
|
||||
#define LETTER_WIDTH 11
|
||||
#define LETTER_HEIGHT 16
|
||||
|
@ -573,7 +573,7 @@ static int loopit(void)
|
|||
}
|
||||
|
||||
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
int w, h;
|
||||
char *off = "[Off] to stop";
|
||||
|
|
|
@ -195,7 +195,7 @@ PLUGIN_HEADER
|
|||
#endif
|
||||
|
||||
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
|
||||
enum menu_items {
|
||||
BM_START,
|
||||
|
@ -2015,7 +2015,7 @@ int game_loop(void)
|
|||
}
|
||||
|
||||
/* this is the plugin entry point */
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
(void)parameter;
|
||||
rb = api;
|
||||
|
|
|
@ -192,7 +192,7 @@ PLUGIN_HEADER
|
|||
#define MIN_DISTANCE ((BUBBLE_WIDTH*8)/10)*((BUBBLE_HEIGHT*8)/10)
|
||||
|
||||
/* global rockbox api */
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
|
||||
/* levels */
|
||||
char level[NUM_LEVELS][BB_LEVEL_HEIGHT][BB_WIDTH] = {
|
||||
|
@ -2585,7 +2585,7 @@ static int bubbles(struct game_context* bb) {
|
|||
/*****************************************************************************
|
||||
* plugin entry point.
|
||||
******************************************************************************/
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter) {
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter) {
|
||||
struct game_context bb;
|
||||
bool exit = false;
|
||||
int position;
|
||||
|
|
|
@ -290,7 +290,7 @@ PLUGIN_HEADER
|
|||
#endif
|
||||
#endif
|
||||
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
MEM_FUNCTION_WRAPPERS(rb);
|
||||
|
||||
enum {
|
||||
|
@ -1536,7 +1536,7 @@ void sciButtonsProcess(void){
|
|||
/* -----------------------------------------------------------------------
|
||||
Main();
|
||||
----------------------------------------------------------------------- */
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
(void)parameter;
|
||||
rb = api;
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
PLUGIN_HEADER
|
||||
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
|
||||
static bool leap_year;
|
||||
static int days_in_month[2][13] = {
|
||||
|
@ -659,7 +659,7 @@ static void prev_day(struct shown *shown, int step)
|
|||
draw_calendar(shown);
|
||||
}
|
||||
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
struct today today;
|
||||
struct shown shown;
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
PLUGIN_HEADER
|
||||
|
||||
/* this is the plugin entry point */
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
return run_overlay(api, parameter, PLUGIN_GAMES_DIR "/chessbox.ovl", "ChessBox");
|
||||
}
|
||||
|
|
|
@ -902,7 +902,7 @@ void cb_play_game(void) {
|
|||
/*****************************************************************************
|
||||
* plugin entry point.
|
||||
******************************************************************************/
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter) {
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter) {
|
||||
|
||||
/* plugin init */
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#define LOG_FILE PLUGIN_GAMES_DIR "/chessbox.log"
|
||||
int loghandler;
|
||||
|
||||
struct plugin_api* rb;
|
||||
const struct plugin_api* rb;
|
||||
|
||||
short kn_offs[8][2] = {{2,1},{2,-1},{-2,1},{-2,-1},{1,2},{1,-2},{-1,2},{-1,-2}};
|
||||
short rk_offs[4][2] = {{1,0},{-1,0},{0,1},{0,-1}};
|
||||
|
@ -556,7 +556,7 @@ void write_pgn_token(int fhandler, char *buffer, size_t *line_length){
|
|||
}
|
||||
|
||||
/* ---- api functions ---- */
|
||||
struct pgn_game_node* pgn_list_games(struct plugin_api* api,const char* filename){
|
||||
struct pgn_game_node* pgn_list_games(const struct plugin_api* api,const char* filename){
|
||||
int fhandler;
|
||||
char line_buffer[128];
|
||||
struct pgn_game_node size_node, *first_game = NULL;
|
||||
|
@ -614,7 +614,7 @@ struct pgn_game_node* pgn_list_games(struct plugin_api* api,const char* filename
|
|||
return first_game;
|
||||
}
|
||||
|
||||
struct pgn_game_node* pgn_show_game_list(struct plugin_api* api,
|
||||
struct pgn_game_node* pgn_show_game_list(const struct plugin_api* api,
|
||||
struct pgn_game_node* first_game){
|
||||
int curr_selection = 0;
|
||||
int button;
|
||||
|
@ -659,7 +659,7 @@ struct pgn_game_node* pgn_show_game_list(struct plugin_api* api,
|
|||
}
|
||||
}
|
||||
|
||||
void pgn_parse_game(struct plugin_api* api, const char* filename,
|
||||
void pgn_parse_game(const struct plugin_api* api, const char* filename,
|
||||
struct pgn_game_node* selected_game){
|
||||
struct pgn_ply_node size_ply, *first_ply = NULL;
|
||||
struct pgn_ply_node *temp_ply = NULL, *curr_node = NULL;
|
||||
|
@ -729,7 +729,7 @@ void pgn_parse_game(struct plugin_api* api, const char* filename,
|
|||
rb->close(fhandler);
|
||||
}
|
||||
|
||||
struct pgn_game_node* pgn_init_game(struct plugin_api* api){
|
||||
struct pgn_game_node* pgn_init_game(const struct plugin_api* api){
|
||||
struct pgn_game_node game_size, *game;
|
||||
struct pgn_ply_node ply_size, *ply;
|
||||
struct tm *current_time;
|
||||
|
@ -767,7 +767,7 @@ struct pgn_game_node* pgn_init_game(struct plugin_api* api){
|
|||
return game;
|
||||
}
|
||||
|
||||
void pgn_append_ply(struct plugin_api* api, struct pgn_game_node* game,
|
||||
void pgn_append_ply(const struct plugin_api* api, struct pgn_game_node* game,
|
||||
unsigned short ply_player, char *move_buffer, bool is_mate){
|
||||
struct pgn_ply_node ply_size, *ply, *temp;
|
||||
|
||||
|
@ -801,7 +801,7 @@ void pgn_append_ply(struct plugin_api* api, struct pgn_game_node* game,
|
|||
temp->prev_node = ply;
|
||||
}
|
||||
|
||||
void pgn_set_result(struct plugin_api* api, struct pgn_game_node* game,
|
||||
void pgn_set_result(const struct plugin_api* api, struct pgn_game_node* game,
|
||||
bool is_mate){
|
||||
|
||||
rb = api;
|
||||
|
@ -815,7 +815,7 @@ void pgn_set_result(struct plugin_api* api, struct pgn_game_node* game,
|
|||
}
|
||||
}
|
||||
|
||||
void pgn_store_game(struct plugin_api* api, struct pgn_game_node* game){
|
||||
void pgn_store_game(const struct plugin_api* api, struct pgn_game_node* game){
|
||||
int fhandler;
|
||||
struct pgn_ply_node *ply;
|
||||
unsigned ply_count;
|
||||
|
|
|
@ -350,35 +350,35 @@ struct pgn_game_node {
|
|||
* the user selects a game, that obviously saves processing
|
||||
* and speeds up response when the user selects the file
|
||||
*/
|
||||
struct pgn_game_node* pgn_list_games(struct plugin_api* api,
|
||||
struct pgn_game_node* pgn_list_games(const struct plugin_api* api,
|
||||
const char* filename);
|
||||
|
||||
/* Show the list of games found in a file and allow the user
|
||||
* to select a game to be parsed and showed
|
||||
*/
|
||||
struct pgn_game_node* pgn_show_game_list(struct plugin_api* api,
|
||||
struct pgn_game_node* pgn_show_game_list(const struct plugin_api* api,
|
||||
struct pgn_game_node* first_game);
|
||||
|
||||
/* Parse the pgn string of a game and assign it to the move
|
||||
* list in the structure
|
||||
*/
|
||||
void pgn_parse_game(struct plugin_api* api, const char* filename,
|
||||
void pgn_parse_game(const struct plugin_api* api, const char* filename,
|
||||
struct pgn_game_node* selected_game);
|
||||
|
||||
/* Initialize a new game structure with default values and make
|
||||
* it ready to store the history of a newly played match
|
||||
*/
|
||||
struct pgn_game_node* pgn_init_game(struct plugin_api* api);
|
||||
struct pgn_game_node* pgn_init_game(const struct plugin_api* api);
|
||||
|
||||
/* Add a new ply to the game structure based on the positions */
|
||||
void pgn_append_ply(struct plugin_api* api, struct pgn_game_node* game,
|
||||
void pgn_append_ply(const struct plugin_api* api, struct pgn_game_node* game,
|
||||
unsigned short ply_player, char *move_buffer, bool is_mate);
|
||||
|
||||
/* Set the result of the game if it was reached during the opponent's ply
|
||||
*/
|
||||
void pgn_set_result(struct plugin_api* api, struct pgn_game_node* game,
|
||||
void pgn_set_result(const struct plugin_api* api, struct pgn_game_node* game,
|
||||
bool is_mate);
|
||||
|
||||
/* Store a complete game in the PGN history file
|
||||
*/
|
||||
void pgn_store_game(struct plugin_api* api, struct pgn_game_node* game);
|
||||
void pgn_store_game(const struct plugin_api* api, struct pgn_game_node* game);
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
#define taxicab(a,b) (abs(column[a]-column[b]) + abs(row[a]-row[b]))
|
||||
|
||||
/* ---- RockBox datatypes and variables */
|
||||
struct plugin_api* rb;
|
||||
const struct plugin_api* rb;
|
||||
|
||||
/* ---- Chess datatypes and variables ---- */
|
||||
struct leaf
|
||||
|
|
|
@ -44,7 +44,7 @@ extern struct TimeControlRec TimeControl;
|
|||
extern struct GameRec GameList[240];
|
||||
|
||||
/* ---- RockBox integration ---- */
|
||||
extern struct plugin_api* rb;
|
||||
extern const struct plugin_api* rb;
|
||||
|
||||
/* ---- The beginning of a GNUChess v2 APIfication ---- */
|
||||
void SetTimeControl(void);
|
||||
|
|
|
@ -224,7 +224,7 @@ PLUGIN_HEADER
|
|||
/* here is a global api struct pointer. while not strictly necessary,
|
||||
it's nice not to have to pass the api pointer in all function calls
|
||||
in the plugin */
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
MEM_FUNCTION_WRAPPERS(rb);
|
||||
#define MAX_PLAYERS 10
|
||||
|
||||
|
@ -257,7 +257,7 @@ static bool pause;
|
|||
#define MAX_TIME 7200
|
||||
|
||||
/* this is the plugin entry point */
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
int i;
|
||||
bool done;
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
PLUGIN_HEADER
|
||||
|
||||
static struct plugin_api* rb; /* here is a global api struct pointer */
|
||||
static const struct plugin_api* rb; /* here is a global api struct pointer */
|
||||
|
||||
#define EXTERN static
|
||||
#define STATIC static
|
||||
|
@ -1287,7 +1287,7 @@ static void chip8_interrupt (void)
|
|||
starttimer = newtimer - runtime;
|
||||
}
|
||||
|
||||
static bool chip8_init(char* file)
|
||||
static bool chip8_init(const char* file)
|
||||
{
|
||||
int numread;
|
||||
int fd;
|
||||
|
@ -1307,14 +1307,16 @@ static bool chip8_init(char* file)
|
|||
|
||||
rb->close(fd);
|
||||
/* is there a c8k file (chip8 keys) ? */
|
||||
char c8kname[MAX_PATH];
|
||||
rb->strcpy(c8kname, file);
|
||||
for(i=0; i<16; i++) {
|
||||
chip8_virtual_keys[i] = 0;
|
||||
chip8_keymap[i] = i;
|
||||
}
|
||||
len = rb->strlen(file);
|
||||
file[len-2] = '8';
|
||||
file[len-1] = 'k';
|
||||
fd = rb->open(file, O_RDONLY);
|
||||
len = rb->strlen(c8kname);
|
||||
c8kname[len-2] = '8';
|
||||
c8kname[len-1] = 'k';
|
||||
fd = rb->open(c8kname, O_RDONLY);
|
||||
if (fd!=-1) {
|
||||
rb->lcd_puts(0, 6, "File&Keymap OK.");
|
||||
numread = rb->read(fd, chip8_keymap, 16);
|
||||
|
@ -1340,7 +1342,7 @@ static bool chip8_init(char* file)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool chip8_run(char* file)
|
||||
bool chip8_run(const char* file)
|
||||
{
|
||||
int ok;
|
||||
|
||||
|
@ -1406,9 +1408,9 @@ bool chip8_run(char* file)
|
|||
|
||||
/***************** Plugin Entry Point *****************/
|
||||
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
char* filename;
|
||||
const char* filename;
|
||||
|
||||
rb = api; /* copy to global api pointer */
|
||||
|
||||
|
|
|
@ -125,7 +125,7 @@ Still To do:
|
|||
#endif
|
||||
#endif
|
||||
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
|
||||
#define NUMBER_OF_BLOCKS 8
|
||||
#define NUMBER_OF_PARTICLES 3
|
||||
|
@ -979,7 +979,7 @@ void chopper_load(bool newgame)
|
|||
}
|
||||
|
||||
/* this is the plugin entry point */
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
(void)parameter;
|
||||
rb = api;
|
||||
|
|
|
@ -54,7 +54,7 @@ const struct button_mapping* plugin_contexts[]={
|
|||
#define ACTION_SKIN_PREV PLA_DEC
|
||||
#define ACTION_SKIN_PREV_REPEAT PLA_DEC_REPEAT
|
||||
|
||||
extern struct plugin_api* rb;
|
||||
extern const struct plugin_api* rb;
|
||||
|
||||
/**************************
|
||||
* Cleanup on plugin return
|
||||
|
@ -109,7 +109,7 @@ void format_date(char* buffer, struct time* time, enum date_format format){
|
|||
/**********************************************************************
|
||||
* Plugin starts here
|
||||
**********************************************************************/
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter){
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter){
|
||||
int button;
|
||||
int last_second = -1;
|
||||
bool redraw=true;
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#ifndef _CLOCK_
|
||||
#define _CLOCK_
|
||||
#include "clock_settings.h"
|
||||
extern struct plugin_api* rb;
|
||||
extern const struct plugin_api* rb;
|
||||
|
||||
struct time{
|
||||
int year, day, month;
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
PLUGIN_HEADER
|
||||
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
|
||||
const char* const credits[] = {
|
||||
#include "credits.raw" /* generated list of names from docs/CREDITS */
|
||||
|
@ -367,7 +367,7 @@ void roll_credits(void)
|
|||
|
||||
#endif
|
||||
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
(void)parameter;
|
||||
rb = api;
|
||||
|
|
|
@ -425,7 +425,7 @@ static long matrice[3][3];
|
|||
static const int nb_points = 8;
|
||||
static long z_off = 600;
|
||||
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
|
||||
static void cube_rotate(int xa, int ya, int za)
|
||||
{
|
||||
|
@ -580,7 +580,7 @@ void cleanup(void *parameter)
|
|||
#endif
|
||||
}
|
||||
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
char buffer[30];
|
||||
int t_disp = 0;
|
||||
|
|
|
@ -65,7 +65,7 @@ struct line_color
|
|||
|
||||
/******************************* Globals ***********************************/
|
||||
|
||||
static struct plugin_api* rb; /* global api struct pointer */
|
||||
static const struct plugin_api* rb; /* global api struct pointer */
|
||||
|
||||
/*
|
||||
* Compute a new random step to make the point bounce the borders of the screen
|
||||
|
@ -424,7 +424,7 @@ int plugin_main(void)
|
|||
|
||||
/*************************** Plugin entry point ****************************/
|
||||
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ struct dices
|
|||
#define PRINT_BUFFER_LENGTH MAX_DICES*4
|
||||
PLUGIN_HEADER
|
||||
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
static struct dices dice;
|
||||
static int sides_index;
|
||||
|
||||
|
@ -72,7 +72,7 @@ void dice_print(struct dices* dice, struct screen* display);
|
|||
bool dice_menu(struct dices* dice);
|
||||
|
||||
/* plugin entry point */
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter) {
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter) {
|
||||
(void)parameter;
|
||||
rb = api;
|
||||
int i, action;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
PLUGIN_HEADER
|
||||
|
||||
/* save the plugin api pointer. */
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
/* screen info */
|
||||
static int display_columns, display_lines;
|
||||
|
||||
|
@ -138,7 +138,7 @@ long reverse (long N) {
|
|||
#define DICT_DESC ROCKBOX_DIR "/rocks/apps/dict.desc"
|
||||
|
||||
/* the main plugin function */
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
char searchword[WORDLEN]; /* word to search for */
|
||||
char *description; /* pointer to description buffer */
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "plugin.h"
|
||||
|
||||
PLUGIN_HEADER
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
|
||||
/* function return values */
|
||||
enum tidy_return
|
||||
|
@ -412,7 +412,7 @@ int tidy_lcd_menu(void)
|
|||
}
|
||||
|
||||
/* this is the plugin entry point */
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
enum tidy_system system = TIDY_ALL;
|
||||
enum tidy_return status;
|
||||
|
|
|
@ -99,7 +99,7 @@ int my_close(int id)
|
|||
return 0;
|
||||
}
|
||||
#endif
|
||||
struct plugin_api* rb;
|
||||
const struct plugin_api* rb;
|
||||
#define MAXARGVS 100
|
||||
|
||||
bool noprintf=0; // Variable disables printf lcd updates to protect grayscale lib/direct lcd updates
|
||||
|
@ -675,7 +675,7 @@ int doom_menu()
|
|||
|
||||
extern int systemvol;
|
||||
/* this is the plugin entry point */
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
PLUGIN_IRAM_INIT(api)
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include "autoconf.h"
|
||||
#include "z_zone.h"
|
||||
|
||||
extern struct plugin_api* rb;
|
||||
extern const struct plugin_api* rb;
|
||||
extern bool noprintf;
|
||||
extern bool doomexit;
|
||||
|
||||
|
|
|
@ -140,7 +140,7 @@ static unsigned char *abbrev_str[12] = {
|
|||
|
||||
static unsigned long heuro,hhome; /*Handles for the new patterns*/
|
||||
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
|
||||
static char *currency_str[12] = {
|
||||
"France",
|
||||
|
@ -402,7 +402,7 @@ static void euro_exit(void *parameter)
|
|||
|
||||
|
||||
/* this is the plugin entry point */
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
bool end, pos;
|
||||
longlong_t e,h,old_e,old_h;
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
|
||||
PLUGIN_HEADER
|
||||
|
||||
static struct plugin_api* rb; /* global api struct pointer */
|
||||
static const struct plugin_api* rb; /* global api struct pointer */
|
||||
|
||||
#ifndef HAVE_LCD_COLOR
|
||||
GREY_INFO_STRUCT
|
||||
|
@ -344,7 +344,7 @@ int main(void)
|
|||
|
||||
/*************************** Plugin entry point ****************************/
|
||||
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
PLUGIN_HEADER
|
||||
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
|
||||
/***
|
||||
* FIREWORKS.C by ZAKK ROBERTS
|
||||
|
@ -385,7 +385,7 @@ void fireworks_menu(void)
|
|||
}
|
||||
|
||||
/* this is the plugin entry point */
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
(void)parameter;
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ typedef struct
|
|||
char name[32];
|
||||
} tFlashInfo;
|
||||
|
||||
static struct plugin_api* rb; /* here is a global api struct pointer */
|
||||
static const struct plugin_api* rb; /* here is a global api struct pointer */
|
||||
|
||||
#define MASK_ADR 0xFC /* position of hardware mask value in Flash */
|
||||
#define VERSION_ADR 0xFE /* position of firmware version value in Flash */
|
||||
|
@ -1072,7 +1072,7 @@ void DoUserDialog(char* filename)
|
|||
|
||||
/***************** Plugin Entry Point *****************/
|
||||
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
int oldmode;
|
||||
|
||||
|
|
|
@ -244,7 +244,7 @@ PLUGIN_HEADER
|
|||
#endif
|
||||
#endif
|
||||
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
static int spots[20];
|
||||
static int toggle[20];
|
||||
static int cursor_pos, moves;
|
||||
|
@ -591,7 +591,7 @@ static bool flipit_loop(void)
|
|||
}
|
||||
|
||||
/* called function from outside */
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
int i, rc;
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ PLUGIN_HEADER
|
|||
/******************************* Globals ***********************************/
|
||||
|
||||
GREY_INFO_STRUCT
|
||||
static struct plugin_api* rb; /* global api struct pointer */
|
||||
static const struct plugin_api* rb; /* global api struct pointer */
|
||||
static char pbuf[32]; /* global printf buffer */
|
||||
static unsigned char *gbuf;
|
||||
static size_t gbuf_size = 0;
|
||||
|
@ -361,7 +361,7 @@ int main(void)
|
|||
|
||||
/*************************** Plugin entry point ****************************/
|
||||
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
rb = api; /* copy to global api pointer */
|
||||
(void)parameter;
|
||||
|
|
|
@ -27,10 +27,10 @@ PLUGIN_HEADER
|
|||
/* here is a global api struct pointer. while not strictly necessary,
|
||||
it's nice not to have to pass the api pointer in all function calls
|
||||
in the plugin */
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
|
||||
/* this is the plugin entry point */
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
/* if you don't use the parameter, you can do like
|
||||
this to avoid the compiler warning about it */
|
||||
|
|
|
@ -595,7 +595,7 @@ unsigned char fire_sprite[FIRE_HEIGHT] = {
|
|||
#define CYCLETIME 40
|
||||
|
||||
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
|
||||
/* Physical x is at PLAYFIELD_X + LIVES_X + x * ALIEN_SPEED
|
||||
* Physical y is at y * ALIEN_HEIGHT
|
||||
|
@ -1785,7 +1785,7 @@ void game_loop(void)
|
|||
|
||||
|
||||
/* this is the plugin entry point */
|
||||
enum plugin_status plugin_start(struct plugin_api* api, UNUSED void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, UNUSED const void* parameter)
|
||||
{
|
||||
rb = api;
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ struct flash_info
|
|||
char name[32];
|
||||
};
|
||||
|
||||
static struct plugin_api* rb; /* here is a global api struct pointer */
|
||||
static const struct plugin_api* rb; /* here is a global api struct pointer */
|
||||
|
||||
#ifdef IRIVER_H100_SERIES
|
||||
#define SEC_SIZE 4096
|
||||
|
@ -802,7 +802,7 @@ void DoUserDialog(char* filename)
|
|||
|
||||
/***************** Plugin Entry Point *****************/
|
||||
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
int oldmode;
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
PLUGIN_HEADER
|
||||
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
|
||||
ssize_t buf_size;
|
||||
static char *filename;
|
||||
|
@ -130,7 +130,7 @@ static int write_file(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
char *buf;
|
||||
int rc;
|
||||
|
|
|
@ -69,7 +69,7 @@ const struct picture jackpot_pictures[]={
|
|||
#define SLEEP_TIME (HZ/200)
|
||||
#endif /* HAVE_LCD_CHARCELLS */
|
||||
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
|
||||
struct jackpot
|
||||
{
|
||||
|
@ -290,7 +290,7 @@ void jackpot_play_turn(struct jackpot* game)
|
|||
jackpot_print_turn_result(game, gain, rb->screens[d]);
|
||||
}
|
||||
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
rb = api;
|
||||
int action, i;
|
||||
|
|
|
@ -339,7 +339,7 @@ struct jewels_menu {
|
|||
};
|
||||
|
||||
/* global rockbox api */
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
|
||||
/* external bitmaps */
|
||||
extern const fb_data jewels[];
|
||||
|
@ -1898,7 +1898,7 @@ static int jewels_main(struct game_context* bj) {
|
|||
/*****************************************************************************
|
||||
* plugin entry point.
|
||||
******************************************************************************/
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter) {
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter) {
|
||||
struct game_context bj;
|
||||
bool exit = false;
|
||||
int position;
|
||||
|
|
|
@ -279,7 +279,7 @@ GREY_INFO_STRUCT
|
|||
|
||||
/******************************* Globals ***********************************/
|
||||
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
MEM_FUNCTION_WRAPPERS(rb);
|
||||
|
||||
/* for portability of below JPEG code */
|
||||
|
@ -3318,7 +3318,7 @@ int load_and_show(char* filename)
|
|||
|
||||
/******************** Plugin entry point *********************/
|
||||
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
rb = api;
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ PLUGIN_HEADER
|
|||
# endif
|
||||
#endif
|
||||
|
||||
static struct plugin_api* rb; /* global api struct pointer */
|
||||
static const struct plugin_api* rb; /* global api struct pointer */
|
||||
|
||||
#ifdef HAVE_LCD_COLOR
|
||||
/* RGB color sets */
|
||||
|
@ -102,7 +102,7 @@ static int colorset[NUM_COLORSETS][3] = { { 255, 255, 255 } , /* white */
|
|||
#endif /* HAVE_LCD_COLOR */
|
||||
|
||||
/* this is the plugin entry point */
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
(void)parameter;
|
||||
rb = api;
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
/**
|
||||
* Save to 24 bit bitmap.
|
||||
*/
|
||||
int save_bmp_file( char* filename, struct bitmap *bm, struct plugin_api* rb )
|
||||
int save_bmp_file( char* filename, struct bitmap *bm, const struct plugin_api* rb )
|
||||
{
|
||||
/* I'm not really sure about this one :) */
|
||||
int line_width = bm->width*3+((bm->width*3)%4?4-((bm->width*3)%4):0);
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
/**
|
||||
* Save bitmap to file
|
||||
*/
|
||||
int save_bmp_file( char* filename, struct bitmap *bm, struct plugin_api* rb );
|
||||
int save_bmp_file( char* filename, struct bitmap *bm, const struct plugin_api* rb );
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
/*
|
||||
* Print a checkbox
|
||||
*/
|
||||
void checkbox(struct plugin_api *api, int x, int y, int width, int height, bool checked)
|
||||
void checkbox(const struct plugin_api *api, int x, int y, int width, int height, bool checked)
|
||||
{
|
||||
/* draw box */
|
||||
api->lcd_drawrect(x, y, width, height);
|
||||
|
|
|
@ -24,6 +24,6 @@
|
|||
/*
|
||||
* Print a checkbox
|
||||
*/
|
||||
void checkbox(struct plugin_api *api, int x, int y, int width, int height, bool checked);
|
||||
void checkbox(const struct plugin_api *api, int x, int y, int width, int height, bool checked);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -19,9 +19,9 @@
|
|||
#include "plugin.h"
|
||||
#include "configfile.h"
|
||||
|
||||
static struct plugin_api *cfg_rb;
|
||||
static const struct plugin_api *cfg_rb;
|
||||
|
||||
void configfile_init(struct plugin_api* newrb)
|
||||
void configfile_init(const struct plugin_api* newrb)
|
||||
{
|
||||
cfg_rb = newrb;
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ struct configdata
|
|||
NULL otherwise */
|
||||
};
|
||||
|
||||
void configfile_init(struct plugin_api* newrb);
|
||||
void configfile_init(const struct plugin_api* newrb);
|
||||
|
||||
/* configfile_save - Given configdata entries this function will
|
||||
create a config file with these entries, destroying any
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
#define GREY_ON_COP 0x0004 /* Run ISR on COP (PP targets) */
|
||||
|
||||
/* Library initialisation and release */
|
||||
bool grey_init(struct plugin_api* newrb, unsigned char *gbuf, long gbuf_size,
|
||||
bool grey_init(const struct plugin_api* newrb, unsigned char *gbuf, long gbuf_size,
|
||||
unsigned features, int width, int height, long *buf_taken);
|
||||
void grey_release(void);
|
||||
|
||||
|
@ -169,7 +169,7 @@ struct _grey_info
|
|||
int bheight; /* 4-pixel or 8-pixel units */
|
||||
#endif
|
||||
unsigned long flags; /* various flags, see #defines */
|
||||
struct plugin_api *rb; /* plugin API pointer */
|
||||
const struct plugin_api *rb; /* plugin API pointer */
|
||||
unsigned char *values; /* start of greyscale pixel values */
|
||||
unsigned char *phases; /* start of greyscale pixel phases */
|
||||
unsigned char *buffer; /* start of chunky pixel buffer (for buffered mode) */
|
||||
|
|
|
@ -478,7 +478,7 @@ static void fill_gvalues(void)
|
|||
|
||||
The function is authentic regarding memory usage on the simulator, even
|
||||
if it doesn't use all of the allocated memory. */
|
||||
bool grey_init(struct plugin_api* newrb, unsigned char *gbuf, long gbuf_size,
|
||||
bool grey_init(const struct plugin_api* newrb, unsigned char *gbuf, long gbuf_size,
|
||||
unsigned features, int width, int height, long *buf_taken)
|
||||
{
|
||||
int bdim, i;
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "helper.h"
|
||||
|
||||
/* Force the backlight on */
|
||||
void backlight_force_on(struct plugin_api* rb)
|
||||
void backlight_force_on(const struct plugin_api* rb)
|
||||
{
|
||||
if(!rb)
|
||||
return;
|
||||
|
@ -34,7 +34,7 @@ void backlight_force_on(struct plugin_api* rb)
|
|||
}
|
||||
|
||||
/* Reset backlight operation to its settings */
|
||||
void backlight_use_settings(struct plugin_api* rb)
|
||||
void backlight_use_settings(const struct plugin_api* rb)
|
||||
{
|
||||
if (!rb)
|
||||
return;
|
||||
|
@ -47,7 +47,7 @@ void backlight_use_settings(struct plugin_api* rb)
|
|||
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
/* Force the backlight on */
|
||||
void remote_backlight_force_on(struct plugin_api* rb)
|
||||
void remote_backlight_force_on(const struct plugin_api* rb)
|
||||
{
|
||||
if (!rb)
|
||||
return;
|
||||
|
@ -60,7 +60,7 @@ void remote_backlight_force_on(struct plugin_api* rb)
|
|||
}
|
||||
|
||||
/* Reset backlight operation to its settings */
|
||||
void remote_backlight_use_settings(struct plugin_api* rb)
|
||||
void remote_backlight_use_settings(const struct plugin_api* rb)
|
||||
{
|
||||
if (!rb)
|
||||
return;
|
||||
|
@ -75,7 +75,7 @@ void remote_backlight_use_settings(struct plugin_api* rb)
|
|||
|
||||
#ifdef HAVE_BUTTON_LIGHT
|
||||
/* Force the buttonlight on */
|
||||
void buttonlight_force_on(struct plugin_api* rb)
|
||||
void buttonlight_force_on(const struct plugin_api* rb)
|
||||
{
|
||||
if (!rb)
|
||||
return;
|
||||
|
@ -84,7 +84,7 @@ void buttonlight_force_on(struct plugin_api* rb)
|
|||
}
|
||||
|
||||
/* Reset buttonlight operation to its settings */
|
||||
void buttonlight_use_settings(struct plugin_api* rb)
|
||||
void buttonlight_use_settings(const struct plugin_api* rb)
|
||||
{
|
||||
if (!rb)
|
||||
return;
|
||||
|
|
|
@ -24,14 +24,14 @@
|
|||
/**
|
||||
* Backlight on/off operations
|
||||
*/
|
||||
void backlight_force_on(struct plugin_api* rb);
|
||||
void backlight_use_settings(struct plugin_api* rb);
|
||||
void backlight_force_on(const struct plugin_api* rb);
|
||||
void backlight_use_settings(const struct plugin_api* rb);
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
void remote_backlight_force_on(struct plugin_api* rb);
|
||||
void remote_backlight_use_settings(struct plugin_api* rb);
|
||||
void remote_backlight_force_on(const struct plugin_api* rb);
|
||||
void remote_backlight_use_settings(const struct plugin_api* rb);
|
||||
#endif
|
||||
#ifdef HAVE_BUTTON_LIGHT
|
||||
void buttonlight_force_on(struct plugin_api* rb);
|
||||
void buttonlight_use_settings(struct plugin_api* rb);
|
||||
void buttonlight_force_on(const struct plugin_api* rb);
|
||||
void buttonlight_use_settings(const struct plugin_api* rb);
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -19,9 +19,9 @@
|
|||
#include "plugin.h"
|
||||
#include "highscore.h"
|
||||
|
||||
static struct plugin_api *rb;
|
||||
static const struct plugin_api *rb;
|
||||
|
||||
void highscore_init(struct plugin_api* newrb)
|
||||
void highscore_init(const struct plugin_api* newrb)
|
||||
{
|
||||
rb = newrb;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ struct highscore
|
|||
int level;
|
||||
};
|
||||
|
||||
void highscore_init(struct plugin_api* newrb);
|
||||
void highscore_init(const struct plugin_api* newrb);
|
||||
int highscore_save(char *filename, struct highscore *scores, int num_scores);
|
||||
int highscore_load(char *filename, struct highscore *scores, int num_scores);
|
||||
int highscore_update(int score, int level, struct highscore *scores, int num_scores);
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include "plugin.h"
|
||||
#include "oldmenuapi.h"
|
||||
|
||||
struct plugin_api *rb = NULL;
|
||||
const struct plugin_api *rb = NULL;
|
||||
|
||||
struct menu {
|
||||
struct menu_item* items;
|
||||
|
@ -65,7 +65,7 @@ static int menu_find_free(void)
|
|||
return(i);
|
||||
}
|
||||
|
||||
int menu_init(struct plugin_api *api, const struct menu_item* mitems,
|
||||
int menu_init(const struct plugin_api *api, const struct menu_item* mitems,
|
||||
int count, int (*callback)(int, int),
|
||||
const char *button1, const char *button2, const char *button3)
|
||||
{
|
||||
|
|
|
@ -31,7 +31,7 @@ struct menu_item {
|
|||
bool (*function) (void); /* return true if USB was connected */
|
||||
};
|
||||
|
||||
int menu_init(struct plugin_api *api, const struct menu_item* mitems,
|
||||
int menu_init(const struct plugin_api *api, const struct menu_item* mitems,
|
||||
int count, int (*callback)(int, int),
|
||||
const char *button1, const char *button2, const char *button3);
|
||||
void menu_exit(int menu);
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
The linker script for the overlay should use a base address towards the
|
||||
end of the audiobuffer, just low enough to make the overlay fit. */
|
||||
|
||||
enum plugin_status run_overlay(struct plugin_api* rb, void* parameter,
|
||||
enum plugin_status run_overlay(const struct plugin_api* rb, const void* parameter,
|
||||
unsigned char *filename, unsigned char *name)
|
||||
{
|
||||
int fd, readsize;
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include "plugin.h"
|
||||
|
||||
/* load and run a plugin linked as an overlay. */
|
||||
enum plugin_status run_overlay(struct plugin_api* api, void* parameter,
|
||||
enum plugin_status run_overlay(const struct plugin_api* api, const void* parameter,
|
||||
unsigned char *filename, unsigned char *name);
|
||||
|
||||
#endif /* !SIMULATOR */
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include "plugin.h"
|
||||
#include "playback_control.h"
|
||||
|
||||
struct plugin_api* api = 0;
|
||||
const struct plugin_api* api = 0;
|
||||
struct viewport *parentvp = NULL;
|
||||
|
||||
static bool prevtrack(void)
|
||||
|
@ -105,14 +105,14 @@ MAKE_MENU(playback_control_menu, "Playback Control", NULL, Icon_NOICON,
|
|||
&prevtrack_item, &playpause_item, &stop_item, &nexttrack_item,
|
||||
&volume_item, &shuffle_item, &repeat_mode_item);
|
||||
|
||||
void playback_control_init(struct plugin_api* newapi,
|
||||
void playback_control_init(const struct plugin_api* newapi,
|
||||
struct viewport parent[NB_SCREENS])
|
||||
{
|
||||
api = newapi;
|
||||
parentvp = parent;
|
||||
}
|
||||
|
||||
bool playback_control(struct plugin_api* newapi,
|
||||
bool playback_control(const struct plugin_api* newapi,
|
||||
struct viewport parent[NB_SCREENS])
|
||||
{
|
||||
api = newapi;
|
||||
|
|
|
@ -25,11 +25,11 @@
|
|||
So, make sure you use the same viewport for the rb->do_menu() call
|
||||
that you use in the playback_control_init() call
|
||||
*/
|
||||
void playback_control_init(struct plugin_api* newapi,
|
||||
void playback_control_init(const struct plugin_api* newapi,
|
||||
struct viewport parent[NB_SCREENS]);
|
||||
|
||||
/* Use this if your menu still uses the old menu api */
|
||||
bool playback_control(struct plugin_api* api,
|
||||
bool playback_control(const struct plugin_api* api,
|
||||
struct viewport parent[NB_SCREENS]);
|
||||
|
||||
#endif /* __PLAYBACK_CONTROL_H__ */
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
/*** globals ***/
|
||||
|
||||
static struct plugin_api *pgfx_rb = NULL; /* global api struct pointer */
|
||||
static const struct plugin_api *pgfx_rb = NULL; /* global api struct pointer */
|
||||
static int char_width;
|
||||
static int char_height;
|
||||
static int pixel_height;
|
||||
|
@ -38,7 +38,7 @@ static int drawmode = DRMODE_SOLID;
|
|||
/*** Special functions ***/
|
||||
|
||||
/* library init */
|
||||
bool pgfx_init(struct plugin_api* newrb, int cwidth, int cheight)
|
||||
bool pgfx_init(const struct plugin_api* newrb, int cwidth, int cheight)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
#ifdef HAVE_LCD_CHARCELLS /* Player only :) */
|
||||
|
||||
bool pgfx_init(struct plugin_api* newrb, int cwidth, int cheight);
|
||||
bool pgfx_init(const struct plugin_api* newrb, int cwidth, int cheight);
|
||||
void pgfx_release(void);
|
||||
void pgfx_display(int cx, int cy);
|
||||
void pgfx_display_block(int cx, int cy, int x, int y);
|
||||
|
|
|
@ -464,7 +464,7 @@ static const struct button_mapping* get_context_map(int context)
|
|||
else return NULL;
|
||||
}
|
||||
|
||||
int pluginlib_getaction(struct plugin_api *api,int timeout,
|
||||
int pluginlib_getaction(const struct plugin_api *api,int timeout,
|
||||
const struct button_mapping *plugin_contexts[],
|
||||
int count)
|
||||
{
|
||||
|
|
|
@ -58,7 +58,7 @@ extern const struct button_mapping generic_left_right_fire[];
|
|||
extern const struct button_mapping generic_actions[];
|
||||
extern const struct button_mapping generic_increase_decrease[];
|
||||
|
||||
int pluginlib_getaction(struct plugin_api *api,int timeout,
|
||||
int pluginlib_getaction(const struct plugin_api *api,int timeout,
|
||||
const struct button_mapping *plugin_contexts[],
|
||||
int count);
|
||||
|
||||
|
|
|
@ -21,9 +21,9 @@
|
|||
|
||||
#include "plugin.h"
|
||||
|
||||
static struct plugin_api *local_rb = NULL; /* global api struct pointer */
|
||||
static const struct plugin_api *local_rb = NULL; /* global api struct pointer */
|
||||
|
||||
void profile_init(struct plugin_api* pa)
|
||||
void profile_init(const struct plugin_api* pa)
|
||||
{
|
||||
local_rb = pa;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#include "plugin.h"
|
||||
|
||||
void profile_init(struct plugin_api* pa);
|
||||
void profile_init(const struct plugin_api* pa);
|
||||
|
||||
void __cyg_profile_func_enter(void *this_fn, void *call_site)
|
||||
NO_PROF_ATTR ICODE_ATTR;
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
|
||||
void xlcd_init(struct plugin_api* newrb);
|
||||
void xlcd_init(const struct plugin_api* newrb);
|
||||
void xlcd_filltriangle(int x1, int y1, int x2, int y2, int x3, int y3);
|
||||
void xlcd_filltriangle_screen(struct screen* display,
|
||||
int x1, int y1, int x2, int y2, int x3, int y3);
|
||||
|
@ -49,7 +49,7 @@ void xlcd_scroll_up(int count);
|
|||
void xlcd_scroll_down(int count);
|
||||
|
||||
/* internal stuff */
|
||||
extern struct plugin_api *_xlcd_rb; /* global api struct pointer */
|
||||
extern const struct plugin_api *_xlcd_rb; /* global api struct pointer */
|
||||
|
||||
#endif /* HAVE_LCD_BITMAP */
|
||||
#endif /* __XLCD_H__ */
|
||||
|
|
|
@ -27,12 +27,12 @@
|
|||
|
||||
/*** globals ***/
|
||||
|
||||
struct plugin_api *_xlcd_rb = NULL; /* global api struct pointer */
|
||||
const struct plugin_api *_xlcd_rb = NULL; /* global api struct pointer */
|
||||
|
||||
/*** functions ***/
|
||||
|
||||
/* library init */
|
||||
void xlcd_init(struct plugin_api* newrb)
|
||||
void xlcd_init(const struct plugin_api* newrb)
|
||||
{
|
||||
_xlcd_rb = newrb;
|
||||
}
|
||||
|
|
|
@ -176,12 +176,12 @@ const unsigned char rockbox16x7[] = {
|
|||
#endif
|
||||
#endif
|
||||
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter) {
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter) {
|
||||
int button;
|
||||
int timer = 10;
|
||||
int x = (DISPLAY_WIDTH / 2) - (LOGO_WIDTH / 2);
|
||||
int y = (DISPLAY_HEIGHT / 2) - (LOGO_HEIGHT / 2);
|
||||
struct plugin_api* rb = api;
|
||||
const struct plugin_api* rb = api;
|
||||
int dx;
|
||||
int dy;
|
||||
#ifdef HAVE_LCD_CHARCELLS
|
||||
|
|
|
@ -273,7 +273,7 @@ PLUGIN_HEADER
|
|||
#define MYXLCD(fn) xlcd_ ## fn
|
||||
#endif
|
||||
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
|
||||
/* Fixed point format s5.26: sign, 5 bits integer part, 26 bits fractional part */
|
||||
static long x_min;
|
||||
|
@ -661,7 +661,7 @@ void cleanup(void *parameter)
|
|||
#define REDRAW_PARTIAL 1
|
||||
#define REDRAW_FULL 2
|
||||
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
int button;
|
||||
int lastbutton = BUTTON_NONE;
|
||||
|
|
|
@ -119,7 +119,7 @@ extern const fb_data matrix_normal[];
|
|||
#define SLEEP HZ/50
|
||||
|
||||
/* Codec api pointer */
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
|
||||
/* Each position is of this type */
|
||||
typedef struct cmatrix {
|
||||
|
@ -284,7 +284,7 @@ static void matrix_loop(void)
|
|||
}
|
||||
}
|
||||
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter) {
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter) {
|
||||
int button;
|
||||
int sleep = SLEEP;
|
||||
bool frozen = false;
|
||||
|
|
|
@ -79,7 +79,7 @@ PLUGIN_HEADER
|
|||
#define BORDER_W 0x00000080
|
||||
#define PATH 0x00000100
|
||||
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
|
||||
#ifdef __PLUGINLIB_ACTIONS_H__
|
||||
const struct button_mapping *plugin_contexts[]
|
||||
|
@ -470,7 +470,7 @@ void maze_move_player_right(struct maze* maze)
|
|||
/**********************************/
|
||||
/* this is the plugin entry point */
|
||||
/**********************************/
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
int button, lastbutton = BUTTON_NONE;
|
||||
int quit = 0;
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
/* Include standard plugin macro */
|
||||
PLUGIN_HEADER
|
||||
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
|
||||
/* The plugin actions of interest. */
|
||||
const struct button_mapping *plugin_contexts[]
|
||||
|
@ -916,7 +916,7 @@ static void main_menu(void)
|
|||
/*****************************************************************************
|
||||
* Plugin entry point
|
||||
******************************************************************************/
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
enum plugin_status plugin_state;
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ const struct button_mapping *plugin_contexts[]={
|
|||
};
|
||||
#define PLA_ARRAY_COUNT sizeof(plugin_contexts)/sizeof(plugin_contexts[0])
|
||||
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
|
||||
MEM_FUNCTION_WRAPPERS(rb);
|
||||
|
||||
|
@ -299,7 +299,7 @@ void tap(void)
|
|||
reset_tap = false;
|
||||
}
|
||||
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter){
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter){
|
||||
int button;
|
||||
enum plugin_status status;
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ int readID(int file);
|
|||
|
||||
struct MIDIfile midi_file IBSS_ATTR;
|
||||
|
||||
struct MIDIfile * loadFile(char * filename)
|
||||
struct MIDIfile * loadFile(const char * filename)
|
||||
{
|
||||
struct MIDIfile * mfload;
|
||||
int file = rb->open (filename, O_RDONLY);
|
||||
|
|
|
@ -17,5 +17,5 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
struct MIDIfile * loadFile(char * filename);
|
||||
struct MIDIfile * loadFile(const char * filename);
|
||||
|
||||
|
|
|
@ -191,11 +191,11 @@ int32_t gmbuf[BUF_SIZE*NBUF];
|
|||
static unsigned int samples_in_buf;
|
||||
|
||||
int quit=0;
|
||||
struct plugin_api * rb;
|
||||
const struct plugin_api * rb;
|
||||
|
||||
static int midimain(void * filename);
|
||||
static int midimain(const void * filename);
|
||||
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
int retval = 0;
|
||||
|
||||
|
@ -292,7 +292,7 @@ void get_more(unsigned char** start, size_t* size)
|
|||
#endif
|
||||
}
|
||||
|
||||
static int midimain(void * filename)
|
||||
static int midimain(const void * filename)
|
||||
{
|
||||
int notesUsed = 0;
|
||||
int a=0;
|
||||
|
|
|
@ -54,20 +54,14 @@ long bpm;
|
|||
#include "midi/synth.c"
|
||||
|
||||
|
||||
|
||||
|
||||
int fd=-1; /* File descriptor where the output is written */
|
||||
|
||||
extern long tempo; /* The sequencer keeps track of this */
|
||||
|
||||
|
||||
struct plugin_api * rb;
|
||||
const struct plugin_api * rb;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
(void)parameter;
|
||||
rb = api;
|
||||
|
|
|
@ -221,7 +221,7 @@ enum minesweeper_status {
|
|||
* it's nice not to have to pass the api pointer in all function calls
|
||||
* in the plugin
|
||||
*/
|
||||
static struct plugin_api *rb;
|
||||
static const struct plugin_api *rb;
|
||||
|
||||
extern const fb_data minesweeper_tiles[];
|
||||
|
||||
|
@ -731,7 +731,7 @@ enum minesweeper_status minesweeper( void )
|
|||
}
|
||||
|
||||
/* plugin entry point */
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
bool exit = false;
|
||||
|
||||
|
|
|
@ -141,7 +141,7 @@ PLUGIN_HEADER
|
|||
#endif
|
||||
#endif
|
||||
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
int button;
|
||||
int timer = 10;
|
||||
|
@ -149,7 +149,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
|||
int y=0;
|
||||
int sx = 3;
|
||||
int sy = 3;
|
||||
struct plugin_api* rb = api;
|
||||
const struct plugin_api* rb = api;
|
||||
(void)parameter;
|
||||
|
||||
#ifdef HAVE_LCD_CHARCELLS
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
PLUGIN_HEADER
|
||||
PLUGIN_IRAM_DECLARE
|
||||
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
|
||||
MEM_FUNCTION_WRAPPERS(rb);
|
||||
|
||||
|
@ -806,7 +806,7 @@ static const int win_const[18][4] = {
|
|||
{ 134, -146,-3352,-3072 } };
|
||||
|
||||
|
||||
static char* wav_filename;
|
||||
static const char* wav_filename;
|
||||
static int mp3file, wavfile, wav_size, frames;
|
||||
static uint32 enc_buffer[16384]; /* storage for 65536 Bytes */
|
||||
static int enc_chunk = 0; /* encode chunk counter */
|
||||
|
@ -2278,7 +2278,7 @@ void compress(void)
|
|||
int num_file;
|
||||
char mp3_name[80];
|
||||
|
||||
void get_mp3_filename(char *wav_name)
|
||||
void get_mp3_filename(const char *wav_name)
|
||||
{
|
||||
int slen = rb->strlen(wav_name);
|
||||
rb->strncpy(mp3_name, wav_name, 79);
|
||||
|
@ -2353,7 +2353,7 @@ void get_mp3_filename(char *wav_name)
|
|||
#endif
|
||||
#endif
|
||||
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
int rat, srat, nrat; /* for rate selection */
|
||||
int cont = 1, butt;
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "mpeg2dec_config.h"
|
||||
|
||||
extern struct plugin_api* rb;
|
||||
extern const struct plugin_api* rb;
|
||||
|
||||
#include "mpeg2.h"
|
||||
#include "attributes.h"
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
#include "mpeg2dec_config.h"
|
||||
|
||||
extern struct plugin_api* rb;
|
||||
extern const struct plugin_api* rb;
|
||||
|
||||
#include "mpeg2.h"
|
||||
#include "attributes.h"
|
||||
|
|
|
@ -257,7 +257,7 @@ PLUGIN_IRAM_DECLARE
|
|||
#endif
|
||||
#endif
|
||||
|
||||
struct plugin_api* rb;
|
||||
const struct plugin_api* rb;
|
||||
|
||||
CACHE_FUNCTION_WRAPPERS(rb);
|
||||
ALIGN_BUFFER_WRAPPER(rb);
|
||||
|
@ -1544,7 +1544,7 @@ static void button_loop(void)
|
|||
backlight_use_settings(rb);
|
||||
}
|
||||
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
int status = PLUGIN_ERROR; /* assume failure */
|
||||
int result;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#define MPEGPLAYER_H
|
||||
|
||||
/* Global API pointer */
|
||||
extern struct plugin_api* rb;
|
||||
extern const struct plugin_api* rb;
|
||||
|
||||
#ifdef HAVE_SCHEDULER_BOOSTCTRL
|
||||
#define trigger_cpu_boost rb->trigger_cpu_boost
|
||||
|
|
|
@ -59,7 +59,7 @@ static unsigned char str[12]; /*String use to display the first line*/
|
|||
static unsigned long hsmile,hcry,h1,h2; /*Handle for the new pattern*/
|
||||
|
||||
static bool end; /*If true game is finished*/
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
|
||||
|
||||
/*Display that the action it's impossible*/
|
||||
|
@ -138,7 +138,7 @@ static void nim_exit(void *parameter)
|
|||
}
|
||||
|
||||
/* this is the plugin entry point */
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
int y,z,button;
|
||||
int x,v,min;
|
||||
|
|
|
@ -249,7 +249,7 @@ enum { OSC_HORIZ, OSC_VERT, MAX_OSC };
|
|||
|
||||
/* global variables */
|
||||
|
||||
struct plugin_api* rb; /* global api struct pointer */
|
||||
const struct plugin_api* rb; /* global api struct pointer */
|
||||
|
||||
/* settings */
|
||||
struct osc_config {
|
||||
|
@ -650,7 +650,7 @@ void cleanup(void *parameter)
|
|||
backlight_use_settings(rb); /* backlight control in lib/helper.c */
|
||||
}
|
||||
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
int button, vol;
|
||||
int lastbutton = BUTTON_NONE;
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include <string.h>
|
||||
#include "plugin.h"
|
||||
|
||||
extern struct plugin_api* rb;
|
||||
extern const struct plugin_api* rb;
|
||||
|
||||
#ifndef HAVE_LCD_COLOR
|
||||
/* Convert RGB888 to 2-bit greyscale - logic taken from bmp2rb.c */
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include "plugin.h"
|
||||
#include "hardware.h"
|
||||
|
||||
extern struct plugin_api* rb;
|
||||
extern const struct plugin_api* rb;
|
||||
|
||||
/* The main data for Pacman */
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
PLUGIN_HEADER
|
||||
PLUGIN_IRAM_DECLARE
|
||||
|
||||
struct plugin_api* rb;
|
||||
const struct plugin_api* rb;
|
||||
|
||||
struct pacman_settings {
|
||||
int difficulty;
|
||||
|
@ -361,7 +361,7 @@ static int gameProc( void )
|
|||
return 0;
|
||||
}
|
||||
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
(void)parameter;
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#endif
|
||||
#include "pegbox_pieces.h"
|
||||
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
|
||||
PLUGIN_HEADER
|
||||
|
||||
|
@ -1256,7 +1256,7 @@ static int pegbox(struct game_context* pb) {
|
|||
/*****************************************************************************
|
||||
* plugin entry point.
|
||||
******************************************************************************/
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter) {
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter) {
|
||||
bool exit = false;
|
||||
struct game_context pb;
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ PLUGIN_HEADER
|
|||
|
||||
/******************************* Globals ***********************************/
|
||||
|
||||
static struct plugin_api *rb; /* global api struct pointer */
|
||||
static const struct plugin_api *rb; /* global api struct pointer */
|
||||
|
||||
const struct button_mapping *plugin_contexts[]
|
||||
= {generic_actions, generic_directions};
|
||||
|
@ -2080,7 +2080,7 @@ int main(void)
|
|||
|
||||
/*************************** Plugin entry point ****************************/
|
||||
|
||||
enum plugin_status plugin_start(struct plugin_api *api, void *parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api *api, const void *parameter)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ PLUGIN_HEADER
|
|||
|
||||
/******************************* Globals ***********************************/
|
||||
|
||||
static struct plugin_api* rb; /* global api struct pointer */
|
||||
static const struct plugin_api* rb; /* global api struct pointer */
|
||||
static unsigned char wave_array[256]; /* Pre calculated wave array */
|
||||
#ifdef HAVE_LCD_COLOR
|
||||
static fb_data colours[256]; /* Smooth transition of shades */
|
||||
|
@ -343,7 +343,7 @@ int main(void)
|
|||
|
||||
/*************************** Plugin entry point ****************************/
|
||||
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
|
|
@ -174,7 +174,7 @@ PLUGIN_HEADER
|
|||
#endif
|
||||
#endif
|
||||
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
|
||||
struct pong {
|
||||
int ballx; /* current X*RES position of the ball */
|
||||
|
@ -453,7 +453,7 @@ void showscore(struct pong *p)
|
|||
}
|
||||
|
||||
/* this is the plugin entry point */
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
struct pong pong;
|
||||
int game = 1;
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
PLUGIN_HEADER
|
||||
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
|
||||
MEM_FUNCTION_WRAPPERS(rb);
|
||||
|
||||
|
@ -252,21 +252,23 @@ char * get_props(int selected_item, void* data, char *buffer, size_t buffer_len)
|
|||
return buffer;
|
||||
}
|
||||
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* file)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
rb = api;
|
||||
struct gui_synclist properties_lists;
|
||||
int button;
|
||||
bool prev_show_statusbar;
|
||||
bool quit = false;
|
||||
char file[MAX_PATH];
|
||||
rb->strcpy(file, (const char *) parameter);
|
||||
|
||||
/* determine if it's a file or a directory */
|
||||
bool found = false;
|
||||
DIR* dir;
|
||||
struct dirent* entry;
|
||||
char* ptr = rb->strrchr((char*)file, '/') + 1;
|
||||
int dirlen = (ptr - (char*)file);
|
||||
rb->strncpy(str_dirname, (char*)file, dirlen);
|
||||
char* ptr = rb->strrchr(file, '/') + 1;
|
||||
int dirlen = (ptr - file);
|
||||
rb->strncpy(str_dirname, file, dirlen);
|
||||
str_dirname[dirlen] = 0;
|
||||
|
||||
dir = rb->opendir(str_dirname);
|
||||
|
@ -288,13 +290,13 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file)
|
|||
if(!found)
|
||||
{
|
||||
/* weird: we couldn't find the entry. This Should Never Happen (TM) */
|
||||
rb->splash(0, "File/Dir not found: %s", (char*)file);
|
||||
rb->splash(0, "File/Dir not found: %s", file);
|
||||
rb->action_userabort(TIMEOUT_BLOCK);
|
||||
return PLUGIN_OK;
|
||||
}
|
||||
|
||||
/* get the info depending on its_a_dir */
|
||||
if(!(its_a_dir ? dir_properties((char*)file):file_properties((char*)file)))
|
||||
if(!(its_a_dir ? dir_properties(file) : file_properties(file)))
|
||||
{
|
||||
/* something went wrong (to do: tell user what it was (nesting,...) */
|
||||
rb->splash(0, "Failed to gather information");
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
PLUGIN_HEADER
|
||||
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
static bool abort;
|
||||
static int fd;
|
||||
static int dirs_count;
|
||||
|
@ -544,7 +544,7 @@ int main_menu(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||
{
|
||||
(void)parameter;
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ typedef struct _reversi_board_t {
|
|||
*/
|
||||
move_t history[BOARD_SIZE*BOARD_SIZE - INIT_STONES];
|
||||
|
||||
struct plugin_api *rb;
|
||||
const struct plugin_api *rb;
|
||||
} reversi_board_t;
|
||||
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ PLUGIN_HEADER
|
|||
/* The global api struct pointer. While not strictly necessary,
|
||||
it's nice not to have to pass the api pointer in all function
|
||||
calls in the plugin */
|
||||
static struct plugin_api* rb;
|
||||
static const struct plugin_api* rb;
|
||||
|
||||
/* Thickness of the grid lines */
|
||||
#define LINE_THCK 1
|
||||
|
@ -543,7 +543,7 @@ static void reversi_gui_move_cursor(int new_row, int new_col) {
|
|||
|
||||
|
||||
/* plugin entry point */
|
||||
enum plugin_status plugin_start(struct plugin_api *api, void *parameter) {
|
||||
enum plugin_status plugin_start(const struct plugin_api *api, const void *parameter) {
|
||||
bool exit, draw_screen;
|
||||
int button;
|
||||
int lastbutton = BUTTON_NONE;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue