Rockbox Ports are now being developed for various digital audio players!
#include "plugin.h"#include "sqlite3.h"#ifdef ROCKBOX_HAS_LOGF#define LOGF_ENABLE#define logf rb->logf#else#define logf(f,args...) DEBUGF(f"\n",##args)#endifstatic int callback(void *NotUsed, int argc, char **argv, char **azColName){ int fd = rb->open("/out", O_CREAT|O_WRONLY|O_APPEND); char buf[512]; int i, ret; for(i=0; i<argc; i++){ rb->snprintf(buf, sizeof(buf), "%s = %s\n", azColName[i], argv[i] ? argv[i] : "NULL"); ret = rb->write(fd, buf, rb->strlen(buf)); } rb->close(fd); return 0;}static int exec(sqlite3 *db, const char *command){ char *zErrMsg = 0; int rc = sqlite3_exec(db, command, callback, 0, &zErrMsg); if (zErrMsg) { logf("%s", zErrMsg); } if (rc!=SQLITE_OK) { sqlite3_free(zErrMsg); } return rc;}/* this is the plugin entry point */enum plugin_status plugin_start(const void* parameter){ (void)parameter; int rc; sqlite3 *db; rc = sqlite3_open("/test.db", &db); if (rc) { sqlite3_close(db); return PLUGIN_ERROR; } logf("DB opened"); rc = exec(db, "create table tbl1(one varchar(10), two smallint);"); rc = exec(db, "insert into tbl1 values('hello!',10);"); rc = exec(db, "insert into tbl1 values('goodbye', 20);"); rc = exec(db, "select * from tbl1;"); return PLUGIN_OK;}
apps/plugins/lib/sqlite3_aux.h and apps/plugins/lib/rockbox_vfs.c don't exist, is this because of the errors when applying patch?
my files only displays folders, not the music/ video or image files contained within the folders
rc = sqlite3_open(DBFile, &db); if (rc) { sqlite3_close(db); return PLUGIN_ERROR; }
Page created in 0.082 seconds with 15 queries.