├── .gitignore ├── src ├── guilib │ ├── ime.h │ ├── lib.h │ ├── ime.c │ └── lib.c ├── ui │ ├── main_menu.h │ ├── app_menu.h │ ├── test_remap.h │ ├── main_menu.c │ ├── test_remap.c │ └── app_menu.c ├── applist │ ├── applist.h │ └── applist.c ├── remap │ ├── config.h │ ├── remap.h │ ├── config.c │ └── remap.c ├── main.c └── vita_sqlite.c ├── plugin ├── resources │ └── debug_config ├── main.yml ├── src │ ├── blit.h │ ├── main.c │ ├── blit.c │ └── font.c └── CMakeLists.txt ├── sqlite3 ├── sqlite3.pc.in ├── sqlite3.pc ├── Makefile.am ├── README ├── configure.ac ├── sqlite3.1 ├── INSTALL ├── install-sh ├── missing ├── depcomp ├── sqlite3ext.h └── Makefile.in ├── README.md └── CMakeLists.txt /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | plugin/build 3 | 4 | .DS_Store 5 | -------------------------------------------------------------------------------- /src/guilib/ime.h: -------------------------------------------------------------------------------- 1 | 2 | int ime_dialog(char *text, char *title, char *def); 3 | -------------------------------------------------------------------------------- /plugin/resources/debug_config: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shdwp/advremap/HEAD/plugin/resources/debug_config -------------------------------------------------------------------------------- /src/ui/main_menu.h: -------------------------------------------------------------------------------- 1 | #include "../guilib/lib.h" 2 | #include "app_menu.h" 3 | 4 | int ui_main_menu(); 5 | -------------------------------------------------------------------------------- /plugin/main.yml: -------------------------------------------------------------------------------- 1 | advbuttonremap: 2 | attributes: 0 3 | version: 4 | major: 1 5 | minor: 1 6 | main: 7 | start: module_start 8 | stop: module_stop 9 | -------------------------------------------------------------------------------- /src/ui/app_menu.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "../guilib/lib.h" 4 | #include "../remap/remap.h" 5 | #include "../applist/applist.h" 6 | 7 | int ui_app_menu(application_t app); 8 | -------------------------------------------------------------------------------- /src/ui/test_remap.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "../remap/remap.h" 5 | 6 | int ui_test_remap(remap_config_t conf); 7 | void draw_touch_at(SceTouchData touch, int x, int y); 8 | void draw_sticks_at(SceCtrlData pad, int x, int y); 9 | -------------------------------------------------------------------------------- /sqlite3/sqlite3.pc.in: -------------------------------------------------------------------------------- 1 | # Package Information for pkg-config 2 | 3 | prefix=@prefix@ 4 | exec_prefix=@exec_prefix@ 5 | libdir=@libdir@ 6 | includedir=@includedir@ 7 | 8 | Name: SQLite 9 | Description: SQL database engine 10 | Version: @PACKAGE_VERSION@ 11 | Libs: -L${libdir} -lsqlite3 12 | Libs.private: @LIBS@ 13 | Cflags: -I${includedir} 14 | -------------------------------------------------------------------------------- /sqlite3/sqlite3.pc: -------------------------------------------------------------------------------- 1 | # Package Information for pkg-config 2 | 3 | prefix=/usr/local 4 | exec_prefix=${prefix} 5 | libdir=${exec_prefix}/lib 6 | includedir=${prefix}/include 7 | 8 | Name: SQLite 9 | Description: SQL database engine 10 | Version: 3.6.23.1 11 | Libs: -L${libdir} -lsqlite3 12 | Libs.private: -ldl -lpthread 13 | Cflags: -I${includedir} 14 | -------------------------------------------------------------------------------- /src/applist/applist.h: -------------------------------------------------------------------------------- 1 | #ifndef APPLIST_H 2 | #define APPLIST_H 3 | 4 | #include 5 | 6 | typedef struct application { 7 | char name[256]; 8 | char id[16]; 9 | } application_t; 10 | 11 | typedef struct applist_t { 12 | uint32_t size; 13 | application_t *items; 14 | } applist_t; 15 | 16 | int applist_load(applist_t *list); 17 | 18 | #endif 19 | 20 | -------------------------------------------------------------------------------- /sqlite3/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | AM_CFLAGS = @THREADSAFE_FLAGS@ @DYNAMIC_EXTENSION_FLAGS@ -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE 3 | 4 | lib_LTLIBRARIES = libsqlite3.la 5 | libsqlite3_la_SOURCES = sqlite3.c 6 | libsqlite3_la_LDFLAGS = -no-undefined -version-info 8:6:8 7 | 8 | bin_PROGRAMS = sqlite3 9 | sqlite3_SOURCES = shell.c sqlite3.h 10 | sqlite3_LDADD = $(top_builddir)/libsqlite3.la @READLINE_LIBS@ 11 | sqlite3_DEPENDENCIES = $(top_builddir)/libsqlite3.la 12 | 13 | include_HEADERS = sqlite3.h sqlite3ext.h 14 | 15 | EXTRA_DIST = sqlite3.pc sqlite3.1 16 | pkgconfigdir = ${libdir}/pkgconfig 17 | pkgconfig_DATA = sqlite3.pc 18 | 19 | man_MANS = sqlite3.1 20 | -------------------------------------------------------------------------------- /plugin/src/blit.h: -------------------------------------------------------------------------------- 1 | #ifndef __BLIT_H__ 2 | #define __BLIT_H__ 3 | 4 | #include 5 | 6 | #define COLOR_CYAN 0x00ffff00 7 | #define COLOR_MAGENDA 0x00ff00ff 8 | #define COLOR_YELLOW 0x0000ffff 9 | 10 | #define RGB(R,G,B) (((B)<<16)|((G)<<8)|(R)) 11 | #define RGBT(R,G,B,T) (((T)<<24)|((B)<<16)|((G)<<8)|(R)) 12 | 13 | #define CENTER(num) ((960/2)-(num*(16/2))) 14 | 15 | int blit_setup(void); 16 | void blit_set_color(int fg_col,int bg_col); 17 | int blit_string(int sx,int sy,const char *msg); 18 | int blit_string_ctr(int sy,const char *msg); 19 | int blit_stringf(int sx, int sy, const char *msg, ...); 20 | int blit_set_frame_buf(const SceDisplayFrameBuf *param); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /src/remap/config.h: -------------------------------------------------------------------------------- 1 | #ifndef CONFIG_H 2 | #define CONFIG_H 3 | 4 | #include 5 | #include "remap.h" 6 | #include "../applist/applist.h" 7 | 8 | #define CONFIG_APP_PATH_SIZE 256 9 | #define CONFIG_PLUGIN_PATH "app0:advremap.suprx" 10 | #define CONFIG_TAIHEN_PATH "ux0:tai/config.txt" 11 | 12 | #define CONFIG_MEM_MAX_SIZE 4096 13 | #define CONFIG_MEM_OFFSET 70324 14 | 15 | void config_path(application_t app, char path[CONFIG_APP_PATH_SIZE]); 16 | void config_binary_path(application_t app, char path[CONFIG_APP_PATH_SIZE]); 17 | 18 | int config_load(char *path, remap_config_t *result); 19 | int config_mem_load(void *ptr, remap_config_t *result); 20 | int config_save(char *path, remap_config_t config); 21 | 22 | int config_binary_save(char *binary_path, char *config_path); 23 | int config_binary_install(char *name); 24 | 25 | int config_default(remap_config_t *config); 26 | 27 | int config_taihen_append(application_t app); 28 | 29 | void config_append_remap(remap_config_t *config); 30 | void config_remove_remap(remap_config_t *config, int n); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /src/ui/main_menu.c: -------------------------------------------------------------------------------- 1 | #include "main_menu.h" 2 | 3 | #include "test_remap.h" 4 | 5 | int ui_main_menu_loop(int cursor_id, void *context) { 6 | if (was_button_pressed(SCE_CTRL_CROSS)) { 7 | applist_t *list = (applist_t *) context; 8 | ui_app_menu(list->items[cursor_id]); 9 | } 10 | 11 | return 0; 12 | } 13 | 14 | int ui_main_menu_back(void *context) { 15 | return GUI_CONTINUE; 16 | } 17 | 18 | int ui_main_menu() { 19 | applist_t list; 20 | applist_load(&list); 21 | 22 | struct menu_entry menu[3 + list.size]; 23 | int idx = 0; 24 | 25 | menu[idx++] = (struct menu_entry) { .name = "", .subname = "Advanced Button Remap", .disabled = true, .color = 0xffaa00aa }; 26 | for (int i = 0; i < list.size; i++) { 27 | menu[idx++] = (struct menu_entry) { .name = list.items[i].name, .id = i, }; 28 | } 29 | 30 | menu[idx++] = (struct menu_entry) { .name = "", .disabled = true, .separator = true }; 31 | menu[idx++] = (struct menu_entry) { .name = "Quit" }; 32 | 33 | struct menu_geom geom = make_geom_centered(600, 400); 34 | return display_menu(menu, idx, &geom, &ui_main_menu_loop, &ui_main_menu_back, NULL, DEFAULT_GUIDE, &list); 35 | } 36 | -------------------------------------------------------------------------------- /src/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | #include "ui/main_menu.h" 8 | #include "debugnet.h" 9 | 10 | #include 11 | #include 12 | 13 | void main() { 14 | debugNetInit("192.168.12.223" , 18194, DEBUG); 15 | debugNetPrintf(DEBUG, "\n---------------------------------\n"); 16 | 17 | SceAppUtilInitParam init; 18 | SceAppUtilBootParam boot; 19 | memset(&init, 0, sizeof(SceAppUtilInitParam)); 20 | memset(&boot, 0, sizeof(SceAppUtilBootParam)); 21 | 22 | sceAppUtilInit(&init, &boot); 23 | sceAppUtilPhotoMount(); 24 | 25 | sceIoMkdir("ux0:data/advremap", 0777); 26 | sceIoMkdir("ux0:tai/advremap", 0777); 27 | 28 | sceCtrlSetSamplingModeExt(SCE_CTRL_MODE_ANALOG_WIDE); 29 | sceCtrlSetSamplingMode(SCE_CTRL_MODE_ANALOG_WIDE); 30 | sceTouchSetSamplingState(SCE_TOUCH_PORT_BACK, SCE_TOUCH_SAMPLING_STATE_START); 31 | sceTouchSetSamplingState(SCE_TOUCH_PORT_FRONT, SCE_TOUCH_SAMPLING_STATE_START); 32 | 33 | vita2d_init(); 34 | vita2d_set_clear_color(RGBA8(0, 0, 0, 0)); 35 | guilib_init(NULL, NULL); 36 | ui_main_menu(); 37 | debugNetFinish(); 38 | } 39 | -------------------------------------------------------------------------------- /sqlite3/README: -------------------------------------------------------------------------------- 1 | 2 | This package contains: 3 | 4 | * the SQLite library amalgamation (single file) source code distribution, 5 | * the shell.c file used to build the sqlite3 shell too, and 6 | * the sqlite3.h and sqlite3ext.h header files required to link programs 7 | and sqlite extensions against the installed libary. 8 | * autoconf/automake installation infrastucture. 9 | 10 | The generic installation instructions for autoconf/automake are found 11 | in the INSTALL file. 12 | 13 | The following SQLite specific boolean options are supported: 14 | 15 | --enable-readline use readline in shell tool [default=yes] 16 | --enable-threadsafe build a thread-safe library [default=yes] 17 | --enable-dynamic-extensions support loadable extensions [default=yes] 18 | 19 | The default value for the CFLAGS variable (options passed to the C 20 | compiler) includes debugging symbols in the build, resulting in larger 21 | binaries than are necessary. Override it on the configure command 22 | line like this: 23 | 24 | $ CFLAGS="-Os" ./configure 25 | 26 | to produce a smaller installation footprint. 27 | 28 | Other SQLite compilation parameters can also be set using CFLAGS. For 29 | example: 30 | 31 | $ CFLAGS="-Os -DSQLITE_OMIT_TRIGGERS" ./configure 32 | 33 | -------------------------------------------------------------------------------- /plugin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | 3 | if(NOT DEFINED CMAKE_TOOLCHAIN_FILE) 4 | if(DEFINED ENV{VITASDK}) 5 | set(CMAKE_TOOLCHAIN_FILE "$ENV{VITASDK}/share/vita.toolchain.cmake" CACHE PATH "toolchain file") 6 | else() 7 | message(FATAL_ERROR "Please define VITASDK to point to your SDK path!") 8 | endif() 9 | endif() 10 | 11 | project(advremap) 12 | include("${VITASDK}/share/vita.cmake" REQUIRED) 13 | 14 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-q -Wall -O3 -std=gnu99") 15 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-rtti -fno-exceptions") 16 | 17 | include_directories( 18 | ../src/ 19 | ) 20 | 21 | link_directories( 22 | ${CMAKE_CURRENT_BINARY_DIR} 23 | ) 24 | 25 | if (NOT ${RELEASE}) 26 | add_definitions(-DENABLE_LOGGING) 27 | endif() 28 | 29 | add_executable(advremap 30 | src/main.c 31 | src/font.c 32 | src/blit.c 33 | 34 | ../src/remap/remap.c 35 | ../src/remap/config.c 36 | ) 37 | 38 | add_definitions( -DPLUGIN=1) 39 | 40 | target_link_libraries(advremap 41 | taihen_stub 42 | SceLibc_stub 43 | SceLibKernel_stub 44 | SceRtc_stub 45 | 46 | SceCtrl_stub 47 | SceTouch_stub 48 | SceDisplay_stub 49 | ) 50 | 51 | set_target_properties(advremap 52 | PROPERTIES LINK_FLAGS "-nostdlib" 53 | ) 54 | 55 | vita_create_self(advremap.suprx advremap 56 | UNCOMPRESSED 57 | CONFIG ${CMAKE_SOURCE_DIR}/main.yml 58 | ) 59 | 60 | add_custom_target(debug_send 61 | COMMAND dd if=../resources/debug_config of=advremap.suprx bs=1 seek=70324 conv=notrunc 62 | COMMAND curl -T advremap.suprx ftp://$(PSVITAIP):1337/ux0:/tai/advremap/debug.suprx 63 | DEPENDS advremap.suprx 64 | ) 65 | 66 | add_custom_target(addr 67 | COMMAND strings -o advremap.suprx | grep ADVREMAP_IM_A_LOUSY_PROGRAMMER 68 | DEPENDS advremap.suprx 69 | ) 70 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | PS Vita homebrew for remapping controls. 2 | 3 | ## Features 4 | 5 | * Remap any button, sticks (_4 directions_), back touchscreen (_4 virtual buttons_) 6 | * Remap single button to button combination 7 | * Configure touchscreen and analog sticks deadzone 8 | * GUI 9 | 10 | ## Usage 11 | 12 | 1. Select application for remapping 13 | 1. Hit __Triangle__ to add new item 14 | 1. Press the __trigger__ (button, stick or back touchscreen zone which will be replaced) 15 | 1. Hold the __actions__ (the buttons which will replace the trigger) until the message dissapear 16 | 1. Press __Circle__ to save configuration 17 | 1. If you haven't enabled the plugin for this application previously: 18 | 1. Go to __molecularShell__, open `ux0:tai/config.txt` 19 | 1. The two last lines will be commented out, uncomment them (remove #) 20 | 1. Save the file, open __Start__ menu and hit `Reload taiHEN's config.txt` 21 | 22 | ## Troubleshoot 23 | * "_Plugin doesn't work_": 24 | * Dumped games not supported 25 | * If the notice message doesn't appear in the game: make sure that you've edited taiHEN's `config.txt` and reloaded it trough `molecularShell` 26 | * Other way the game may be unsupported 27 | 28 | * "_Config not saving_": 29 | * Make sure that you've added at least 1 button 30 | 31 | ## Build 32 | 1. Build taiHEN plugin (in `plugin` directory `mkdir build && cd build && cmake .. && make`) 33 | 1. Update `CONFIG_MEM_OFFSET` in `src/remap/config.h` to the offset generated by `make addr` command in `plugin/build` folder 34 | 1. Build the homebrew (in root folder `mkdir build && cd build && cmake .. && make`) 35 | 36 | ## License 37 | GPLv3 38 | 39 | ## Credits 40 | Project use source code from following repositories: 41 | 42 | * [VitaShell][] 43 | * [vita-savemgr][] 44 | * [oclockvita][] 45 | * [rinCheat][] 46 | 47 | Special thanks to #vitasdk and Scorpeg's [ButtonSwap](https://github.com/Scorpeg/Button-Swap) 48 | 49 | [oclockvita]: https://github.com/frangarcj/oclockvita 50 | [VitaShell]: https://github.com/TheOfficialFloW/VitaShell 51 | [vita-savemgr]: https://github.com/d3m3vilurr/vita-savemgr 52 | [rinCheat]: https://github.com/Rinnegatamante/rinCheat 53 | -------------------------------------------------------------------------------- /src/applist/applist.c: -------------------------------------------------------------------------------- 1 | #include "applist.h" 2 | 3 | #include 4 | #include 5 | #include "sqlite3.h" 6 | 7 | #define APP_DB "ur0:shell/db/app.db" 8 | 9 | static int get_applist_callback(void *data, int argc, char **argv, char **cols) { 10 | applist_t *list = (applist_t*)data; 11 | 12 | int i = list->size++; 13 | list->items = realloc(list->items, sizeof(application_t) * list->size); 14 | 15 | strcpy(list->items[i].name, argv[2]); 16 | strcpy(list->items[i].id, argv[1]); 17 | 18 | for (int i = 0; i < 256; i++) { 19 | if (list->items[i].name[i] == '\n') { 20 | list->items[i].name[i] = ' '; 21 | } 22 | } 23 | return 0; 24 | } 25 | 26 | int applist_load(applist_t *list) { 27 | char *query = "select a.titleid, b.realid, c.title, d.ebootbin," 28 | " rtrim(substr(d.ebootbin, 0, 5), ':') as dev" 29 | " from (select titleid" 30 | " from tbl_appinfo" 31 | " where key = 566916785" 32 | " and titleid like 'PCS%'" 33 | " order by titleid) a," 34 | " (select titleid, val as realid" 35 | " from tbl_appinfo" 36 | " where key = 278217076) b," 37 | " tbl_appinfo_icon c," 38 | " (select titleid, val as ebootbin" 39 | " from tbl_appinfo" 40 | " where key = 3022202214) d" 41 | " where a.titleid = b.titleid" 42 | " and a.titleid = c.titleid" 43 | " and a.titleid = d.titleid"; 44 | 45 | sqlite3 *db; 46 | int ret = sqlite3_open(APP_DB, &db); 47 | if (ret) { 48 | return -1; 49 | } 50 | char *errMsg; 51 | ret = sqlite3_exec(db, query, get_applist_callback, (void *)list, &errMsg); 52 | if (ret != SQLITE_OK) { 53 | sqlite3_close(db); 54 | return -2; 55 | } 56 | sqlite3_close(db); 57 | 58 | if (list->size <= 0) { 59 | return -3; 60 | } 61 | 62 | return 0; 63 | } 64 | -------------------------------------------------------------------------------- /src/guilib/lib.h: -------------------------------------------------------------------------------- 1 | #ifndef GUILIB_H 2 | #define GUILIB_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #define WIDTH 960 10 | #define HEIGHT 544 11 | 12 | #define GUI_CONTINUE 0 13 | #define GUI_EXIT 1 14 | 15 | #define ICON_CROSS(a) "╳" a 16 | #define ICON_CIRCLE(a) "◯" a 17 | #define ICON_TRIANGLE(a) "△" a 18 | #define ICON_SQUARE(a) "□" a 19 | 20 | #define DEFAULT_GUIDE (char *[]) {ICON_CROSS("ok"), ICON_CIRCLE("back"), NULL, NULL} 21 | #define EXT_GUIDE(s, t) (char *[]) {ICON_CROSS("ok"), ICON_CIRCLE("back"), s, t} 22 | #define NO_GUIDE (char *[]) {NULL, NULL, NULL, NULL} 23 | 24 | struct menu_entry { 25 | int id; 26 | unsigned int color; 27 | char *name, *suffix; 28 | char *subname; 29 | bool disabled, separator; 30 | }; 31 | 32 | struct menu_geom { 33 | int x, y, width, height, el, total_y; 34 | bool statusbar; 35 | }; 36 | 37 | vita2d_pgf *gui_font; 38 | 39 | #define lerp(value, from_max, to_max) ((((value*10) * (to_max*10))/(from_max*10))/10) 40 | 41 | struct menu_geom make_geom_centered(int w, int h); 42 | 43 | typedef int (*gui_loop_callback) (int, void *); 44 | typedef int (*gui_back_callback) (void *); 45 | typedef void (*gui_draw_callback) (void); 46 | 47 | bool was_button_pressed(short id); 48 | bool is_button_down(short id); 49 | bool is_rectangle_touched(int lx, int ly, int rx, int ry); 50 | 51 | int display_menu( 52 | struct menu_entry menu[], 53 | int total_elements, 54 | struct menu_geom *geom_ptr, 55 | gui_loop_callback loop_callback, 56 | gui_back_callback back_callback, 57 | gui_draw_callback draw_callback, 58 | char *guide_strings[], 59 | void *context 60 | ); 61 | 62 | int display_alert( 63 | char *message, 64 | struct menu_geom alert_geom, 65 | char *button_captions[], 66 | int buttons_count, 67 | gui_loop_callback cb, 68 | void *context 69 | ); 70 | 71 | void display_error(char *format, ...); 72 | 73 | void flash_message(char *format, ...); 74 | 75 | void guilib_init(gui_loop_callback global_loop_cb, gui_draw_callback global_draw_cb); 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | 3 | # VitaSDK defines 4 | if( NOT DEFINED CMAKE_TOOLCHAIN_FILE ) 5 | if( DEFINED ENV{VITASDK} ) 6 | set(CMAKE_TOOLCHAIN_FILE "$ENV{VITASDK}/share/vita.toolchain.cmake" CACHE PATH "toolchain file") 7 | else() 8 | message(FATAL_ERROR "Please define VITASDK to point to your SDK path!") 9 | endif() 10 | endif() 11 | 12 | project(advremap) 13 | include("${VITASDK}/share/vita.cmake" REQUIRED) 14 | set(TITLE "advremap") 15 | set(TITLE_ID "SHDW00001") 16 | set(VERSION "00.10") 17 | 18 | #set(CMAKE_C_FLAGS "-Wl,-q -O3 -g -std=c99 -Dntohs=__builtin_bswap16 -Dhtons=__builtin_bswap16 -Dntohl=__builtin_bswap32 -Dhtonl=__builtin_bswap32 -DENET_DEBUG=1") 19 | 20 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -O3 -Wno-unused-variable -Wno-unused-but-set-variable -fno-lto") 21 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-rtti -fno-exceptions") 22 | set(VITA_MKSFOEX_FLAGS "${VITA_MKSFOEX_FLAGS} -d PARENTAL_LEVEL=1") 23 | set(VITA_MAKE_FSELF_FLAGS "${VITA_MAKE_FSELF_FLAGS} -a 0x2800000000000001") 24 | 25 | add_definitions(-DSQLITE_OS_OTHER=1) 26 | add_definitions(-DSQLITE_TEMP_STORE=3) 27 | add_definitions(-DSQLITE_THREADSAFE=0) 28 | 29 | include_directories( 30 | sqlite3 31 | ) 32 | 33 | link_directories( 34 | ${CMAKE_CURRENT_BINARY_DIR} 35 | ) 36 | 37 | add_executable(${PROJECT_NAME}.elf 38 | sqlite3/sqlite3.c 39 | src/vita_sqlite.c 40 | 41 | src/main.c 42 | src/guilib/lib.c 43 | src/ui/test_remap.c 44 | src/ui/main_menu.c 45 | src/ui/app_menu.c 46 | 47 | src/remap/remap.c 48 | src/remap/config.c 49 | 50 | src/applist/applist.c 51 | ) 52 | 53 | target_link_libraries(${PROJECT_NAME}.elf 54 | vita2d 55 | SceDisplay_stub 56 | SceGxm_stub 57 | SceSysmodule_stub 58 | SceCtrl_stub 59 | SceTouch_stub 60 | ScePgf_stub 61 | ScePower_stub 62 | SceAppUtil_stub 63 | 64 | SceCommonDialog_stub 65 | freetype 66 | png 67 | jpeg 68 | z 69 | m 70 | c 71 | taihen_stub 72 | 73 | debugnet 74 | SceNet_stub 75 | SceNetCtl_stub 76 | ScePower_stub 77 | SceAppMgr_stub 78 | ) 79 | 80 | vita_create_self(eboot.bin ${PROJECT_NAME}.elf) 81 | vita_create_vpk(${PROJECT_NAME}.vpk ${TITLE_ID} eboot.bin 82 | VERSION ${VERSION} 83 | NAME ${TITLE} 84 | 85 | FILE plugin/build/advremap.suprx advremap.suprx 86 | ) 87 | 88 | add_custom_target(send 89 | COMMAND curl -T eboot.bin ftp://$(PSVITAIP):1337/ux0:/app/${TITLE_ID}/ 90 | COMMAND curl -T ../plugin/build/advremap.suprx ftp://$(PSVITAIP):1337/ux0:/app/${TITLE_ID}/ 91 | DEPENDS eboot.bin 92 | ) 93 | -------------------------------------------------------------------------------- /src/remap/remap.h: -------------------------------------------------------------------------------- 1 | #ifndef REMAP_H 2 | #define REMAP_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include "debugnet.h" 11 | 12 | #define debug(format, args...) debugNetPrintf(DEBUG, format "\n", args) 13 | 14 | typedef enum trigger { 15 | CTRL_SELECT = 0x000001, //!< Select button. 16 | CTRL_L3 = 0x000002, //!< L3 button. 17 | CTRL_R3 = 0x000004, //!< R3 button. 18 | CTRL_START = 0x000008, //!< Start button. 19 | CTRL_UP = 0x000010, //!< Up D-Pad button. 20 | CTRL_RIGHT = 0x000020, //!< Right D-Pad button. 21 | CTRL_DOWN = 0x000040, //!< Down D-Pad button. 22 | CTRL_LEFT = 0x000080, //!< Left D-Pad button. 23 | CTRL_LTRIGGER = 0x000100, //!< Left trigger. 24 | CTRL_RTRIGGER = 0x000200, //!< Right trigger. 25 | CTRL_L1 = 0x000400, //!< L1 button. 26 | CTRL_R1 = 0x000800, //!< R1 button. 27 | CTRL_TRIANGLE = 0x001000, //!< Triangle button. 28 | CTRL_CIRCLE = 0x002000, //!< Circle button. 29 | CTRL_CROSS = 0x004000, //!< Cross button. 30 | CTRL_SQUARE = 0x008000, //!< Square button. 31 | 32 | 33 | RS_UP = 0x500000, 34 | RS_DOWN, 35 | RS_LEFT, 36 | RS_RIGHT, 37 | 38 | LS_UP, 39 | LS_DOWN, 40 | LS_LEFT, 41 | LS_RIGHT, 42 | 43 | TOUCHSCREEN_NW = 0x400000, 44 | TOUCHSCREEN_NE, 45 | TOUCHSCREEN_SW, 46 | TOUCHSCREEN_SE, 47 | 48 | RS_ANY = 0x300000, 49 | LS_ANY, 50 | } trigger_t; 51 | 52 | extern int TRIGGERS[30]; 53 | #define TRIGGERS_COUNT 30 54 | #define TRIGGERS_BUTTONS_COUNT 16 55 | #define TRIGGERS_NOTOUCH_COUNT TRIGGERS_BUTTONS_COUNT + 8 56 | 57 | typedef enum { 58 | ACTION_BUTTON, 59 | ACTION_FRONTTOUCHSCREEN, 60 | ACTION_BACKTOUCHSCREEN, 61 | ACTION_RS, 62 | ACTION_LS, 63 | } action_type_t; 64 | 65 | typedef struct { 66 | action_type_t type; 67 | int value; 68 | int x, y; 69 | } action_t; 70 | 71 | typedef struct { 72 | int size; 73 | action_t *list; 74 | } action_list_t; 75 | 76 | typedef struct { 77 | int rs_deadzone, ls_deadzone; 78 | int back_touch_deadzone_vertical, back_touch_deadzone_horizontal; 79 | int front_touch_deadzone_vertical, front_touch_deadzone_horizontal; 80 | 81 | int size; 82 | trigger_t *triggers; 83 | action_list_t *actions; 84 | } remap_config_t; 85 | 86 | #define REMAP_MAX_ACTIONS 24 87 | 88 | // 89 | 90 | void remap_deadzone_ignore(remap_config_t config, SceCtrlData *mut_pad, SceTouchData *mut_front, SceTouchData *mut_back); 91 | void remap(remap_config_t config, SceCtrlData *mut_pad, SceTouchData *mut_front, SceTouchData *mut_back); 92 | 93 | int remap_read_trigger(trigger_t *trigger, SceCtrlData pad, SceTouchData front, SceTouchData back); 94 | int remap_read_actions(action_list_t *actions, SceCtrlData pad, SceTouchData front, SceTouchData back); 95 | 96 | #define TRIGGER_NAME_SIZE 256 97 | #define ACTION_NAME_SIZE 1024 98 | void remap_trigger_name(int id, char buf[TRIGGER_NAME_SIZE]); 99 | void remap_config_action_name(remap_config_t config, int i, char buf[ACTION_NAME_SIZE]); 100 | 101 | #include "config.h" 102 | 103 | #endif 104 | -------------------------------------------------------------------------------- /sqlite3/configure.ac: -------------------------------------------------------------------------------- 1 | 2 | #----------------------------------------------------------------------- 3 | # Supports the following non-standard switches. 4 | # 5 | # --enable-threadsafe 6 | # --enable-readline 7 | # --enable-dynamic-extensions 8 | # 9 | 10 | AC_PREREQ(2.61) 11 | AC_INIT(sqlite, 3.6.23.1, http://www.sqlite.org) 12 | AC_CONFIG_SRCDIR([sqlite3.c]) 13 | 14 | # Use automake. 15 | AM_INIT_AUTOMAKE([foreign]) 16 | 17 | AC_SYS_LARGEFILE 18 | 19 | # Check for required programs. 20 | AC_PROG_CC 21 | AC_PROG_RANLIB 22 | AC_PROG_LIBTOOL 23 | 24 | # Check for library functions that SQLite can optionally use. 25 | AC_CHECK_FUNCS([fdatasync usleep fullfsync localtime_r gmtime_r]) 26 | 27 | AC_CONFIG_FILES([Makefile sqlite3.pc]) 28 | AC_SUBST(BUILD_CFLAGS) 29 | 30 | #----------------------------------------------------------------------- 31 | # --enable-readline 32 | # 33 | AC_ARG_ENABLE(readline, [AS_HELP_STRING( 34 | [--enable-readline], 35 | [use readline in shell tool (yes, no) [default=yes]])], 36 | [], [enable_readline=yes]) 37 | if test x"$enable_readline" != xno ; then 38 | sLIBS=$LIBS 39 | LIBS="" 40 | AC_SEARCH_LIBS(tgetent, curses, [], []) 41 | AC_SEARCH_LIBS(readline, readline, [], [enable_readline=no]) 42 | AC_CHECK_FUNCS(readline, [], []) 43 | READLINE_LIBS=$LIBS 44 | LIBS=$sLIBS 45 | fi 46 | AC_SUBST(READLINE_LIBS) 47 | #----------------------------------------------------------------------- 48 | 49 | #----------------------------------------------------------------------- 50 | # --enable-threadsafe 51 | # 52 | AC_ARG_ENABLE(threadsafe, [AS_HELP_STRING( 53 | [--enable-threadsafe], [build a thread-safe library [default=yes]])], 54 | [], [enable_threadsafe=yes]) 55 | THREADSAFE_FLAGS=-DSQLITE_THREADSAFE=0 56 | if test x"$enable_threadsafe" != "xno"; then 57 | THREADSAFE_FLAGS=-DSQLITE_THREADSAFE=1 58 | AC_SEARCH_LIBS(pthread_create, pthread) 59 | fi 60 | AC_SUBST(THREADSAFE_FLAGS) 61 | #----------------------------------------------------------------------- 62 | 63 | #----------------------------------------------------------------------- 64 | # --enable-dynamic-extensions 65 | # 66 | AC_ARG_ENABLE(dynamic-extensions, [AS_HELP_STRING( 67 | [--enable-dynamic-extensions], [support loadable extensions [default=yes]])], 68 | [], [enable_dynamic_extensions=yes]) 69 | if test x"$enable_dynamic_extensions" != "xno"; then 70 | AC_SEARCH_LIBS(dlopen, dl) 71 | else 72 | DYNAMIC_EXTENSION_FLAGS=-DSQLITE_OMIT_LOAD_EXTENSION=1 73 | fi 74 | AC_MSG_CHECKING([for whether to support dynamic extensions]) 75 | AC_MSG_RESULT($enable_dynamic_extensions) 76 | AC_SUBST(DYNAMIC_EXTENSION_FLAGS) 77 | #----------------------------------------------------------------------- 78 | 79 | #----------------------------------------------------------------------- 80 | # UPDATE: Maybe it's better if users just set CFLAGS before invoking 81 | # configure. This option doesn't really add much... 82 | # 83 | # --enable-tempstore 84 | # 85 | # AC_ARG_ENABLE(tempstore, [AS_HELP_STRING( 86 | # [--enable-tempstore], 87 | # [in-memory temporary tables (never, no, yes, always) [default=no]])], 88 | # [], [enable_tempstore=no]) 89 | # AC_MSG_CHECKING([for whether or not to store temp tables in-memory]) 90 | # case "$enable_tempstore" in 91 | # never ) TEMP_STORE=0 ;; 92 | # no ) TEMP_STORE=1 ;; 93 | # always ) TEMP_STORE=3 ;; 94 | # yes ) TEMP_STORE=3 ;; 95 | # * ) 96 | # TEMP_STORE=1 97 | # enable_tempstore=yes 98 | # ;; 99 | # esac 100 | # AC_MSG_RESULT($enable_tempstore) 101 | # AC_SUBST(TEMP_STORE) 102 | #----------------------------------------------------------------------- 103 | 104 | AC_OUTPUT 105 | -------------------------------------------------------------------------------- /src/ui/test_remap.c: -------------------------------------------------------------------------------- 1 | #include "test_remap.h" 2 | 3 | #include "../guilib/lib.h" 4 | 5 | static remap_config_t remap_config; 6 | 7 | void draw_sticks_at(SceCtrlData pad, int x, int y) { 8 | int r = WIDTH - WIDTH / 3; 9 | int l = WIDTH / 3; 10 | int active_color = 0xffff00ff, inactive_color = 0xaaffffff; 11 | 12 | float stick_fac = 10; 13 | int rx = pad.rx; 14 | int ry = pad.ry; 15 | vita2d_draw_fill_circle(r - 100 + x + (float) rx / stick_fac, 130 + y + (float) ry / stick_fac, 10, inactive_color); 16 | 17 | int lx = pad.lx; 18 | int ly = pad.ly; 19 | vita2d_draw_fill_circle(l + 100 + x + (float) lx / stick_fac, 130 + y + (float) ly / stick_fac, 10, inactive_color); 20 | } 21 | 22 | void draw_pad_at(SceCtrlData pad, int x, int y) { 23 | int r = WIDTH - WIDTH / 3; 24 | int l = WIDTH / 3; 25 | 26 | int ids[] = { 27 | SCE_CTRL_CROSS, SCE_CTRL_CIRCLE, SCE_CTRL_TRIANGLE, SCE_CTRL_SQUARE, 28 | SCE_CTRL_DOWN, SCE_CTRL_RIGHT, SCE_CTRL_UP, SCE_CTRL_LEFT, 29 | SCE_CTRL_LTRIGGER, SCE_CTRL_RTRIGGER, SCE_CTRL_SELECT, SCE_CTRL_START, 30 | }; 31 | char *chars[] = { 32 | "x", "o", "t", "s", 33 | "D", "R", "U", "L", 34 | "L", "R", "S", "S", 35 | }; 36 | int pos[][2] = { 37 | {r, 130}, {r+30, 100}, {r, 70}, {r-30, 100}, 38 | {l, 130}, {l+30, 100}, {l, 70}, {l-30, 100}, 39 | {l, 40}, {r, 40}, {r-30, 160}, {r, 160}, 40 | }; 41 | int len = 12; 42 | 43 | int active_color = 0xffff00ff, inactive_color = 0xaaffffff; 44 | 45 | for (int i = 0; i < len; i++) { 46 | int color = pad.buttons & ids[i] ? active_color : inactive_color; 47 | vita2d_pgf_draw_text(gui_font, pos[i][0]+x, pos[i][1]+y, color, 1.0f, chars[i]); 48 | } 49 | 50 | vita2d_pgf_draw_text(gui_font, l+x, 40+y, pad.lt > 0 ? active_color : inactive_color, 1.0f, "L"); 51 | vita2d_pgf_draw_text(gui_font, r+x, 40+y, pad.rt > 0 ? active_color : inactive_color, 1.0f, "R"); 52 | } 53 | 54 | void draw_touch_at(SceTouchData touch, int x, int y) { 55 | int width = WIDTH - x * 2; 56 | int height = 100; 57 | 58 | vita2d_draw_rectangle(x, y, width, height, 0x30ff00ff); 59 | for (int i = 0; i < touch.reportNum; i++) { 60 | int tx = lerp(touch.report[i].x, 1919, 960); 61 | int ty = lerp(touch.report[i].y, 1087, 544); 62 | 63 | float tpx = (float) tx / WIDTH; 64 | float tpy = (float) ty / HEIGHT; 65 | 66 | vita2d_draw_fill_circle(tpx * width + x, tpy * height + y, 10, 0xffffffff); 67 | 68 | char xyz[1024]; 69 | sprintf(&xyz, "%d;%d", tx, ty); 70 | vita2d_pgf_draw_text(gui_font, tpx * width + x, tpy * height + y, 0xffffffff, 1.0f, xyz); 71 | } 72 | } 73 | 74 | void ui_test_remap_draw() { 75 | SceCtrlData pad; 76 | sceCtrlPeekBufferPositive(0, &pad, 1); 77 | 78 | SceTouchData front; 79 | sceTouchPeek(SCE_TOUCH_PORT_FRONT, &front, 1); 80 | SceTouchData back; 81 | sceTouchPeek(SCE_TOUCH_PORT_BACK, &back, 1); 82 | 83 | remap(remap_config, &pad, &front, &back); 84 | 85 | draw_touch_at(front, 300, 90); 86 | draw_touch_at(back, 300, 200); 87 | draw_pad_at(pad, 0, 300); 88 | draw_sticks_at(pad, 0, 300); 89 | } 90 | 91 | int ui_test_remap_loop(int cursor_id, void *context) { 92 | if (is_button_down(SCE_CTRL_START) && is_button_down(SCE_CTRL_SELECT)) { 93 | return GUI_EXIT; 94 | } 95 | 96 | return GUI_CONTINUE; 97 | } 98 | 99 | int ui_test_remap_back(void *context) { 100 | return GUI_CONTINUE; 101 | } 102 | 103 | int ui_test_remap(remap_config_t config) { 104 | remap_config = config; 105 | 106 | struct menu_entry menu[16]; 107 | int idx = 0; 108 | 109 | menu[idx++] = (struct menu_entry) { .name = "To quit press Start+Select", .disabled = true }; 110 | 111 | struct menu_geom geom = make_geom_centered(300, 36); 112 | geom.x = 50; 113 | geom.y = 50; 114 | geom.statusbar = false; 115 | return display_menu(menu, idx, &geom, &ui_test_remap_loop, &ui_test_remap_back, &ui_test_remap_draw, NO_GUIDE, NULL); 116 | } 117 | -------------------------------------------------------------------------------- /src/guilib/ime.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include 14 | 15 | #define SCE_IME_DIALOG_MAX_TITLE_LENGTH (128) 16 | #define SCE_IME_DIALOG_MAX_TEXT_LENGTH (512) 17 | 18 | #define IME_DIALOG_RESULT_NONE 0 19 | #define IME_DIALOG_RESULT_RUNNING 1 20 | #define IME_DIALOG_RESULT_FINISHED 2 21 | #define IME_DIALOG_RESULT_CANCELED 3 22 | 23 | 24 | static uint16_t ime_title_utf16[SCE_IME_DIALOG_MAX_TITLE_LENGTH]; 25 | static uint16_t ime_initial_text_utf16[SCE_IME_DIALOG_MAX_TEXT_LENGTH]; 26 | static uint16_t ime_input_text_utf16[SCE_IME_DIALOG_MAX_TEXT_LENGTH + 1]; 27 | static uint8_t ime_input_text_utf8[SCE_IME_DIALOG_MAX_TEXT_LENGTH + 1]; 28 | 29 | void utf16_to_utf8(uint16_t *src, uint8_t *dst) { 30 | int i; 31 | for (i = 0; src[i]; i++) { 32 | if ((src[i] & 0xFF80) == 0) { 33 | *(dst++) = src[i] & 0xFF; 34 | } else if((src[i] & 0xF800) == 0) { 35 | *(dst++) = ((src[i] >> 6) & 0xFF) | 0xC0; 36 | *(dst++) = (src[i] & 0x3F) | 0x80; 37 | } else if((src[i] & 0xFC00) == 0xD800 && (src[i + 1] & 0xFC00) == 0xDC00) { 38 | *(dst++) = (((src[i] + 64) >> 8) & 0x3) | 0xF0; 39 | *(dst++) = (((src[i] >> 2) + 16) & 0x3F) | 0x80; 40 | *(dst++) = ((src[i] >> 4) & 0x30) | 0x80 | ((src[i + 1] << 2) & 0xF); 41 | *(dst++) = (src[i + 1] & 0x3F) | 0x80; 42 | i += 1; 43 | } else { 44 | *(dst++) = ((src[i] >> 12) & 0xF) | 0xE0; 45 | *(dst++) = ((src[i] >> 6) & 0x3F) | 0x80; 46 | *(dst++) = (src[i] & 0x3F) | 0x80; 47 | } 48 | } 49 | 50 | *dst = '\0'; 51 | } 52 | 53 | void utf8_to_utf16(uint8_t *src, uint16_t *dst) { 54 | int i; 55 | for (i = 0; src[i];) { 56 | if ((src[i] & 0xE0) == 0xE0) { 57 | *(dst++) = ((src[i] & 0x0F) << 12) | ((src[i + 1] & 0x3F) << 6) | (src[i + 2] & 0x3F); 58 | i += 3; 59 | } else if ((src[i] & 0xC0) == 0xC0) { 60 | *(dst++) = ((src[i] & 0x1F) << 6) | (src[i + 1] & 0x3F); 61 | i += 2; 62 | } else { 63 | *(dst++) = src[i]; 64 | i += 1; 65 | } 66 | } 67 | 68 | *dst = '\0'; 69 | } 70 | 71 | void initImeDialog(char *title, char *initial_text, int max_text_length) { 72 | // Convert UTF8 to UTF16 73 | utf8_to_utf16((uint8_t *)title, ime_title_utf16); 74 | utf8_to_utf16((uint8_t *)initial_text, ime_initial_text_utf16); 75 | 76 | SceImeDialogParam param; 77 | sceImeDialogParamInit(¶m); 78 | 79 | param.sdkVersion = 0x03150021, 80 | param.supportedLanguages = 0x0001FFFF; 81 | param.languagesForced = SCE_TRUE; 82 | param.type = SCE_IME_TYPE_EXTENDED_NUMBER; 83 | param.title = ime_title_utf16; 84 | param.maxTextLength = max_text_length; 85 | param.initialText = ime_initial_text_utf16; 86 | param.inputTextBuffer = ime_input_text_utf16; 87 | 88 | //int res = 89 | sceImeDialogInit(¶m); 90 | return ; 91 | } 92 | 93 | void oslOskGetText(char *text){ 94 | // Convert UTF16 to UTF8 95 | utf16_to_utf8(ime_input_text_utf16, ime_input_text_utf8); 96 | strcpy(text,(char*)ime_input_text_utf8); 97 | } 98 | 99 | 100 | int ime_dialog(char *text, char *title, char *def) { 101 | sceCommonDialogSetConfigParam(&(SceCommonDialogConfigParam){}); 102 | 103 | char userText[512]; 104 | if (def) { 105 | strcpy(userText, def); 106 | } 107 | 108 | int ret = 0; 109 | initImeDialog(title, userText, 128); 110 | 111 | while (1) { 112 | vita2d_start_drawing(); 113 | vita2d_clear_screen(); 114 | 115 | SceCommonDialogStatus status = sceImeDialogGetStatus(); 116 | if (status == IME_DIALOG_RESULT_FINISHED) { 117 | SceImeDialogResult result; 118 | memset(&result, 0, sizeof(SceImeDialogResult)); 119 | sceImeDialogGetResult(&result); 120 | 121 | if (result.button == SCE_IME_DIALOG_BUTTON_CLOSE) { 122 | status = IME_DIALOG_RESULT_CANCELED; 123 | ret = -1; 124 | break; 125 | } else { 126 | oslOskGetText(userText); 127 | } 128 | 129 | strcpy(text, userText); 130 | break; 131 | } 132 | 133 | vita2d_end_drawing(); 134 | vita2d_common_dialog_update(); 135 | vita2d_swap_buffers(); 136 | sceDisplayWaitVblankStart(); 137 | } 138 | 139 | sceImeDialogTerm(); 140 | return ret; 141 | } 142 | -------------------------------------------------------------------------------- /plugin/src/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "../src/remap/remap.h" 11 | #include "../src/remap/config.h" 12 | 13 | #include "blit.h" 14 | 15 | // meta 16 | #define HOOKS_COUNT 7 17 | static SceUID g_hooks[HOOKS_COUNT]; 18 | static tai_hook_ref_t tai_hook[HOOKS_COUNT]; 19 | #define CtrlBufferWrapper(n) static int tai_wrapper_##n(int p, SceCtrlData *ctrl, int c) { return ctrl_buffer_wrapper(p, tai_hook[n], ctrl, c); } 20 | #define CtrlTouchWrapper(n) static int tai_wrapper_##n(int p, SceTouchData *data, int c) { return ctrl_touch_wrapper(p, tai_hook[n], data, c); } 21 | CtrlBufferWrapper(0) 22 | CtrlBufferWrapper(1) 23 | CtrlBufferWrapper(2) 24 | CtrlBufferWrapper(3) 25 | CtrlTouchWrapper(4) 26 | CtrlTouchWrapper(5) 27 | 28 | static int tai_wrapper_6(const SceDisplayFrameBuf *pParam, int sync) { return framebuf_set(tai_hook[6], pParam, sync); } 29 | 30 | void _start() __attribute__ ((weak, alias ("module_start"))); 31 | 32 | /* 33 | PCSB00866 - TOCS 34 | PCSB00867 - P4DAN 35 | PCSB00743 - ?? 36 | PCSB00497 - YS 37 | PCSE00867 - DiVA 38 | */ 39 | 40 | // remap 41 | static int display_notice_iterations; 42 | static remap_config_t remap_config; 43 | 44 | int ctrl_buffer_wrapper(int port, tai_hook_ref_t ref_hook, SceCtrlData *ctrl, int count) { 45 | if (ref_hook == 0) { 46 | return 1; 47 | } else { 48 | int ret = TAI_CONTINUE(int, ref_hook, port, ctrl, count); 49 | 50 | SceTouchData front, back; 51 | sceTouchPeek(SCE_TOUCH_PORT_FRONT, &front, 1); 52 | sceTouchPeek(SCE_TOUCH_PORT_BACK, &back, 1); 53 | 54 | remap(remap_config, ctrl, &front, &back); 55 | 56 | return ret; 57 | } 58 | } 59 | 60 | int ctrl_touch_wrapper(int port, tai_hook_ref_t ref_hook, SceTouchData *data, int count) { 61 | if (ref_hook == 0) { 62 | return 1; 63 | } else { 64 | int ret = TAI_CONTINUE(int, ref_hook, port, data, count); 65 | 66 | SceCtrlData ctrl; 67 | sceCtrlPeekBufferPositive(0, &ctrl, 1); 68 | 69 | if (port == SCE_TOUCH_PORT_FRONT) { 70 | SceTouchData back; 71 | sceTouchPeek(SCE_TOUCH_PORT_BACK, &back, 1); 72 | 73 | remap(remap_config, &ctrl, data, &back); 74 | } else { 75 | SceTouchData front; 76 | sceTouchPeek(SCE_TOUCH_PORT_FRONT, &front, 1); 77 | 78 | remap(remap_config, &ctrl, &front, data); 79 | } 80 | 81 | return ret; 82 | } 83 | } 84 | 85 | int framebuf_set(tai_hook_ref_t ref_hook, const SceDisplayFrameBuf *pParam, int sync) { 86 | display_notice_iterations++; 87 | if (display_notice_iterations < 200) { 88 | blit_set_frame_buf(pParam); 89 | blit_set_color(0x00ff00ff, 0x00101010); 90 | blit_stringf(100, 100, ":: advremap loaded, config size %d", remap_config.size); 91 | } 92 | 93 | return TAI_CONTINUE(int, ref_hook, pParam, sync); 94 | } 95 | 96 | char mem_config[CONFIG_MEM_MAX_SIZE] = "ADVREMAP_IM_A_LOUSY_PROGRAMMER"; 97 | 98 | // start/stop 99 | int module_start(SceSize argc, const void *args) { 100 | config_mem_load((void *) mem_config, &remap_config); 101 | 102 | int i = -1; 103 | g_hooks[++i] = taiHookFunctionImport(&tai_hook[i], 104 | TAI_MAIN_MODULE, 105 | TAI_ANY_LIBRARY, 106 | 0xA9C3CED6, // sceCtrlPeekBufferPositive 107 | tai_wrapper_0); 108 | 109 | g_hooks[++i] = taiHookFunctionImport(&tai_hook[i], 110 | TAI_MAIN_MODULE, 111 | TAI_ANY_LIBRARY, 112 | 0x15F81E8C, // sceCtrlPeekBufferPositive2 113 | tai_wrapper_1); 114 | 115 | g_hooks[++i] = taiHookFunctionImport(&tai_hook[i], 116 | TAI_MAIN_MODULE, 117 | TAI_ANY_LIBRARY, 118 | 0x67E7AB83, // sceCtrlReadBufferPositive 119 | tai_wrapper_2); 120 | 121 | g_hooks[++i] = taiHookFunctionImport(&tai_hook[i], 122 | TAI_MAIN_MODULE, 123 | TAI_ANY_LIBRARY, 124 | 0xC4226A3E, // sceCtrlReadBufferPositive2 125 | tai_wrapper_3); 126 | 127 | g_hooks[++i] = taiHookFunctionImport(&tai_hook[i], 128 | TAI_MAIN_MODULE, 129 | TAI_ANY_LIBRARY, 130 | 0xFF082DF0, // sceCtrlTouchPeek 131 | tai_wrapper_4); 132 | 133 | g_hooks[++i] = taiHookFunctionImport(&tai_hook[i], 134 | TAI_MAIN_MODULE, 135 | TAI_ANY_LIBRARY, 136 | 0x169A1D58, // sceCtrlTouchRead 137 | tai_wrapper_5); 138 | 139 | g_hooks[++i] = taiHookFunctionImport(&tai_hook[i], 140 | TAI_MAIN_MODULE, 141 | TAI_ANY_LIBRARY, 142 | 0x7A410B64, // sceDisplaySetFrameBuf 143 | tai_wrapper_6); 144 | 145 | return SCE_KERNEL_START_SUCCESS; 146 | } 147 | 148 | int module_stop(SceSize argc, const void *args) { 149 | for (int i = 0; i < HOOKS_COUNT; i++) { 150 | if (g_hooks[i] >= 0) taiHookRelease(g_hooks[i], tai_hook[i]); 151 | } 152 | 153 | return SCE_KERNEL_STOP_SUCCESS; 154 | } 155 | -------------------------------------------------------------------------------- /plugin/src/blit.c: -------------------------------------------------------------------------------- 1 | /* 2 | PSP VSH 24bpp text bliter 3 | */ 4 | #include 5 | #include 6 | #include 7 | 8 | #include "blit.h" 9 | 10 | #define ALPHA_BLEND 1 11 | 12 | extern unsigned char msx[]; 13 | 14 | ///////////////////////////////////////////////////////////////////////////// 15 | ///////////////////////////////////////////////////////////////////////////// 16 | static int pwidth, pheight, bufferwidth, pixelformat; 17 | static unsigned int* vram32; 18 | 19 | static uint32_t fcolor = 0x00ffffff; 20 | static uint32_t bcolor = 0xff000000; 21 | 22 | #if ALPHA_BLEND 23 | ///////////////////////////////////////////////////////////////////////////// 24 | ///////////////////////////////////////////////////////////////////////////// 25 | static uint32_t adjust_alpha(uint32_t col) 26 | { 27 | uint32_t alpha = col>>24; 28 | uint8_t mul; 29 | uint32_t c1,c2; 30 | 31 | if(alpha==0) return col; 32 | if(alpha==0xff) return col; 33 | 34 | c1 = col & 0x00ff00ff; 35 | c2 = col & 0x0000ff00; 36 | mul = (uint8_t)(255-alpha); 37 | c1 = ((c1*mul)>>8)&0x00ff00ff; 38 | c2 = ((c2*mul)>>8)&0x0000ff00; 39 | return (alpha<<24)|c1|c2; 40 | } 41 | #endif 42 | 43 | ///////////////////////////////////////////////////////////////////////////// 44 | ///////////////////////////////////////////////////////////////////////////// 45 | //int blit_setup(int sx,int sy,const char *msg,int fg_col,int bg_col) 46 | int blit_setup(void) 47 | { 48 | SceDisplayFrameBuf param; 49 | param.size = sizeof(SceDisplayFrameBuf); 50 | sceDisplayGetFrameBuf(¶m, SCE_DISPLAY_SETBUF_IMMEDIATE); 51 | 52 | pwidth = param.width; 53 | pheight = param.height; 54 | vram32 = param.base; 55 | bufferwidth = param.pitch; 56 | pixelformat = param.pixelformat; 57 | 58 | if( (bufferwidth==0) || (pixelformat!=0)) return -1; 59 | 60 | fcolor = 0x00ffffff; 61 | bcolor = 0xff000000; 62 | 63 | return 0; 64 | } 65 | 66 | ///////////////////////////////////////////////////////////////////////////// 67 | // blit text 68 | ///////////////////////////////////////////////////////////////////////////// 69 | void blit_set_color(int fg_col,int bg_col) 70 | { 71 | fcolor = fg_col; 72 | bcolor = bg_col; 73 | } 74 | 75 | ///////////////////////////////////////////////////////////////////////////// 76 | // blit text 77 | ///////////////////////////////////////////////////////////////////////////// 78 | int blit_string(int sx,int sy,const char *msg) 79 | { 80 | int x,y,p; 81 | int offset; 82 | char code; 83 | unsigned char font; 84 | uint32_t fg_col,bg_col; 85 | 86 | #if ALPHA_BLEND 87 | uint32_t col,c1,c2; 88 | uint32_t alpha; 89 | 90 | fg_col = adjust_alpha(fcolor); 91 | bg_col = adjust_alpha(bcolor); 92 | #else 93 | fg_col = fcolor; 94 | bg_col = bcolor; 95 | #endif 96 | 97 | //Kprintf("MODE %d WIDTH %d\n",pixelformat,bufferwidth); 98 | if( (bufferwidth==0) || (pixelformat!=0)) return -1; 99 | 100 | for(x=0;msg[x] && x<(pwidth/16);x++) 101 | { 102 | code = msg[x] & 0x7f; // 7bit ANK 103 | for(y=0;y<8;y++) 104 | { 105 | offset = (sy+(y*2))*bufferwidth + sx+x*16; 106 | font = y>=7 ? 0x00 : msx[ code*8 + y ]; 107 | for(p=0;p<8;p++) 108 | { 109 | #if ALPHA_BLEND 110 | col = (font & 0x80) ? fg_col : bg_col; 111 | alpha = col>>24; 112 | if(alpha==0) 113 | { 114 | vram32[offset] = col; 115 | vram32[offset + 1] = col; 116 | vram32[offset + bufferwidth] = col; 117 | vram32[offset + bufferwidth + 1] = col; 118 | } 119 | else if(alpha!=0xff) 120 | { 121 | c2 = vram32[offset]; 122 | c1 = c2 & 0x00ff00ff; 123 | c2 = c2 & 0x0000ff00; 124 | c1 = ((c1*alpha)>>8)&0x00ff00ff; 125 | c2 = ((c2*alpha)>>8)&0x0000ff00; 126 | uint32_t color = (col&0xffffff) + c1 + c2; 127 | vram32[offset] = color; 128 | vram32[offset + 1] = color; 129 | vram32[offset + bufferwidth] = color; 130 | vram32[offset + bufferwidth + 1] = color; 131 | } 132 | #else 133 | uint32_t color = (font & 0x80) ? fg_col : bg_col; 134 | vram32[offset] = color; 135 | vram32[offset + 1] = color; 136 | vram32[offset + bufferwidth] = color; 137 | vram32[offset + bufferwidth + 1] = color; 138 | #endif 139 | font <<= 1; 140 | offset+=2; 141 | } 142 | } 143 | } 144 | return x; 145 | } 146 | 147 | int blit_string_ctr(int sy,const char *msg) 148 | { 149 | int sx = 960/2-sceClibStrnlen(msg, 512)*(16/2); 150 | return blit_string(sx,sy,msg); 151 | } 152 | 153 | int blit_stringf(int sx, int sy, const char *msg, ...) 154 | { 155 | va_list list; 156 | char string[512]; 157 | 158 | va_start(list, msg); 159 | sceClibVsnprintf(string, 512, msg, list); 160 | va_end(list); 161 | 162 | return blit_string(sx, sy, string); 163 | } 164 | 165 | int blit_set_frame_buf(const SceDisplayFrameBuf *param) 166 | { 167 | 168 | pwidth = param->width; 169 | pheight = param->height; 170 | vram32 = param->base; 171 | bufferwidth = param->pitch; 172 | pixelformat = param->pixelformat; 173 | 174 | if( (bufferwidth==0) || (pixelformat!=0)) return -1; 175 | 176 | fcolor = 0x00ffffff; 177 | bcolor = 0xff000000; 178 | 179 | return 0; 180 | } 181 | -------------------------------------------------------------------------------- /src/vita_sqlite.c: -------------------------------------------------------------------------------- 1 | // This was only tested with sqlite 3.6.23.1 2 | // Please note that this .c file does not implement thread safety for sqlite, and as such requires it to be built with -DSQLITE_THREADSAFE=0 as well 3 | // Build flags for sqlite: -DSQLITE_OS_OTHER=1 -DSQLITE_TEMP_STORE=3 -DSQLITE_THREADSAFE=0 4 | 5 | // It's also hacky -- no sync support, no tempdir support, access returning bs, etc... don't use in production! 6 | 7 | // based on test_demovfs.c 8 | 9 | #include "sqlite3.h" 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | #define VERBOSE 0 19 | #if VERBOSE 20 | #define LOG psvDebugScreenPrintf 21 | #else 22 | #define LOG(...) 23 | #endif 24 | 25 | typedef struct VitaFile { 26 | sqlite3_file base; 27 | signed fd; 28 | } VitaFile; 29 | 30 | // File ops 31 | static int vita_xClose(sqlite3_file *pFile) { 32 | VitaFile *p = (VitaFile*)pFile; 33 | sceIoClose(p->fd); 34 | LOG("close %x\n", p->fd); 35 | return SQLITE_OK; 36 | } 37 | 38 | static int vita_xRead(sqlite3_file *pFile, void *zBuf, int iAmt, sqlite_int64 iOfst) { 39 | VitaFile *p = (VitaFile*)pFile; 40 | memset(zBuf, 0, iAmt); 41 | sceIoLseek(p->fd, iOfst, SCE_SEEK_SET); 42 | int read = sceIoRead(p->fd, zBuf, iAmt); 43 | LOG("read %x %x %x => %x\n", p->fd, zBuf, iAmt, read); 44 | if (read == iAmt) 45 | return SQLITE_OK; 46 | else if (read >= 0) 47 | return SQLITE_IOERR_SHORT_READ; 48 | return SQLITE_IOERR_READ; 49 | } 50 | 51 | static int vita_xWrite(sqlite3_file *pFile, const void *zBuf, int iAmt, sqlite_int64 iOfst) { 52 | VitaFile *p = (VitaFile*)pFile; 53 | int ofst = sceIoLseek(p->fd, iOfst, SCE_SEEK_SET); 54 | LOG("seek %x %x => %x\n", p->fd, iOfst, ofst); 55 | if (ofst != iOfst) 56 | return SQLITE_IOERR_WRITE; 57 | int write = sceIoWrite(p->fd, zBuf, iAmt); 58 | LOG("write %x %x %x => %x\n", p->fd, zBuf, iAmt); 59 | if (write != iAmt) 60 | return SQLITE_IOERR_WRITE; 61 | return SQLITE_OK; 62 | } 63 | 64 | static int vita_xTruncate(sqlite3_file *pFile, sqlite_int64 size) { 65 | LOG("truncate\n"); 66 | return SQLITE_OK; 67 | } 68 | 69 | static int vita_xSync(sqlite3_file *pFile, int flags) { 70 | return SQLITE_OK; 71 | } 72 | 73 | static int vita_xFileSize(sqlite3_file *pFile, sqlite_int64 *pSize) { 74 | VitaFile *p = (VitaFile*)pFile; 75 | SceIoStat stat = {0}; 76 | sceIoGetstatByFd(p->fd, &stat); 77 | LOG("filesize %x => %x\n", p->fd, stat.st_size); 78 | *pSize = stat.st_size; 79 | return SQLITE_OK; 80 | } 81 | 82 | static int vita_xLock(sqlite3_file *pFile, int eLock) { 83 | return SQLITE_OK; 84 | } 85 | 86 | static int vita_xUnlock(sqlite3_file *pFile, int eLock) { 87 | return SQLITE_OK; 88 | } 89 | 90 | static int vita_xCheckReservedLock(sqlite3_file *pFile, int *pResOut) { 91 | *pResOut = 0; 92 | return SQLITE_OK; 93 | } 94 | 95 | static int vita_xFileControl(sqlite3_file *pFile, int op, void *pArg) { 96 | return SQLITE_OK; 97 | } 98 | 99 | static int vita_xSectorSize(sqlite3_file *pFile) { 100 | return 0; 101 | } 102 | 103 | static int vita_xDeviceCharacteristics(sqlite3_file *pFile) { 104 | return 0; 105 | } 106 | 107 | // VFS ops 108 | static int vita_xOpen(sqlite3_vfs *vfs, const char *name, sqlite3_file *file, int flags, int *outFlags) { 109 | static const sqlite3_io_methods vitaio = { 110 | 1, 111 | vita_xClose, 112 | vita_xRead, 113 | vita_xWrite, 114 | vita_xTruncate, 115 | vita_xSync, 116 | vita_xFileSize, 117 | vita_xLock, 118 | vita_xUnlock, 119 | vita_xCheckReservedLock, 120 | vita_xFileControl, 121 | vita_xSectorSize, 122 | vita_xDeviceCharacteristics, 123 | }; 124 | 125 | VitaFile *p = (VitaFile*)file; 126 | unsigned oflags = 0; 127 | if (flags & SQLITE_OPEN_EXCLUSIVE) 128 | oflags |= SCE_O_EXCL; 129 | if (flags & SQLITE_OPEN_CREATE) 130 | oflags |= SCE_O_CREAT; 131 | if (flags & SQLITE_OPEN_READONLY) 132 | oflags |= SCE_O_RDONLY; 133 | if (flags & SQLITE_OPEN_READWRITE) 134 | oflags |= SCE_O_RDWR; 135 | // TODO(xyz): sqlite tries to open inexistant journal and then tries to read from it, wtf? 136 | // so force O_CREAT here 137 | if (flags & SQLITE_OPEN_MAIN_JOURNAL && !(flags & SQLITE_OPEN_EXCLUSIVE)) 138 | oflags |= SCE_O_CREAT; 139 | memset(p, 0, sizeof(*p)); 140 | p->fd = sceIoOpen(name, oflags, 7); 141 | LOG("open %s %x orig flags %x => %x\n", name, oflags, flags, p->fd); 142 | if (p->fd < 0) { 143 | return SQLITE_CANTOPEN; 144 | } 145 | if (outFlags) 146 | *outFlags = flags; 147 | 148 | p->base.pMethods = &vitaio; 149 | 150 | return SQLITE_OK; 151 | } 152 | 153 | int vita_xDelete(sqlite3_vfs *vfs, const char *name, int syncDir) { 154 | int ret = sceIoRemove(name); 155 | if (ret < 0) 156 | return SQLITE_IOERR_DELETE; 157 | return SQLITE_OK; 158 | } 159 | 160 | int vita_xAccess(sqlite3_vfs *vfs, const char *name, int flags, int *pResOut) { 161 | *pResOut = 1; 162 | return SQLITE_OK; 163 | } 164 | 165 | int vita_xFullPathname(sqlite3_vfs *vfs, const char *zName, int nOut, char *zOut) { 166 | snprintf(zOut, nOut, "%s", zName); 167 | return 0; 168 | } 169 | 170 | void* vita_xDlOpen(sqlite3_vfs *vfs, const char *zFilename) { 171 | return NULL; 172 | } 173 | 174 | void vita_xDlError(sqlite3_vfs *vfs, int nByte, char *zErrMsg) { 175 | } 176 | 177 | void (*vita_xDlSym(sqlite3_vfs *vfs,void*p, const char *zSymbol))(void) { 178 | return NULL; 179 | } 180 | 181 | void vita_xDlClose(sqlite3_vfs *vfs, void*p) { 182 | } 183 | 184 | int vita_xRandomness(sqlite3_vfs *vfs, int nByte, char *zOut) { 185 | return SQLITE_OK; 186 | } 187 | 188 | int vita_xSleep(sqlite3_vfs *vfs, int microseconds) { 189 | sceKernelDelayThread(microseconds); 190 | return SQLITE_OK; 191 | } 192 | 193 | int vita_xCurrentTime(sqlite3_vfs *vfs, double *pTime) { 194 | time_t t = 0; 195 | SceDateTime time = {0}; 196 | sceRtcGetCurrentClock(&time, 0); 197 | sceRtcGetTime_t(&time, &t); 198 | *pTime = t/86400.0 + 2440587.5; 199 | return SQLITE_OK; 200 | } 201 | 202 | int vita_xGetLastError(sqlite3_vfs *vfs, int e, char *err) { 203 | return 0; 204 | } 205 | 206 | sqlite3_vfs vita_vfs = { 207 | .iVersion = 1, 208 | .szOsFile = sizeof(VitaFile), 209 | .mxPathname = 0x100, 210 | .pNext = NULL, 211 | .zName = "psp2", 212 | .pAppData = NULL, 213 | .xOpen = vita_xOpen, 214 | .xDelete = vita_xDelete, 215 | .xAccess = vita_xAccess, 216 | .xFullPathname = vita_xFullPathname, 217 | .xDlOpen = vita_xDlOpen, 218 | .xDlError = vita_xDlError, 219 | .xDlSym = vita_xDlSym, 220 | .xDlClose = vita_xDlClose, 221 | .xRandomness = vita_xRandomness, 222 | .xSleep = vita_xSleep, 223 | .xCurrentTime = vita_xCurrentTime, 224 | .xGetLastError = vita_xGetLastError, 225 | }; 226 | 227 | int sqlite3_os_init(void) { 228 | sqlite3_vfs_register(&vita_vfs, 1); 229 | return 0; 230 | } 231 | 232 | int sqlite3_os_end(void) { 233 | return 0; 234 | } 235 | -------------------------------------------------------------------------------- /sqlite3/sqlite3.1: -------------------------------------------------------------------------------- 1 | .\" Hey, EMACS: -*- nroff -*- 2 | .\" First parameter, NAME, should be all caps 3 | .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection 4 | .\" other parameters are allowed: see man(7), man(1) 5 | .TH SQLITE3 1 "Mon Apr 15 23:49:17 2002" 6 | .\" Please adjust this date whenever revising the manpage. 7 | .\" 8 | .\" Some roff macros, for reference: 9 | .\" .nh disable hyphenation 10 | .\" .hy enable hyphenation 11 | .\" .ad l left justify 12 | .\" .ad b justify to both left and right margins 13 | .\" .nf disable filling 14 | .\" .fi enable filling 15 | .\" .br insert line break 16 | .\" .sp insert n+1 empty lines 17 | .\" for manpage-specific macros, see man(7) 18 | .SH NAME 19 | .B sqlite3 20 | \- A command line interface for SQLite version 3 21 | 22 | .SH SYNOPSIS 23 | .B sqlite3 24 | .RI [ options ] 25 | .RI [ databasefile ] 26 | .RI [ SQL ] 27 | 28 | .SH SUMMARY 29 | .PP 30 | .B sqlite3 31 | is a terminal-based front-end to the SQLite library that can evaluate 32 | queries interactively and display the results in multiple formats. 33 | .B sqlite3 34 | can also be used within shell scripts and other applications to provide 35 | batch processing features. 36 | 37 | .SH DESCRIPTION 38 | To start a 39 | .B sqlite3 40 | interactive session, invoke the 41 | .B sqlite3 42 | command and optionally provide the name of a database file. If the 43 | database file does not exist, it will be created. If the database file 44 | does exist, it will be opened. 45 | 46 | For example, to create a new database file named "mydata.db", create 47 | a table named "memos" and insert a couple of records into that table: 48 | .sp 49 | $ 50 | .B sqlite3 mydata.db 51 | .br 52 | SQLite version 3.1.3 53 | .br 54 | Enter ".help" for instructions 55 | .br 56 | sqlite> 57 | .B create table memos(text, priority INTEGER); 58 | .br 59 | sqlite> 60 | .B insert into memos values('deliver project description', 10); 61 | .br 62 | sqlite> 63 | .B insert into memos values('lunch with Christine', 100); 64 | .br 65 | sqlite> 66 | .B select * from memos; 67 | .br 68 | deliver project description|10 69 | .br 70 | lunch with Christine|100 71 | .br 72 | sqlite> 73 | .sp 74 | 75 | If no database name is supplied, the ATTACH sql command can be used 76 | to attach to existing or create new database files. ATTACH can also 77 | be used to attach to multiple databases within the same interactive 78 | session. This is useful for migrating data between databases, 79 | possibly changing the schema along the way. 80 | 81 | Optionally, a SQL statement or set of SQL statements can be supplied as 82 | a single argument. Multiple statements should be separated by 83 | semi-colons. 84 | 85 | For example: 86 | .sp 87 | $ 88 | .B sqlite3 -line mydata.db 'select * from memos where priority > 20;' 89 | .br 90 | text = lunch with Christine 91 | .br 92 | priority = 100 93 | .br 94 | .sp 95 | 96 | .SS SQLITE META-COMMANDS 97 | .PP 98 | The interactive interpreter offers a set of meta-commands that can be 99 | used to control the output format, examine the currently attached 100 | database files, or perform administrative operations upon the 101 | attached databases (such as rebuilding indices). Meta-commands are 102 | always prefixed with a dot (.). 103 | 104 | A list of available meta-commands can be viewed at any time by issuing 105 | the '.help' command. For example: 106 | .sp 107 | sqlite> 108 | .B .help 109 | .nf 110 | .cc | 111 | .databases List names and files of attached databases 112 | .dump ?TABLE? ... Dump the database in an SQL text format 113 | .echo ON|OFF Turn command echo on or off 114 | .exit Exit this program 115 | .explain ON|OFF Turn output mode suitable for EXPLAIN on or off. 116 | .header(s) ON|OFF Turn display of headers on or off 117 | .help Show this message 118 | .import FILE TABLE Import data from FILE into TABLE 119 | .indices TABLE Show names of all indices on TABLE 120 | .mode MODE ?TABLE? Set output mode where MODE is one of: 121 | csv Comma-separated values 122 | column Left-aligned columns. (See .width) 123 | html HTML code 124 | insert SQL insert statements for TABLE 125 | line One value per line 126 | list Values delimited by .separator string 127 | tabs Tab-separated values 128 | tcl TCL list elements 129 | .nullvalue STRING Print STRING in place of NULL values 130 | .output FILENAME Send output to FILENAME 131 | .output stdout Send output to the screen 132 | .prompt MAIN CONTINUE Replace the standard prompts 133 | .quit Exit this program 134 | .read FILENAME Execute SQL in FILENAME 135 | .schema ?TABLE? Show the CREATE statements 136 | .separator STRING Change separator used by output mode and .import 137 | .show Show the current values for various settings 138 | .tables ?PATTERN? List names of tables matching a LIKE pattern 139 | .timeout MS Try opening locked tables for MS milliseconds 140 | .width NUM NUM ... Set column widths for "column" mode 141 | sqlite> 142 | |cc . 143 | .sp 144 | .fi 145 | 146 | .SH OPTIONS 147 | .B sqlite3 148 | has the following options: 149 | .TP 150 | .BI \-init\ file 151 | Read and execute commands from 152 | .I file 153 | , which can contain a mix of SQL statements and meta-commands. 154 | .TP 155 | .B \-echo 156 | Print commands before execution. 157 | .TP 158 | .B \-[no]header 159 | Turn headers on or off. 160 | .TP 161 | .B \-column 162 | Query results will be displayed in a table like form, using 163 | whitespace characters to separate the columns and align the 164 | output. 165 | .TP 166 | .B \-html 167 | Query results will be output as simple HTML tables. 168 | .TP 169 | .B \-line 170 | Query results will be displayed with one value per line, rows 171 | separated by a blank line. Designed to be easily parsed by 172 | scripts or other programs 173 | .TP 174 | .B \-list 175 | Query results will be displayed with the separator (|, by default) 176 | character between each field value. The default. 177 | .TP 178 | .BI \-separator\ separator 179 | Set output field separator. Default is '|'. 180 | .TP 181 | .BI \-nullvalue\ string 182 | Set string used to represent NULL values. Default is '' 183 | (empty string). 184 | .TP 185 | .B \-version 186 | Show SQLite version. 187 | .TP 188 | .B \-help 189 | Show help on options and exit. 190 | 191 | 192 | .SH INIT FILE 193 | .B sqlite3 194 | reads an initialization file to set the configuration of the 195 | interactive environment. Throughout initialization, any previously 196 | specified setting can be overridden. The sequence of initialization is 197 | as follows: 198 | 199 | o The default configuration is established as follows: 200 | 201 | .sp 202 | .nf 203 | .cc | 204 | mode = LIST 205 | separator = "|" 206 | main prompt = "sqlite> " 207 | continue prompt = " ...> " 208 | |cc . 209 | .sp 210 | .fi 211 | 212 | o If the file 213 | .B ~/.sqliterc 214 | exists, it is processed first. 215 | can be found in the user's home directory, it is 216 | read and processed. It should generally only contain meta-commands. 217 | 218 | o If the -init option is present, the specified file is processed. 219 | 220 | o All other command line options are processed. 221 | 222 | .SH SEE ALSO 223 | http://www.sqlite.org/ 224 | .br 225 | The sqlite-doc package 226 | .SH AUTHOR 227 | This manual page was originally written by Andreas Rottmann 228 | , for the Debian GNU/Linux system (but may be used 229 | by others). It was subsequently revised by Bill Bumgarner . 230 | -------------------------------------------------------------------------------- /src/remap/config.c: -------------------------------------------------------------------------------- 1 | #include "config.h" 2 | 3 | #include 4 | 5 | #define FREAD_INTO(into, stream) fread(&into, sizeof(into), 1, stream) 6 | #define FWRITE_FROM(from, stream) fwrite(&from, sizeof(from), 1, stream) 7 | 8 | #define VOID_FOPEN() size_t v_offset = 0; 9 | #define VOID_FREAD_INTO(type, into, ptr) into = *((type *) (ptr + v_offset)); v_offset += sizeof(type); 10 | #define VOID_FREAD(type, into, size, ptr) into = ((type *) (ptr + v_offset)); v_offset += size; 11 | 12 | #define CONFIG_VERSION 1 13 | 14 | int config_mem_load(void *ptr, remap_config_t *result) { 15 | VOID_FOPEN(); 16 | 17 | int version = 0; 18 | VOID_FREAD_INTO(int, version, ptr); 19 | if (version != CONFIG_VERSION) { 20 | return -1; 21 | } 22 | 23 | // read deadzones 24 | VOID_FREAD_INTO(int, result->rs_deadzone, ptr); 25 | VOID_FREAD_INTO(int, result->ls_deadzone, ptr); 26 | VOID_FREAD_INTO(int, result->back_touch_deadzone_vertical, ptr); 27 | VOID_FREAD_INTO(int, result->back_touch_deadzone_horizontal, ptr); 28 | VOID_FREAD_INTO(int, result->front_touch_deadzone_vertical, ptr); 29 | VOID_FREAD_INTO(int, result->front_touch_deadzone_horizontal, ptr); 30 | 31 | VOID_FREAD_INTO(int, result->size, ptr); 32 | result->triggers = malloc(sizeof(trigger_t) * result->size); 33 | VOID_FREAD(trigger_t, result->triggers, sizeof(trigger_t) * result->size, ptr); 34 | 35 | // read actions 36 | result->actions = malloc(sizeof(action_list_t) * result->size); 37 | for (int i = 0; i < result->size; i++) { 38 | VOID_FREAD_INTO(int, result->actions[i].size, ptr); 39 | result->actions[i].list = malloc(sizeof(action_t) * result->actions[i].size); 40 | 41 | VOID_FREAD(action_t, result->actions[i].list, sizeof(action_t) * result->actions[i].size, ptr); 42 | } 43 | 44 | return 0; 45 | } 46 | 47 | #ifndef PLUGIN 48 | 49 | void config_path(application_t app, char path[CONFIG_APP_PATH_SIZE]) { 50 | sprintf(path, "ux0:data/advremap/%s", app.id); 51 | } 52 | 53 | void config_binary_path(application_t app, char path[CONFIG_APP_PATH_SIZE]) { 54 | sprintf(path, "ux0:tai/advremap/%s.suprx", app.id); 55 | } 56 | 57 | int config_load(char *path, remap_config_t *result) { 58 | FILE *file = fopen(path, "r"); 59 | if (!file) { 60 | return -1; 61 | } 62 | 63 | int version = 0; 64 | FREAD_INTO(version, file); 65 | if (version != CONFIG_VERSION) { 66 | return -1; 67 | } 68 | 69 | // read deadzones 70 | FREAD_INTO(result->rs_deadzone, file); 71 | FREAD_INTO(result->ls_deadzone, file); 72 | FREAD_INTO(result->back_touch_deadzone_vertical, file); 73 | FREAD_INTO(result->back_touch_deadzone_horizontal, file); 74 | FREAD_INTO(result->front_touch_deadzone_vertical, file); 75 | FREAD_INTO(result->front_touch_deadzone_horizontal, file); 76 | 77 | // read triggers 78 | FREAD_INTO(result->size, file); 79 | result->triggers = malloc(sizeof(trigger_t) * result->size); 80 | fread(result->triggers, sizeof(trigger_t), result->size, file); 81 | 82 | // read actions 83 | result->actions = malloc(sizeof(action_list_t) * result->size); 84 | for (int i = 0; i < result->size; i++) { 85 | FREAD_INTO(result->actions[i].size, file); 86 | result->actions[i].list = malloc(sizeof(action_t) * result->actions[i].size); 87 | fread(result->actions[i].list, sizeof(action_t), result->actions[i].size, file); 88 | } 89 | 90 | fclose(file); 91 | return 0; 92 | } 93 | 94 | int config_save(char *path, remap_config_t config) { 95 | FILE *file = fopen(path, "w"); 96 | 97 | int version = CONFIG_VERSION; 98 | FWRITE_FROM(version, file); 99 | FWRITE_FROM(config.rs_deadzone, file); 100 | FWRITE_FROM(config.ls_deadzone, file); 101 | FWRITE_FROM(config.back_touch_deadzone_vertical, file); 102 | FWRITE_FROM(config.back_touch_deadzone_horizontal, file); 103 | FWRITE_FROM(config.front_touch_deadzone_vertical, file); 104 | FWRITE_FROM(config.front_touch_deadzone_horizontal, file); 105 | 106 | FWRITE_FROM(config.size, file); 107 | fwrite(config.triggers, sizeof(trigger_t), config.size, file); 108 | for (int i = 0; i < config.size; i++) { 109 | FWRITE_FROM(config.actions[i].size, file); 110 | fwrite(config.actions[i].list, sizeof(action_t), config.actions[i].size, file); 111 | } 112 | 113 | fclose(file); 114 | 115 | return 0; 116 | } 117 | 118 | int config_binary_save(char *binary_path, char *config_path) { 119 | void *config_mem = malloc(CONFIG_MEM_MAX_SIZE); 120 | FILE *config_file = fopen(config_path, "r"); 121 | fread(config_mem, CONFIG_MEM_MAX_SIZE, 1, config_file); 122 | fclose(config_file); 123 | 124 | // it looks like fseek doesn't work, so we use sceIo here 125 | SceUID binary_file = sceIoOpen(binary_path, SCE_O_WRONLY, 0777); 126 | sceIoLseek(binary_file, CONFIG_MEM_OFFSET, SCE_SEEK_SET); 127 | sceIoWrite(binary_file, config_mem, CONFIG_MEM_MAX_SIZE); 128 | 129 | sceIoClose(binary_file); 130 | 131 | free(config_mem); 132 | return 0; 133 | } 134 | 135 | int config_binary_install(char *path) { 136 | void *buf = malloc(1024 * 1024); 137 | 138 | SceUID f = sceIoOpen(CONFIG_PLUGIN_PATH, SCE_O_RDONLY, 0777); 139 | int size = sceIoRead(f, buf, 1024 * 1024); 140 | sceIoClose(f); 141 | 142 | FILE *out = fopen(path, "w"); 143 | fwrite(buf, size, 1, out); 144 | fclose(out); 145 | free(buf); 146 | 147 | return 0; 148 | } 149 | 150 | int config_taihen_append(application_t app) { 151 | FILE *f = fopen(CONFIG_TAIHEN_PATH, "r"); 152 | 153 | char app_line[256]; 154 | sprintf(app_line, "ux0:tai/advremap/%s.suprx", app.id); 155 | 156 | char current_line[192]; 157 | while (true) { 158 | char current_char; 159 | int i = 0; 160 | int len = 0; 161 | while ((len = fread(¤t_char, sizeof(char), 1, f)) > 0) { 162 | if (current_char == '\n') { 163 | break; 164 | } 165 | 166 | current_line[i++] = current_char; 167 | } 168 | 169 | current_line[i] = '\0'; 170 | if (strcmp(current_line, app_line) == 0) { 171 | return 0; 172 | } 173 | 174 | if (strcmp(current_line+1, app_line) == 0) { 175 | return 2; 176 | } 177 | 178 | if (len <= 0) { 179 | break; 180 | } 181 | } 182 | 183 | fclose(f); 184 | 185 | f = fopen(CONFIG_TAIHEN_PATH, "a"); 186 | fprintf(f, "\n#*%s\n#%s\n", app.id, app_line); 187 | fclose(f); 188 | 189 | return 1; 190 | } 191 | 192 | int config_default(remap_config_t *config) { 193 | config->rs_deadzone = 0; 194 | config->ls_deadzone = 0; 195 | config->back_touch_deadzone_vertical = 0; 196 | config->back_touch_deadzone_horizontal = 0; 197 | config->front_touch_deadzone_vertical = 0; 198 | config->front_touch_deadzone_horizontal = 0; 199 | config->size = 0; 200 | 201 | return 0; 202 | } 203 | 204 | void config_append_remap(remap_config_t *config) { 205 | int i = config->size++; 206 | config->triggers = realloc(config->triggers, sizeof(trigger_t) * config->size); 207 | config->triggers[i] = CTRL_CROSS; 208 | 209 | action_list_t list = { 210 | .size = 0, 211 | .list = 0, 212 | }; 213 | 214 | config->actions = realloc(config->actions, sizeof(action_list_t) * config->size); 215 | config->actions[i] = list; 216 | } 217 | 218 | void config_remove_remap(remap_config_t *config, int n) { 219 | for (; n < config->size - 1; n++) { 220 | config->actions[n] = config->actions[n+1]; 221 | config->triggers[n] = config->triggers[n+1]; 222 | } 223 | 224 | config->size--; 225 | config->triggers = realloc(config->triggers, sizeof(trigger_t) * config->size); 226 | config->actions = realloc(config->actions, sizeof(action_list_t) * config->size); 227 | } 228 | 229 | #endif 230 | -------------------------------------------------------------------------------- /plugin/src/font.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - http://www.pspdev.org 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * font.c - Debug Font. 7 | * 8 | * Copyright (c) 2005 Marcus R. Brown 9 | * Copyright (c) 2005 James Forshaw 10 | * Copyright (c) 2005 John Kelley 11 | * 12 | * $Id: font.c 339 2005-06-27 02:24:25Z warren $ 13 | */ 14 | #include 15 | 16 | const uint8_t msx[]= 17 | "\x00\x00\x00\x00\x00\x00\x00\x00\x3c\x42\xa5\x81\xa5\x99\x42\x3c" 18 | "\x3c\x7e\xdb\xff\xff\xdb\x66\x3c\x6c\xfe\xfe\xfe\x7c\x38\x10\x00" 19 | "\x10\x38\x7c\xfe\x7c\x38\x10\x00\x10\x38\x54\xfe\x54\x10\x38\x00" 20 | "\x10\x38\x7c\xfe\xfe\x10\x38\x00\x00\x00\x00\x30\x30\x00\x00\x00" 21 | "\xff\xff\xff\xe7\xe7\xff\xff\xff\x38\x44\x82\x82\x82\x44\x38\x00" 22 | "\xc7\xbb\x7d\x7d\x7d\xbb\xc7\xff\x0f\x03\x05\x79\x88\x88\x88\x70" 23 | "\x38\x44\x44\x44\x38\x10\x7c\x10\x30\x28\x24\x24\x28\x20\xe0\xc0" 24 | "\x3c\x24\x3c\x24\x24\xe4\xdc\x18\x10\x54\x38\xee\x38\x54\x10\x00" 25 | "\x10\x10\x10\x7c\x10\x10\x10\x10\x10\x10\x10\xff\x00\x00\x00\x00" 26 | "\x00\x00\x00\xff\x10\x10\x10\x10\x10\x10\x10\xf0\x10\x10\x10\x10" 27 | "\x10\x10\x10\x1f\x10\x10\x10\x10\x10\x10\x10\xff\x10\x10\x10\x10" 28 | "\x10\x10\x10\x10\x10\x10\x10\x10\x00\x00\x00\xff\x00\x00\x00\x00" 29 | "\x00\x00\x00\x1f\x10\x10\x10\x10\x00\x00\x00\xf0\x10\x10\x10\x10" 30 | "\x10\x10\x10\x1f\x00\x00\x00\x00\x10\x10\x10\xf0\x00\x00\x00\x00" 31 | "\x81\x42\x24\x18\x18\x24\x42\x81\x01\x02\x04\x08\x10\x20\x40\x80" 32 | "\x80\x40\x20\x10\x08\x04\x02\x01\x00\x10\x10\xff\x10\x10\x00\x00" 33 | "\x00\x00\x00\x00\x00\x00\x00\x00\x20\x20\x20\x20\x00\x00\x20\x00" 34 | "\x50\x50\x50\x00\x00\x00\x00\x00\x50\x50\xf8\x50\xf8\x50\x50\x00" 35 | "\x20\x78\xa0\x70\x28\xf0\x20\x00\xc0\xc8\x10\x20\x40\x98\x18\x00" 36 | "\x40\xa0\x40\xa8\x90\x98\x60\x00\x10\x20\x40\x00\x00\x00\x00\x00" 37 | "\x10\x20\x40\x40\x40\x20\x10\x00\x40\x20\x10\x10\x10\x20\x40\x00" 38 | "\x20\xa8\x70\x20\x70\xa8\x20\x00\x00\x20\x20\xf8\x20\x20\x00\x00" 39 | "\x00\x00\x00\x00\x00\x20\x20\x40\x00\x00\x00\x78\x00\x00\x00\x00" 40 | "\x00\x00\x00\x00\x00\x60\x60\x00\x00\x00\x08\x10\x20\x40\x80\x00" 41 | "\x70\x88\x98\xa8\xc8\x88\x70\x00\x20\x60\xa0\x20\x20\x20\xf8\x00" 42 | "\x70\x88\x08\x10\x60\x80\xf8\x00\x70\x88\x08\x30\x08\x88\x70\x00" 43 | "\x10\x30\x50\x90\xf8\x10\x10\x00\xf8\x80\xe0\x10\x08\x10\xe0\x00" 44 | "\x30\x40\x80\xf0\x88\x88\x70\x00\xf8\x88\x10\x20\x20\x20\x20\x00" 45 | "\x70\x88\x88\x70\x88\x88\x70\x00\x70\x88\x88\x78\x08\x10\x60\x00" 46 | "\x00\x00\x20\x00\x00\x20\x00\x00\x00\x00\x20\x00\x00\x20\x20\x40" 47 | "\x18\x30\x60\xc0\x60\x30\x18\x00\x00\x00\xf8\x00\xf8\x00\x00\x00" 48 | "\xc0\x60\x30\x18\x30\x60\xc0\x00\x70\x88\x08\x10\x20\x00\x20\x00" 49 | "\x70\x88\x08\x68\xa8\xa8\x70\x00\x20\x50\x88\x88\xf8\x88\x88\x00" 50 | "\xf0\x48\x48\x70\x48\x48\xf0\x00\x30\x48\x80\x80\x80\x48\x30\x00" 51 | "\xe0\x50\x48\x48\x48\x50\xe0\x00\xf8\x80\x80\xf0\x80\x80\xf8\x00" 52 | "\xf8\x80\x80\xf0\x80\x80\x80\x00\x70\x88\x80\xb8\x88\x88\x70\x00" 53 | "\x88\x88\x88\xf8\x88\x88\x88\x00\x70\x20\x20\x20\x20\x20\x70\x00" 54 | "\x38\x10\x10\x10\x90\x90\x60\x00\x88\x90\xa0\xc0\xa0\x90\x88\x00" 55 | "\x80\x80\x80\x80\x80\x80\xf8\x00\x88\xd8\xa8\xa8\x88\x88\x88\x00" 56 | "\x88\xc8\xc8\xa8\x98\x98\x88\x00\x70\x88\x88\x88\x88\x88\x70\x00" 57 | "\xf0\x88\x88\xf0\x80\x80\x80\x00\x70\x88\x88\x88\xa8\x90\x68\x00" 58 | "\xf0\x88\x88\xf0\xa0\x90\x88\x00\x70\x88\x80\x70\x08\x88\x70\x00" 59 | "\xf8\x20\x20\x20\x20\x20\x20\x00\x88\x88\x88\x88\x88\x88\x70\x00" 60 | "\x88\x88\x88\x88\x50\x50\x20\x00\x88\x88\x88\xa8\xa8\xd8\x88\x00" 61 | "\x88\x88\x50\x20\x50\x88\x88\x00\x88\x88\x88\x70\x20\x20\x20\x00" 62 | "\xf8\x08\x10\x20\x40\x80\xf8\x00\x70\x40\x40\x40\x40\x40\x70\x00" 63 | "\x00\x00\x80\x40\x20\x10\x08\x00\x70\x10\x10\x10\x10\x10\x70\x00" 64 | "\x20\x50\x88\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf8\x00" 65 | "\x40\x20\x10\x00\x00\x00\x00\x00\x00\x00\x70\x08\x78\x88\x78\x00" 66 | "\x80\x80\xb0\xc8\x88\xc8\xb0\x00\x00\x00\x70\x88\x80\x88\x70\x00" 67 | "\x08\x08\x68\x98\x88\x98\x68\x00\x00\x00\x70\x88\xf8\x80\x70\x00" 68 | "\x10\x28\x20\xf8\x20\x20\x20\x00\x00\x00\x68\x98\x98\x68\x08\x70" 69 | "\x80\x80\xf0\x88\x88\x88\x88\x00\x20\x00\x60\x20\x20\x20\x70\x00" 70 | "\x10\x00\x30\x10\x10\x10\x90\x60\x40\x40\x48\x50\x60\x50\x48\x00" 71 | "\x60\x20\x20\x20\x20\x20\x70\x00\x00\x00\xd0\xa8\xa8\xa8\xa8\x00" 72 | "\x00\x00\xb0\xc8\x88\x88\x88\x00\x00\x00\x70\x88\x88\x88\x70\x00" 73 | "\x00\x00\xb0\xc8\xc8\xb0\x80\x80\x00\x00\x68\x98\x98\x68\x08\x08" 74 | "\x00\x00\xb0\xc8\x80\x80\x80\x00\x00\x00\x78\x80\xf0\x08\xf0\x00" 75 | "\x40\x40\xf0\x40\x40\x48\x30\x00\x00\x00\x90\x90\x90\x90\x68\x00" 76 | "\x00\x00\x88\x88\x88\x50\x20\x00\x00\x00\x88\xa8\xa8\xa8\x50\x00" 77 | "\x00\x00\x88\x50\x20\x50\x88\x00\x00\x00\x88\x88\x98\x68\x08\x70" 78 | "\x00\x00\xf8\x10\x20\x40\xf8\x00\x18\x20\x20\x40\x20\x20\x18\x00" 79 | "\x20\x20\x20\x00\x20\x20\x20\x00\xc0\x20\x20\x10\x20\x20\xc0\x00" 80 | "\x40\xa8\x10\x00\x00\x00\x00\x00\x00\x00\x20\x50\xf8\x00\x00\x00" 81 | "\x70\x88\x80\x80\x88\x70\x20\x60\x90\x00\x00\x90\x90\x90\x68\x00" 82 | "\x10\x20\x70\x88\xf8\x80\x70\x00\x20\x50\x70\x08\x78\x88\x78\x00" 83 | "\x48\x00\x70\x08\x78\x88\x78\x00\x20\x10\x70\x08\x78\x88\x78\x00" 84 | "\x20\x00\x70\x08\x78\x88\x78\x00\x00\x70\x80\x80\x80\x70\x10\x60" 85 | "\x20\x50\x70\x88\xf8\x80\x70\x00\x50\x00\x70\x88\xf8\x80\x70\x00" 86 | "\x20\x10\x70\x88\xf8\x80\x70\x00\x50\x00\x00\x60\x20\x20\x70\x00" 87 | "\x20\x50\x00\x60\x20\x20\x70\x00\x40\x20\x00\x60\x20\x20\x70\x00" 88 | "\x50\x00\x20\x50\x88\xf8\x88\x00\x20\x00\x20\x50\x88\xf8\x88\x00" 89 | "\x10\x20\xf8\x80\xf0\x80\xf8\x00\x00\x00\x6c\x12\x7e\x90\x6e\x00" 90 | "\x3e\x50\x90\x9c\xf0\x90\x9e\x00\x60\x90\x00\x60\x90\x90\x60\x00" 91 | "\x90\x00\x00\x60\x90\x90\x60\x00\x40\x20\x00\x60\x90\x90\x60\x00" 92 | "\x40\xa0\x00\xa0\xa0\xa0\x50\x00\x40\x20\x00\xa0\xa0\xa0\x50\x00" 93 | "\x90\x00\x90\x90\xb0\x50\x10\xe0\x50\x00\x70\x88\x88\x88\x70\x00" 94 | "\x50\x00\x88\x88\x88\x88\x70\x00\x20\x20\x78\x80\x80\x78\x20\x20" 95 | "\x18\x24\x20\xf8\x20\xe2\x5c\x00\x88\x50\x20\xf8\x20\xf8\x20\x00" 96 | "\xc0\xa0\xa0\xc8\x9c\x88\x88\x8c\x18\x20\x20\xf8\x20\x20\x20\x40" 97 | "\x10\x20\x70\x08\x78\x88\x78\x00\x10\x20\x00\x60\x20\x20\x70\x00" 98 | "\x20\x40\x00\x60\x90\x90\x60\x00\x20\x40\x00\x90\x90\x90\x68\x00" 99 | "\x50\xa0\x00\xa0\xd0\x90\x90\x00\x28\x50\x00\xc8\xa8\x98\x88\x00" 100 | "\x00\x70\x08\x78\x88\x78\x00\xf8\x00\x60\x90\x90\x90\x60\x00\xf0" 101 | "\x20\x00\x20\x40\x80\x88\x70\x00\x00\x00\x00\xf8\x80\x80\x00\x00" 102 | "\x00\x00\x00\xf8\x08\x08\x00\x00\x84\x88\x90\xa8\x54\x84\x08\x1c" 103 | "\x84\x88\x90\xa8\x58\xa8\x3c\x08\x20\x00\x00\x20\x20\x20\x20\x00" 104 | "\x00\x00\x24\x48\x90\x48\x24\x00\x00\x00\x90\x48\x24\x48\x90\x00" 105 | "\x28\x50\x20\x50\x88\xf8\x88\x00\x28\x50\x70\x08\x78\x88\x78\x00" 106 | "\x28\x50\x00\x70\x20\x20\x70\x00\x28\x50\x00\x20\x20\x20\x70\x00" 107 | "\x28\x50\x00\x70\x88\x88\x70\x00\x50\xa0\x00\x60\x90\x90\x60\x00" 108 | "\x28\x50\x00\x88\x88\x88\x70\x00\x50\xa0\x00\xa0\xa0\xa0\x50\x00" 109 | "\xfc\x48\x48\x48\xe8\x08\x50\x20\x00\x50\x00\x50\x50\x50\x10\x20" 110 | "\xc0\x44\xc8\x54\xec\x54\x9e\x04\x10\xa8\x40\x00\x00\x00\x00\x00" 111 | "\x00\x20\x50\x88\x50\x20\x00\x00\x88\x10\x20\x40\x80\x28\x00\x00" 112 | "\x7c\xa8\xa8\x68\x28\x28\x28\x00\x38\x40\x30\x48\x48\x30\x08\x70" 113 | "\x00\x00\x00\x00\x00\x00\xff\xff\xf0\xf0\xf0\xf0\x0f\x0f\x0f\x0f" 114 | "\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00" 115 | "\x00\x00\x00\x3c\x3c\x00\x00\x00\xff\xff\xff\xff\xff\xff\x00\x00" 116 | "\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\x0f\x0f\x0f\x0f\xf0\xf0\xf0\xf0" 117 | "\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\x03\x03\x03\x03\x03\x03\x03\x03" 118 | "\x3f\x3f\x3f\x3f\x3f\x3f\x3f\x3f\x11\x22\x44\x88\x11\x22\x44\x88" 119 | "\x88\x44\x22\x11\x88\x44\x22\x11\xfe\x7c\x38\x10\x00\x00\x00\x00" 120 | "\x00\x00\x00\x00\x10\x38\x7c\xfe\x80\xc0\xe0\xf0\xe0\xc0\x80\x00" 121 | "\x01\x03\x07\x0f\x07\x03\x01\x00\xff\x7e\x3c\x18\x18\x3c\x7e\xff" 122 | "\x81\xc3\xe7\xff\xff\xe7\xc3\x81\xf0\xf0\xf0\xf0\x00\x00\x00\x00" 123 | "\x00\x00\x00\x00\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x00\x00\x00\x00" 124 | "\x00\x00\x00\x00\xf0\xf0\xf0\xf0\x33\x33\xcc\xcc\x33\x33\xcc\xcc" 125 | "\x00\x20\x20\x50\x50\x88\xf8\x00\x20\x20\x70\x20\x70\x20\x20\x00" 126 | "\x00\x00\x00\x50\x88\xa8\x50\x00\xff\xff\xff\xff\xff\xff\xff\xff" 127 | "\x00\x00\x00\x00\xff\xff\xff\xff\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0" 128 | "\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\xff\xff\xff\xff\x00\x00\x00\x00" 129 | "\x00\x00\x68\x90\x90\x90\x68\x00\x30\x48\x48\x70\x48\x48\x70\xc0" 130 | "\xf8\x88\x80\x80\x80\x80\x80\x00\xf8\x50\x50\x50\x50\x50\x98\x00" 131 | "\xf8\x88\x40\x20\x40\x88\xf8\x00\x00\x00\x78\x90\x90\x90\x60\x00" 132 | "\x00\x50\x50\x50\x50\x68\x80\x80\x00\x50\xa0\x20\x20\x20\x20\x00" 133 | "\xf8\x20\x70\xa8\xa8\x70\x20\xf8\x20\x50\x88\xf8\x88\x50\x20\x00" 134 | "\x70\x88\x88\x88\x50\x50\xd8\x00\x30\x40\x40\x20\x50\x50\x50\x20" 135 | "\x00\x00\x00\x50\xa8\xa8\x50\x00\x08\x70\xa8\xa8\xa8\x70\x80\x00" 136 | "\x38\x40\x80\xf8\x80\x40\x38\x00\x70\x88\x88\x88\x88\x88\x88\x00" 137 | "\x00\xf8\x00\xf8\x00\xf8\x00\x00\x20\x20\xf8\x20\x20\x00\xf8\x00" 138 | "\xc0\x30\x08\x30\xc0\x00\xf8\x00\x18\x60\x80\x60\x18\x00\xf8\x00" 139 | "\x10\x28\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\xa0\x40" 140 | "\x00\x20\x00\xf8\x00\x20\x00\x00\x00\x50\xa0\x00\x50\xa0\x00\x00" 141 | "\x00\x18\x24\x24\x18\x00\x00\x00\x00\x30\x78\x78\x30\x00\x00\x00" 142 | "\x00\x00\x00\x00\x30\x00\x00\x00\x3e\x20\x20\x20\xa0\x60\x20\x00" 143 | "\xa0\x50\x50\x50\x00\x00\x00\x00\x40\xa0\x20\x40\xe0\x00\x00\x00" 144 | "\x00\x38\x38\x38\x38\x38\x38\x00\x00\x00\x00\x00\x00\x00\x00"; 145 | -------------------------------------------------------------------------------- /src/ui/app_menu.c: -------------------------------------------------------------------------------- 1 | #include "app_menu.h" 2 | #include "test_remap.h" 3 | 4 | enum { 5 | APP_MENU_TEST_REMAP = 128, 6 | APP_MENU_DEADZONES, 7 | }; 8 | 9 | #define TRIGGER_MENU_OK 2 10 | #define TRIGGER_MENU_CANCEL GUI_EXIT 11 | #define MENU_RELOAD 2 12 | 13 | static int iteration = 0; 14 | static remap_config_t config; 15 | static SceRtcTick wait_until_tick; 16 | static deadzone_loop_setup = false; 17 | 18 | // deadzone 19 | 20 | int ui_deadzone_menu_loop(int cursor_id, void *context) { 21 | bool did_change = false; 22 | 23 | bool left = was_button_pressed(SCE_CTRL_LEFT), right = was_button_pressed(SCE_CTRL_RIGHT); 24 | if (left || right) { 25 | int delta = left ? -15 : (right ? 15 : 0); 26 | 27 | switch (cursor_id) { 28 | case 1: config.back_touch_deadzone_vertical += delta; break; 29 | case 2: config.back_touch_deadzone_horizontal += delta; break; 30 | case 3: config.front_touch_deadzone_vertical += delta; break; 31 | case 4: config.front_touch_deadzone_horizontal += delta; break; 32 | case 5: config.rs_deadzone += delta; break; 33 | case 6: config.ls_deadzone += delta; break; 34 | } 35 | 36 | did_change = true; 37 | } 38 | 39 | if (did_change || deadzone_loop_setup) { 40 | int numbers[] = { config.back_touch_deadzone_vertical, config.back_touch_deadzone_horizontal, config.front_touch_deadzone_vertical, config.front_touch_deadzone_horizontal, config.rs_deadzone, config.ls_deadzone }; 41 | struct menu_entry *menu = context; 42 | 43 | for (int i = 0; i < sizeof(numbers) / sizeof(int); i++) { 44 | sprintf(menu[i + 1].subname, "%dpx", numbers[i]); 45 | } 46 | 47 | deadzone_loop_setup = false; 48 | } 49 | 50 | return GUI_CONTINUE; 51 | } 52 | 53 | void ui_deadzone_menu_draw(void *context) { 54 | SceCtrlData pad; 55 | SceTouchData front; 56 | SceTouchData back; 57 | 58 | sceCtrlPeekBufferPositive(0, &pad, 1); 59 | sceTouchPeek(SCE_TOUCH_PORT_FRONT, &front, 1); 60 | sceTouchPeek(SCE_TOUCH_PORT_BACK, &back, 1); 61 | 62 | remap_deadzone_ignore(config, &pad, &front, &back); 63 | 64 | draw_touch_at(front, 300, 250); 65 | draw_touch_at(back, 300, 370); 66 | draw_sticks_at(pad, 0, 370); 67 | } 68 | 69 | int ui_deadzone_menu() { 70 | deadzone_loop_setup = true; 71 | struct menu_entry menu[16]; 72 | int idx = 0; 73 | 74 | char subnames[6][128]; 75 | 76 | menu[idx++] = (struct menu_entry) { .name = "Deadzones", .disabled = true, .separator = true, .color = 0xffaa00aa }; 77 | menu[idx++] = (struct menu_entry) { .name = "Back touch vertical", .subname = subnames[0], .suffix = "←→", .id = 1 }; 78 | menu[idx++] = (struct menu_entry) { .name = "Back touch horizontal", .subname = subnames[1], .suffix = "←→", .id = 2 }; 79 | menu[idx++] = (struct menu_entry) { .name = "Front touch vertical", .subname = subnames[2], .suffix = "←→", .id = 3 }; 80 | menu[idx++] = (struct menu_entry) { .name = "Front touch horizontal", .subname = subnames[3], .suffix = "←→", .id = 4 }; 81 | 82 | menu[idx++] = (struct menu_entry) { .name = "RS deadzone", .subname = subnames[4], .suffix = "←→", .id = 5 }; 83 | menu[idx++] = (struct menu_entry) { .name = "LS deadzone", .subname = subnames[5], .suffix = "←→", .id = 6 }; 84 | 85 | struct menu_geom geom = make_geom_centered(400, 180); 86 | geom.y = 30; 87 | return display_menu( 88 | menu, 89 | idx, 90 | &geom, 91 | &ui_deadzone_menu_loop, 92 | NULL, 93 | &ui_deadzone_menu_draw, 94 | DEFAULT_GUIDE, 95 | (void *) menu 96 | ); 97 | } 98 | 99 | // action 100 | int ui_action_menu_loop(int cursor_id, void *context) { 101 | SceRtcTick current_tick; 102 | sceRtcGetCurrentTick(¤t_tick); 103 | if (current_tick.tick > wait_until_tick.tick) { 104 | SceCtrlData pad; 105 | SceTouchData front; 106 | SceTouchData back; 107 | 108 | sceCtrlPeekBufferPositive(0, &pad, 1); 109 | sceTouchPeek(SCE_TOUCH_PORT_FRONT, &front, 1); 110 | sceTouchPeek(SCE_TOUCH_PORT_BACK, &back, 1); 111 | 112 | remap_deadzone_ignore(config, &pad, &front, &back); 113 | 114 | if (remap_read_actions((action_list_t *) context, pad, front, back) == 0) { 115 | return TRIGGER_MENU_OK; 116 | } else { 117 | return TRIGGER_MENU_CANCEL; 118 | } 119 | } 120 | 121 | return GUI_CONTINUE; 122 | } 123 | 124 | int ui_action_menu(action_list_t *actions) { 125 | sceRtcGetCurrentTick(&wait_until_tick); 126 | wait_until_tick.tick += 3000 * 1000; 127 | 128 | char *alert_text = "Hold the buttons to replace with\nuntil this message dissapear.\nDont touch anything to cancel."; 129 | return display_alert( 130 | alert_text, 131 | make_geom_centered(400, 200), 132 | NULL, 133 | 0, 134 | &ui_action_menu_loop, 135 | (void *) actions 136 | ); 137 | } 138 | 139 | // trigger 140 | int ui_trigger_menu_loop(int cursor_id, void *context) { 141 | SceRtcTick current_tick; 142 | sceRtcGetCurrentTick(¤t_tick); 143 | if (current_tick.tick > wait_until_tick.tick) { 144 | SceCtrlData pad; 145 | SceTouchData front; 146 | SceTouchData back; 147 | 148 | sceCtrlPeekBufferPositive(0, &pad, 1); 149 | sceTouchPeek(SCE_TOUCH_PORT_FRONT, &front, 1); 150 | sceTouchPeek(SCE_TOUCH_PORT_BACK, &back, 1); 151 | 152 | remap_deadzone_ignore(config, &pad, &front, &back); 153 | if (remap_read_trigger(context, pad, front, back) == 0) { 154 | return TRIGGER_MENU_OK; 155 | } 156 | } 157 | 158 | return GUI_CONTINUE; 159 | } 160 | 161 | int ui_trigger_menu(trigger_t *trigger) { 162 | sceRtcGetCurrentTick(&wait_until_tick); 163 | wait_until_tick.tick += 300 * 1000; 164 | 165 | char *alert_text = "Press the button which\nwill be replaced."; 166 | return display_alert( 167 | alert_text, 168 | make_geom_centered(400, 200), 169 | NULL, 170 | 0, 171 | &ui_trigger_menu_loop, 172 | (void *) trigger 173 | ); 174 | } 175 | 176 | // app menu 177 | int ui_app_menu_loop(int cursor_id, void *context) { 178 | if (was_button_pressed(SCE_CTRL_CROSS)) { 179 | switch (cursor_id) { 180 | case APP_MENU_TEST_REMAP: 181 | ui_test_remap(config); 182 | break; 183 | case APP_MENU_DEADZONES: 184 | ui_deadzone_menu(); 185 | break; 186 | } 187 | } 188 | 189 | if (was_button_pressed(SCE_CTRL_TRIANGLE)) { 190 | trigger_t trigger; 191 | 192 | action_t *list = malloc(sizeof(action_t) * REMAP_MAX_ACTIONS); 193 | action_list_t actions = { 194 | .size = 0, 195 | .list = list, 196 | }; 197 | 198 | if (ui_trigger_menu(&trigger) != TRIGGER_MENU_OK) { 199 | return MENU_RELOAD; 200 | } 201 | 202 | if (ui_action_menu(&actions) != TRIGGER_MENU_OK) { 203 | return MENU_RELOAD; 204 | } 205 | 206 | config_append_remap(&config); 207 | config.triggers[config.size - 1] = trigger; 208 | config.actions[config.size - 1] = actions; 209 | 210 | flash_message("Action added!"); 211 | sceKernelDelayThread(2500 * 1000); 212 | 213 | return MENU_RELOAD; 214 | } 215 | 216 | if (was_button_pressed(SCE_CTRL_SQUARE) && cursor_id < config.size) { 217 | config_remove_remap(&config, cursor_id); 218 | 219 | sceKernelDelayThread(500 * 1000); 220 | return MENU_RELOAD; 221 | } 222 | 223 | return GUI_CONTINUE; 224 | } 225 | 226 | int ui_app_menu_back(void *context) { 227 | if (config.size > 0) { 228 | application_t *app = (application_t *) context; 229 | char path[256], binary_path[CONFIG_APP_PATH_SIZE]; 230 | config_path(*app, &path); 231 | config_binary_path(*app, &binary_path); 232 | 233 | config_save(path, config); 234 | config_binary_install(binary_path); 235 | config_binary_save(binary_path, path); 236 | 237 | int taihen_append_result = config_taihen_append(*app); 238 | char *alert_text; 239 | if (taihen_append_result == 1) { 240 | alert_text = "Plugin was not enabled previously, so:\n\ 241 | 1. start moleculeShell\n\ 242 | 2. open ux0:tai/config.txt\n\ 243 | 3. uncomment two last lines (remove #)\n\ 244 | 4. save the file\n\ 245 | 5. press Start and select\n \"Reload taiHEN config.txt\"\n\ 246 | \n\ 247 | After this you may start the game!"; 248 | } else if (taihen_append_result == 2) { 249 | alert_text = "Configuration was updated, but not enabled:\n\ 250 | 1. start moleculeShell\n\ 251 | 2. open ux0:tai/config.txt\n\ 252 | 3. uncomment two last lines (remove #)\n\ 253 | 4. save the file\n\ 254 | 5. press Start and select\n \"Reload taiHEN config.txt\"\n\ 255 | \n\ 256 | After this you may start the game!"; 257 | } 258 | 259 | if (taihen_append_result > 0) { 260 | display_alert( 261 | alert_text, 262 | make_geom_centered(500, HEIGHT - 230), 263 | NULL, 264 | 1, 265 | NULL, 266 | NULL 267 | ); 268 | } 269 | } 270 | 271 | return GUI_EXIT; 272 | } 273 | 274 | int ui_app_menu(application_t app) { 275 | int ret = 0; 276 | iteration++; 277 | char path[256]; 278 | config_path(app, &path); 279 | taiReloadConfig(); 280 | 281 | if (config_load(path, &config) == -1) { 282 | config_default(&config); 283 | } 284 | 285 | do { 286 | struct menu_entry menu[16 + config.size]; 287 | int idx = 0; 288 | 289 | menu[idx++] = (struct menu_entry) { .name = path, .subname = "", .disabled = true, .separator = true, .color = 0xffaa00aa }; 290 | menu[idx++] = (struct menu_entry) { .name = "Test remap", .id = APP_MENU_TEST_REMAP }; 291 | 292 | menu[idx++] = (struct menu_entry) { .name = "Configure deadzones", .id = APP_MENU_DEADZONES }; 293 | char actions_str[256]; 294 | sprintf(actions_str, "Actions: %d", config.size); 295 | menu[idx++] = (struct menu_entry) { .name = actions_str, .disabled = true, .separator = true }; 296 | 297 | char name[config.size][1024]; 298 | for (int i = 0; i < config.size; i++) { 299 | remap_config_action_name(config, i, &name[i]); 300 | menu[idx++] = (struct menu_entry) { .name = name[i], .id = i }; 301 | } 302 | 303 | struct menu_geom geom = make_geom_centered(500, HEIGHT - 200); 304 | ret = display_menu(menu, idx, &geom, &ui_app_menu_loop, &ui_app_menu_back, NULL, EXT_GUIDE(ICON_SQUARE("delete"), ICON_TRIANGLE("add")), &app); 305 | } while (ret != GUI_EXIT); 306 | } 307 | -------------------------------------------------------------------------------- /sqlite3/INSTALL: -------------------------------------------------------------------------------- 1 | Installation Instructions 2 | ************************* 3 | 4 | Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free 5 | Software Foundation, Inc. 6 | 7 | This file is free documentation; the Free Software Foundation gives 8 | unlimited permission to copy, distribute and modify it. 9 | 10 | Basic Installation 11 | ================== 12 | 13 | These are generic installation instructions. 14 | 15 | The `configure' shell script attempts to guess correct values for 16 | various system-dependent variables used during compilation. It uses 17 | those values to create a `Makefile' in each directory of the package. 18 | It may also create one or more `.h' files containing system-dependent 19 | definitions. Finally, it creates a shell script `config.status' that 20 | you can run in the future to recreate the current configuration, and a 21 | file `config.log' containing compiler output (useful mainly for 22 | debugging `configure'). 23 | 24 | It can also use an optional file (typically called `config.cache' 25 | and enabled with `--cache-file=config.cache' or simply `-C') that saves 26 | the results of its tests to speed up reconfiguring. (Caching is 27 | disabled by default to prevent problems with accidental use of stale 28 | cache files.) 29 | 30 | If you need to do unusual things to compile the package, please try 31 | to figure out how `configure' could check whether to do them, and mail 32 | diffs or instructions to the address given in the `README' so they can 33 | be considered for the next release. If you are using the cache, and at 34 | some point `config.cache' contains results you don't want to keep, you 35 | may remove or edit it. 36 | 37 | The file `configure.ac' (or `configure.in') is used to create 38 | `configure' by a program called `autoconf'. You only need 39 | `configure.ac' if you want to change it or regenerate `configure' using 40 | a newer version of `autoconf'. 41 | 42 | The simplest way to compile this package is: 43 | 44 | 1. `cd' to the directory containing the package's source code and type 45 | `./configure' to configure the package for your system. If you're 46 | using `csh' on an old version of System V, you might need to type 47 | `sh ./configure' instead to prevent `csh' from trying to execute 48 | `configure' itself. 49 | 50 | Running `configure' takes awhile. While running, it prints some 51 | messages telling which features it is checking for. 52 | 53 | 2. Type `make' to compile the package. 54 | 55 | 3. Optionally, type `make check' to run any self-tests that come with 56 | the package. 57 | 58 | 4. Type `make install' to install the programs and any data files and 59 | documentation. 60 | 61 | 5. You can remove the program binaries and object files from the 62 | source code directory by typing `make clean'. To also remove the 63 | files that `configure' created (so you can compile the package for 64 | a different kind of computer), type `make distclean'. There is 65 | also a `make maintainer-clean' target, but that is intended mainly 66 | for the package's developers. If you use it, you may have to get 67 | all sorts of other programs in order to regenerate files that came 68 | with the distribution. 69 | 70 | Compilers and Options 71 | ===================== 72 | 73 | Some systems require unusual options for compilation or linking that the 74 | `configure' script does not know about. Run `./configure --help' for 75 | details on some of the pertinent environment variables. 76 | 77 | You can give `configure' initial values for configuration parameters 78 | by setting variables in the command line or in the environment. Here 79 | is an example: 80 | 81 | ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix 82 | 83 | *Note Defining Variables::, for more details. 84 | 85 | Compiling For Multiple Architectures 86 | ==================================== 87 | 88 | You can compile the package for more than one kind of computer at the 89 | same time, by placing the object files for each architecture in their 90 | own directory. To do this, you must use a version of `make' that 91 | supports the `VPATH' variable, such as GNU `make'. `cd' to the 92 | directory where you want the object files and executables to go and run 93 | the `configure' script. `configure' automatically checks for the 94 | source code in the directory that `configure' is in and in `..'. 95 | 96 | If you have to use a `make' that does not support the `VPATH' 97 | variable, you have to compile the package for one architecture at a 98 | time in the source code directory. After you have installed the 99 | package for one architecture, use `make distclean' before reconfiguring 100 | for another architecture. 101 | 102 | Installation Names 103 | ================== 104 | 105 | By default, `make install' installs the package's commands under 106 | `/usr/local/bin', include files under `/usr/local/include', etc. You 107 | can specify an installation prefix other than `/usr/local' by giving 108 | `configure' the option `--prefix=PREFIX'. 109 | 110 | You can specify separate installation prefixes for 111 | architecture-specific files and architecture-independent files. If you 112 | pass the option `--exec-prefix=PREFIX' to `configure', the package uses 113 | PREFIX as the prefix for installing programs and libraries. 114 | Documentation and other data files still use the regular prefix. 115 | 116 | In addition, if you use an unusual directory layout you can give 117 | options like `--bindir=DIR' to specify different values for particular 118 | kinds of files. Run `configure --help' for a list of the directories 119 | you can set and what kinds of files go in them. 120 | 121 | If the package supports it, you can cause programs to be installed 122 | with an extra prefix or suffix on their names by giving `configure' the 123 | option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. 124 | 125 | Optional Features 126 | ================= 127 | 128 | Some packages pay attention to `--enable-FEATURE' options to 129 | `configure', where FEATURE indicates an optional part of the package. 130 | They may also pay attention to `--with-PACKAGE' options, where PACKAGE 131 | is something like `gnu-as' or `x' (for the X Window System). The 132 | `README' should mention any `--enable-' and `--with-' options that the 133 | package recognizes. 134 | 135 | For packages that use the X Window System, `configure' can usually 136 | find the X include and library files automatically, but if it doesn't, 137 | you can use the `configure' options `--x-includes=DIR' and 138 | `--x-libraries=DIR' to specify their locations. 139 | 140 | Specifying the System Type 141 | ========================== 142 | 143 | There may be some features `configure' cannot figure out automatically, 144 | but needs to determine by the type of machine the package will run on. 145 | Usually, assuming the package is built to be run on the _same_ 146 | architectures, `configure' can figure that out, but if it prints a 147 | message saying it cannot guess the machine type, give it the 148 | `--build=TYPE' option. TYPE can either be a short name for the system 149 | type, such as `sun4', or a canonical name which has the form: 150 | 151 | CPU-COMPANY-SYSTEM 152 | 153 | where SYSTEM can have one of these forms: 154 | 155 | OS KERNEL-OS 156 | 157 | See the file `config.sub' for the possible values of each field. If 158 | `config.sub' isn't included in this package, then this package doesn't 159 | need to know the machine type. 160 | 161 | If you are _building_ compiler tools for cross-compiling, you should 162 | use the option `--target=TYPE' to select the type of system they will 163 | produce code for. 164 | 165 | If you want to _use_ a cross compiler, that generates code for a 166 | platform different from the build platform, you should specify the 167 | "host" platform (i.e., that on which the generated programs will 168 | eventually be run) with `--host=TYPE'. 169 | 170 | Sharing Defaults 171 | ================ 172 | 173 | If you want to set default values for `configure' scripts to share, you 174 | can create a site shell script called `config.site' that gives default 175 | values for variables like `CC', `cache_file', and `prefix'. 176 | `configure' looks for `PREFIX/share/config.site' if it exists, then 177 | `PREFIX/etc/config.site' if it exists. Or, you can set the 178 | `CONFIG_SITE' environment variable to the location of the site script. 179 | A warning: not all `configure' scripts look for a site script. 180 | 181 | Defining Variables 182 | ================== 183 | 184 | Variables not defined in a site shell script can be set in the 185 | environment passed to `configure'. However, some packages may run 186 | configure again during the build, and the customized values of these 187 | variables may be lost. In order to avoid this problem, you should set 188 | them in the `configure' command line, using `VAR=value'. For example: 189 | 190 | ./configure CC=/usr/local2/bin/gcc 191 | 192 | causes the specified `gcc' to be used as the C compiler (unless it is 193 | overridden in the site shell script). Here is a another example: 194 | 195 | /bin/bash ./configure CONFIG_SHELL=/bin/bash 196 | 197 | Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent 198 | configuration-related scripts to be executed by `/bin/bash'. 199 | 200 | `configure' Invocation 201 | ====================== 202 | 203 | `configure' recognizes the following options to control how it operates. 204 | 205 | `--help' 206 | `-h' 207 | Print a summary of the options to `configure', and exit. 208 | 209 | `--version' 210 | `-V' 211 | Print the version of Autoconf used to generate the `configure' 212 | script, and exit. 213 | 214 | `--cache-file=FILE' 215 | Enable the cache: use and save the results of the tests in FILE, 216 | traditionally `config.cache'. FILE defaults to `/dev/null' to 217 | disable caching. 218 | 219 | `--config-cache' 220 | `-C' 221 | Alias for `--cache-file=config.cache'. 222 | 223 | `--quiet' 224 | `--silent' 225 | `-q' 226 | Do not print messages saying which checks are being made. To 227 | suppress all normal output, redirect it to `/dev/null' (any error 228 | messages will still be shown). 229 | 230 | `--srcdir=DIR' 231 | Look for the package's source code in directory DIR. Usually 232 | `configure' can determine that directory automatically. 233 | 234 | `configure' also accepts some other, not widely useful, options. Run 235 | `configure --help' for more details. 236 | 237 | -------------------------------------------------------------------------------- /sqlite3/install-sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # install - install a program, script, or datafile 3 | 4 | scriptversion=2005-05-14.22 5 | 6 | # This originates from X11R5 (mit/util/scripts/install.sh), which was 7 | # later released in X11R6 (xc/config/util/install.sh) with the 8 | # following copyright and license. 9 | # 10 | # Copyright (C) 1994 X Consortium 11 | # 12 | # Permission is hereby granted, free of charge, to any person obtaining a copy 13 | # of this software and associated documentation files (the "Software"), to 14 | # deal in the Software without restriction, including without limitation the 15 | # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 16 | # sell copies of the Software, and to permit persons to whom the Software is 17 | # furnished to do so, subject to the following conditions: 18 | # 19 | # The above copyright notice and this permission notice shall be included in 20 | # all copies or substantial portions of the Software. 21 | # 22 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 25 | # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 26 | # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- 27 | # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name of the X Consortium shall not 30 | # be used in advertising or otherwise to promote the sale, use or other deal- 31 | # ings in this Software without prior written authorization from the X Consor- 32 | # tium. 33 | # 34 | # 35 | # FSF changes to this file are in the public domain. 36 | # 37 | # Calling this script install-sh is preferred over install.sh, to prevent 38 | # `make' implicit rules from creating a file called install from it 39 | # when there is no Makefile. 40 | # 41 | # This script is compatible with the BSD install script, but was written 42 | # from scratch. It can only install one file at a time, a restriction 43 | # shared with many OS's install programs. 44 | 45 | # set DOITPROG to echo to test this script 46 | 47 | # Don't use :- since 4.3BSD and earlier shells don't like it. 48 | doit="${DOITPROG-}" 49 | 50 | # put in absolute paths if you don't have them in your path; or use env. vars. 51 | 52 | mvprog="${MVPROG-mv}" 53 | cpprog="${CPPROG-cp}" 54 | chmodprog="${CHMODPROG-chmod}" 55 | chownprog="${CHOWNPROG-chown}" 56 | chgrpprog="${CHGRPPROG-chgrp}" 57 | stripprog="${STRIPPROG-strip}" 58 | rmprog="${RMPROG-rm}" 59 | mkdirprog="${MKDIRPROG-mkdir}" 60 | 61 | chmodcmd="$chmodprog 0755" 62 | chowncmd= 63 | chgrpcmd= 64 | stripcmd= 65 | rmcmd="$rmprog -f" 66 | mvcmd="$mvprog" 67 | src= 68 | dst= 69 | dir_arg= 70 | dstarg= 71 | no_target_directory= 72 | 73 | usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE 74 | or: $0 [OPTION]... SRCFILES... DIRECTORY 75 | or: $0 [OPTION]... -t DIRECTORY SRCFILES... 76 | or: $0 [OPTION]... -d DIRECTORIES... 77 | 78 | In the 1st form, copy SRCFILE to DSTFILE. 79 | In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. 80 | In the 4th, create DIRECTORIES. 81 | 82 | Options: 83 | -c (ignored) 84 | -d create directories instead of installing files. 85 | -g GROUP $chgrpprog installed files to GROUP. 86 | -m MODE $chmodprog installed files to MODE. 87 | -o USER $chownprog installed files to USER. 88 | -s $stripprog installed files. 89 | -t DIRECTORY install into DIRECTORY. 90 | -T report an error if DSTFILE is a directory. 91 | --help display this help and exit. 92 | --version display version info and exit. 93 | 94 | Environment variables override the default commands: 95 | CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG 96 | " 97 | 98 | while test -n "$1"; do 99 | case $1 in 100 | -c) shift 101 | continue;; 102 | 103 | -d) dir_arg=true 104 | shift 105 | continue;; 106 | 107 | -g) chgrpcmd="$chgrpprog $2" 108 | shift 109 | shift 110 | continue;; 111 | 112 | --help) echo "$usage"; exit $?;; 113 | 114 | -m) chmodcmd="$chmodprog $2" 115 | shift 116 | shift 117 | continue;; 118 | 119 | -o) chowncmd="$chownprog $2" 120 | shift 121 | shift 122 | continue;; 123 | 124 | -s) stripcmd=$stripprog 125 | shift 126 | continue;; 127 | 128 | -t) dstarg=$2 129 | shift 130 | shift 131 | continue;; 132 | 133 | -T) no_target_directory=true 134 | shift 135 | continue;; 136 | 137 | --version) echo "$0 $scriptversion"; exit $?;; 138 | 139 | *) # When -d is used, all remaining arguments are directories to create. 140 | # When -t is used, the destination is already specified. 141 | test -n "$dir_arg$dstarg" && break 142 | # Otherwise, the last argument is the destination. Remove it from $@. 143 | for arg 144 | do 145 | if test -n "$dstarg"; then 146 | # $@ is not empty: it contains at least $arg. 147 | set fnord "$@" "$dstarg" 148 | shift # fnord 149 | fi 150 | shift # arg 151 | dstarg=$arg 152 | done 153 | break;; 154 | esac 155 | done 156 | 157 | if test -z "$1"; then 158 | if test -z "$dir_arg"; then 159 | echo "$0: no input file specified." >&2 160 | exit 1 161 | fi 162 | # It's OK to call `install-sh -d' without argument. 163 | # This can happen when creating conditional directories. 164 | exit 0 165 | fi 166 | 167 | for src 168 | do 169 | # Protect names starting with `-'. 170 | case $src in 171 | -*) src=./$src ;; 172 | esac 173 | 174 | if test -n "$dir_arg"; then 175 | dst=$src 176 | src= 177 | 178 | if test -d "$dst"; then 179 | mkdircmd=: 180 | chmodcmd= 181 | else 182 | mkdircmd=$mkdirprog 183 | fi 184 | else 185 | # Waiting for this to be detected by the "$cpprog $src $dsttmp" command 186 | # might cause directories to be created, which would be especially bad 187 | # if $src (and thus $dsttmp) contains '*'. 188 | if test ! -f "$src" && test ! -d "$src"; then 189 | echo "$0: $src does not exist." >&2 190 | exit 1 191 | fi 192 | 193 | if test -z "$dstarg"; then 194 | echo "$0: no destination specified." >&2 195 | exit 1 196 | fi 197 | 198 | dst=$dstarg 199 | # Protect names starting with `-'. 200 | case $dst in 201 | -*) dst=./$dst ;; 202 | esac 203 | 204 | # If destination is a directory, append the input filename; won't work 205 | # if double slashes aren't ignored. 206 | if test -d "$dst"; then 207 | if test -n "$no_target_directory"; then 208 | echo "$0: $dstarg: Is a directory" >&2 209 | exit 1 210 | fi 211 | dst=$dst/`basename "$src"` 212 | fi 213 | fi 214 | 215 | # This sed command emulates the dirname command. 216 | dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` 217 | 218 | # Make sure that the destination directory exists. 219 | 220 | # Skip lots of stat calls in the usual case. 221 | if test ! -d "$dstdir"; then 222 | defaultIFS=' 223 | ' 224 | IFS="${IFS-$defaultIFS}" 225 | 226 | oIFS=$IFS 227 | # Some sh's can't handle IFS=/ for some reason. 228 | IFS='%' 229 | set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` 230 | shift 231 | IFS=$oIFS 232 | 233 | pathcomp= 234 | 235 | while test $# -ne 0 ; do 236 | pathcomp=$pathcomp$1 237 | shift 238 | if test ! -d "$pathcomp"; then 239 | $mkdirprog "$pathcomp" 240 | # mkdir can fail with a `File exist' error in case several 241 | # install-sh are creating the directory concurrently. This 242 | # is OK. 243 | test -d "$pathcomp" || exit 244 | fi 245 | pathcomp=$pathcomp/ 246 | done 247 | fi 248 | 249 | if test -n "$dir_arg"; then 250 | $doit $mkdircmd "$dst" \ 251 | && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ 252 | && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ 253 | && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ 254 | && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } 255 | 256 | else 257 | dstfile=`basename "$dst"` 258 | 259 | # Make a couple of temp file names in the proper directory. 260 | dsttmp=$dstdir/_inst.$$_ 261 | rmtmp=$dstdir/_rm.$$_ 262 | 263 | # Trap to clean up those temp files at exit. 264 | trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 265 | trap '(exit $?); exit' 1 2 13 15 266 | 267 | # Copy the file name to the temp name. 268 | $doit $cpprog "$src" "$dsttmp" && 269 | 270 | # and set any options; do chmod last to preserve setuid bits. 271 | # 272 | # If any of these fail, we abort the whole thing. If we want to 273 | # ignore errors from any of these, just make sure not to ignore 274 | # errors from the above "$doit $cpprog $src $dsttmp" command. 275 | # 276 | { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ 277 | && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ 278 | && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ 279 | && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && 280 | 281 | # Now rename the file to the real destination. 282 | { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ 283 | || { 284 | # The rename failed, perhaps because mv can't rename something else 285 | # to itself, or perhaps because mv is so ancient that it does not 286 | # support -f. 287 | 288 | # Now remove or move aside any old file at destination location. 289 | # We try this two ways since rm can't unlink itself on some 290 | # systems and the destination file might be busy for other 291 | # reasons. In this case, the final cleanup might fail but the new 292 | # file should still install successfully. 293 | { 294 | if test -f "$dstdir/$dstfile"; then 295 | $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ 296 | || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ 297 | || { 298 | echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 299 | (exit 1); exit 1 300 | } 301 | else 302 | : 303 | fi 304 | } && 305 | 306 | # Now rename the file to the real destination. 307 | $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" 308 | } 309 | } 310 | fi || { (exit 1); exit 1; } 311 | done 312 | 313 | # The final little trick to "correctly" pass the exit status to the exit trap. 314 | { 315 | (exit 0); exit 0 316 | } 317 | 318 | # Local variables: 319 | # eval: (add-hook 'write-file-hooks 'time-stamp) 320 | # time-stamp-start: "scriptversion=" 321 | # time-stamp-format: "%:y-%02m-%02d.%02H" 322 | # time-stamp-end: "$" 323 | # End: 324 | -------------------------------------------------------------------------------- /sqlite3/missing: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Common stub for a few missing GNU programs while installing. 3 | 4 | scriptversion=2005-06-08.21 5 | 6 | # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 7 | # Free Software Foundation, Inc. 8 | # Originally by Fran,cois Pinard , 1996. 9 | 10 | # This program is free software; you can redistribute it and/or modify 11 | # it under the terms of the GNU General Public License as published by 12 | # the Free Software Foundation; either version 2, or (at your option) 13 | # any later version. 14 | 15 | # This program is distributed in the hope that it will be useful, 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | # GNU General Public License for more details. 19 | 20 | # You should have received a copy of the GNU General Public License 21 | # along with this program; if not, write to the Free Software 22 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 23 | # 02110-1301, USA. 24 | 25 | # As a special exception to the GNU General Public License, if you 26 | # distribute this file as part of a program that contains a 27 | # configuration script generated by Autoconf, you may include it under 28 | # the same distribution terms that you use for the rest of that program. 29 | 30 | if test $# -eq 0; then 31 | echo 1>&2 "Try \`$0 --help' for more information" 32 | exit 1 33 | fi 34 | 35 | run=: 36 | 37 | # In the cases where this matters, `missing' is being run in the 38 | # srcdir already. 39 | if test -f configure.ac; then 40 | configure_ac=configure.ac 41 | else 42 | configure_ac=configure.in 43 | fi 44 | 45 | msg="missing on your system" 46 | 47 | case "$1" in 48 | --run) 49 | # Try to run requested program, and just exit if it succeeds. 50 | run= 51 | shift 52 | "$@" && exit 0 53 | # Exit code 63 means version mismatch. This often happens 54 | # when the user try to use an ancient version of a tool on 55 | # a file that requires a minimum version. In this case we 56 | # we should proceed has if the program had been absent, or 57 | # if --run hadn't been passed. 58 | if test $? = 63; then 59 | run=: 60 | msg="probably too old" 61 | fi 62 | ;; 63 | 64 | -h|--h|--he|--hel|--help) 65 | echo "\ 66 | $0 [OPTION]... PROGRAM [ARGUMENT]... 67 | 68 | Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an 69 | error status if there is no known handling for PROGRAM. 70 | 71 | Options: 72 | -h, --help display this help and exit 73 | -v, --version output version information and exit 74 | --run try to run the given command, and emulate it if it fails 75 | 76 | Supported PROGRAM values: 77 | aclocal touch file \`aclocal.m4' 78 | autoconf touch file \`configure' 79 | autoheader touch file \`config.h.in' 80 | automake touch all \`Makefile.in' files 81 | bison create \`y.tab.[ch]', if possible, from existing .[ch] 82 | flex create \`lex.yy.c', if possible, from existing .c 83 | help2man touch the output file 84 | lex create \`lex.yy.c', if possible, from existing .c 85 | makeinfo touch the output file 86 | tar try tar, gnutar, gtar, then tar without non-portable flags 87 | yacc create \`y.tab.[ch]', if possible, from existing .[ch] 88 | 89 | Send bug reports to ." 90 | exit $? 91 | ;; 92 | 93 | -v|--v|--ve|--ver|--vers|--versi|--versio|--version) 94 | echo "missing $scriptversion (GNU Automake)" 95 | exit $? 96 | ;; 97 | 98 | -*) 99 | echo 1>&2 "$0: Unknown \`$1' option" 100 | echo 1>&2 "Try \`$0 --help' for more information" 101 | exit 1 102 | ;; 103 | 104 | esac 105 | 106 | # Now exit if we have it, but it failed. Also exit now if we 107 | # don't have it and --version was passed (most likely to detect 108 | # the program). 109 | case "$1" in 110 | lex|yacc) 111 | # Not GNU programs, they don't have --version. 112 | ;; 113 | 114 | tar) 115 | if test -n "$run"; then 116 | echo 1>&2 "ERROR: \`tar' requires --run" 117 | exit 1 118 | elif test "x$2" = "x--version" || test "x$2" = "x--help"; then 119 | exit 1 120 | fi 121 | ;; 122 | 123 | *) 124 | if test -z "$run" && ($1 --version) > /dev/null 2>&1; then 125 | # We have it, but it failed. 126 | exit 1 127 | elif test "x$2" = "x--version" || test "x$2" = "x--help"; then 128 | # Could not run --version or --help. This is probably someone 129 | # running `$TOOL --version' or `$TOOL --help' to check whether 130 | # $TOOL exists and not knowing $TOOL uses missing. 131 | exit 1 132 | fi 133 | ;; 134 | esac 135 | 136 | # If it does not exist, or fails to run (possibly an outdated version), 137 | # try to emulate it. 138 | case "$1" in 139 | aclocal*) 140 | echo 1>&2 "\ 141 | WARNING: \`$1' is $msg. You should only need it if 142 | you modified \`acinclude.m4' or \`${configure_ac}'. You might want 143 | to install the \`Automake' and \`Perl' packages. Grab them from 144 | any GNU archive site." 145 | touch aclocal.m4 146 | ;; 147 | 148 | autoconf) 149 | echo 1>&2 "\ 150 | WARNING: \`$1' is $msg. You should only need it if 151 | you modified \`${configure_ac}'. You might want to install the 152 | \`Autoconf' and \`GNU m4' packages. Grab them from any GNU 153 | archive site." 154 | touch configure 155 | ;; 156 | 157 | autoheader) 158 | echo 1>&2 "\ 159 | WARNING: \`$1' is $msg. You should only need it if 160 | you modified \`acconfig.h' or \`${configure_ac}'. You might want 161 | to install the \`Autoconf' and \`GNU m4' packages. Grab them 162 | from any GNU archive site." 163 | files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` 164 | test -z "$files" && files="config.h" 165 | touch_files= 166 | for f in $files; do 167 | case "$f" in 168 | *:*) touch_files="$touch_files "`echo "$f" | 169 | sed -e 's/^[^:]*://' -e 's/:.*//'`;; 170 | *) touch_files="$touch_files $f.in";; 171 | esac 172 | done 173 | touch $touch_files 174 | ;; 175 | 176 | automake*) 177 | echo 1>&2 "\ 178 | WARNING: \`$1' is $msg. You should only need it if 179 | you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. 180 | You might want to install the \`Automake' and \`Perl' packages. 181 | Grab them from any GNU archive site." 182 | find . -type f -name Makefile.am -print | 183 | sed 's/\.am$/.in/' | 184 | while read f; do touch "$f"; done 185 | ;; 186 | 187 | autom4te) 188 | echo 1>&2 "\ 189 | WARNING: \`$1' is needed, but is $msg. 190 | You might have modified some files without having the 191 | proper tools for further handling them. 192 | You can get \`$1' as part of \`Autoconf' from any GNU 193 | archive site." 194 | 195 | file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` 196 | test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` 197 | if test -f "$file"; then 198 | touch $file 199 | else 200 | test -z "$file" || exec >$file 201 | echo "#! /bin/sh" 202 | echo "# Created by GNU Automake missing as a replacement of" 203 | echo "# $ $@" 204 | echo "exit 0" 205 | chmod +x $file 206 | exit 1 207 | fi 208 | ;; 209 | 210 | bison|yacc) 211 | echo 1>&2 "\ 212 | WARNING: \`$1' $msg. You should only need it if 213 | you modified a \`.y' file. You may need the \`Bison' package 214 | in order for those modifications to take effect. You can get 215 | \`Bison' from any GNU archive site." 216 | rm -f y.tab.c y.tab.h 217 | if [ $# -ne 1 ]; then 218 | eval LASTARG="\${$#}" 219 | case "$LASTARG" in 220 | *.y) 221 | SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` 222 | if [ -f "$SRCFILE" ]; then 223 | cp "$SRCFILE" y.tab.c 224 | fi 225 | SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` 226 | if [ -f "$SRCFILE" ]; then 227 | cp "$SRCFILE" y.tab.h 228 | fi 229 | ;; 230 | esac 231 | fi 232 | if [ ! -f y.tab.h ]; then 233 | echo >y.tab.h 234 | fi 235 | if [ ! -f y.tab.c ]; then 236 | echo 'main() { return 0; }' >y.tab.c 237 | fi 238 | ;; 239 | 240 | lex|flex) 241 | echo 1>&2 "\ 242 | WARNING: \`$1' is $msg. You should only need it if 243 | you modified a \`.l' file. You may need the \`Flex' package 244 | in order for those modifications to take effect. You can get 245 | \`Flex' from any GNU archive site." 246 | rm -f lex.yy.c 247 | if [ $# -ne 1 ]; then 248 | eval LASTARG="\${$#}" 249 | case "$LASTARG" in 250 | *.l) 251 | SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` 252 | if [ -f "$SRCFILE" ]; then 253 | cp "$SRCFILE" lex.yy.c 254 | fi 255 | ;; 256 | esac 257 | fi 258 | if [ ! -f lex.yy.c ]; then 259 | echo 'main() { return 0; }' >lex.yy.c 260 | fi 261 | ;; 262 | 263 | help2man) 264 | echo 1>&2 "\ 265 | WARNING: \`$1' is $msg. You should only need it if 266 | you modified a dependency of a manual page. You may need the 267 | \`Help2man' package in order for those modifications to take 268 | effect. You can get \`Help2man' from any GNU archive site." 269 | 270 | file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` 271 | if test -z "$file"; then 272 | file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` 273 | fi 274 | if [ -f "$file" ]; then 275 | touch $file 276 | else 277 | test -z "$file" || exec >$file 278 | echo ".ab help2man is required to generate this page" 279 | exit 1 280 | fi 281 | ;; 282 | 283 | makeinfo) 284 | echo 1>&2 "\ 285 | WARNING: \`$1' is $msg. You should only need it if 286 | you modified a \`.texi' or \`.texinfo' file, or any other file 287 | indirectly affecting the aspect of the manual. The spurious 288 | call might also be the consequence of using a buggy \`make' (AIX, 289 | DU, IRIX). You might want to install the \`Texinfo' package or 290 | the \`GNU make' package. Grab either from any GNU archive site." 291 | # The file to touch is that specified with -o ... 292 | file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` 293 | if test -z "$file"; then 294 | # ... or it is the one specified with @setfilename ... 295 | infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` 296 | file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile` 297 | # ... or it is derived from the source name (dir/f.texi becomes f.info) 298 | test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info 299 | fi 300 | # If the file does not exist, the user really needs makeinfo; 301 | # let's fail without touching anything. 302 | test -f $file || exit 1 303 | touch $file 304 | ;; 305 | 306 | tar) 307 | shift 308 | 309 | # We have already tried tar in the generic part. 310 | # Look for gnutar/gtar before invocation to avoid ugly error 311 | # messages. 312 | if (gnutar --version > /dev/null 2>&1); then 313 | gnutar "$@" && exit 0 314 | fi 315 | if (gtar --version > /dev/null 2>&1); then 316 | gtar "$@" && exit 0 317 | fi 318 | firstarg="$1" 319 | if shift; then 320 | case "$firstarg" in 321 | *o*) 322 | firstarg=`echo "$firstarg" | sed s/o//` 323 | tar "$firstarg" "$@" && exit 0 324 | ;; 325 | esac 326 | case "$firstarg" in 327 | *h*) 328 | firstarg=`echo "$firstarg" | sed s/h//` 329 | tar "$firstarg" "$@" && exit 0 330 | ;; 331 | esac 332 | fi 333 | 334 | echo 1>&2 "\ 335 | WARNING: I can't seem to be able to run \`tar' with the given arguments. 336 | You may want to install GNU tar or Free paxutils, or check the 337 | command line arguments." 338 | exit 1 339 | ;; 340 | 341 | *) 342 | echo 1>&2 "\ 343 | WARNING: \`$1' is needed, and is $msg. 344 | You might have modified some files without having the 345 | proper tools for further handling them. Check the \`README' file, 346 | it often tells you about the needed prerequisites for installing 347 | this package. You may also peek at any GNU archive site, in case 348 | some other package would contain this missing \`$1' program." 349 | exit 1 350 | ;; 351 | esac 352 | 353 | exit 0 354 | 355 | # Local variables: 356 | # eval: (add-hook 'write-file-hooks 'time-stamp) 357 | # time-stamp-start: "scriptversion=" 358 | # time-stamp-format: "%:y-%02m-%02d.%02H" 359 | # time-stamp-end: "$" 360 | # End: 361 | -------------------------------------------------------------------------------- /src/guilib/lib.c: -------------------------------------------------------------------------------- 1 | #include "lib.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include 12 | #include 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | #define BUTTON_DELAY 150 * 1000 20 | 21 | #define COLOR_PANEL_BG 0x10ffffff 22 | #define COLOR_PANEL_BORDER 0xff600060 23 | #define COLOR_ITEM_SELECTED 0xffff00ff 24 | 25 | 26 | static gui_draw_callback gui_global_draw_callback; 27 | static gui_loop_callback gui_global_loop_callback; 28 | 29 | struct menu_geom make_geom_centered(int w, int h) { 30 | struct menu_geom geom = {0}; 31 | geom.x = WIDTH / 2 - w / 2; 32 | geom.y = HEIGHT / 2 - h / 2; 33 | geom.width = w; 34 | geom.height = h; 35 | geom.total_y = geom.y + geom.height; 36 | geom.el = 24; 37 | geom.statusbar = true; 38 | return geom; 39 | } 40 | 41 | void draw_border(struct menu_geom geom, unsigned int border_color) { 42 | vita2d_draw_line(geom.x, geom.y, geom.x+geom.width, geom.y, border_color); 43 | vita2d_draw_line(geom.x, geom.y, geom.x, geom.y+geom.height, border_color); 44 | vita2d_draw_line(geom.x+geom.width, geom.y, geom.x+geom.width, geom.y+geom.height, border_color); 45 | vita2d_draw_line(geom.x, geom.y+geom.height, geom.x+geom.width, geom.y+geom.height, border_color); 46 | } 47 | 48 | void draw_text_hcentered(int x, int y, unsigned int color, char *text) { 49 | int width = vita2d_pgf_text_width(gui_font, 1.f, text); 50 | vita2d_pgf_draw_text(gui_font, x - width / 2, y, color, 1.f, text); 51 | } 52 | 53 | static int battery_percent; 54 | static bool battery_charging; 55 | static SceRtcTick battery_tick; 56 | 57 | void draw_statusbar(struct menu_geom geom) { 58 | SceRtcTick current_tick; 59 | sceRtcGetCurrentTick(¤t_tick); 60 | if (current_tick.tick - battery_tick.tick > 10 * 1000 * 1000) { 61 | battery_percent = scePowerGetBatteryLifePercent(); 62 | battery_charging = scePowerIsBatteryCharging(); 63 | 64 | battery_tick = current_tick; 65 | } 66 | 67 | SceDateTime time; 68 | sceRtcGetCurrentClockLocalTime(&time); 69 | 70 | char dt_text[256]; 71 | sprintf(dt_text, "%02d:%02d", time.hour, time.minute); 72 | int dt_width = vita2d_pgf_text_width(gui_font, 1.f, dt_text); 73 | int battery_width = 30, 74 | battery_height = 16, 75 | battery_padding = 2, 76 | battery_plus_height = 4, 77 | battery_y_offset = 4, 78 | battery_charge_width = (float) battery_percent / 100 * battery_width; 79 | unsigned int battery_color = battery_charging ? 0xff99ffff : (battery_percent < 20 ? 0xff0000ff : 0xff00ff00); 80 | 81 | vita2d_pgf_draw_text(gui_font, geom.x + geom.width - dt_width - battery_width - 5, geom.y - 5, 0xffffffff, 1.f, dt_text); 82 | 83 | vita2d_draw_rectangle( 84 | geom.x + geom.width - battery_width, 85 | geom.y - battery_height - battery_y_offset, 86 | battery_width, 87 | battery_height, 88 | 0xffffffff); 89 | 90 | vita2d_draw_rectangle( 91 | geom.x + geom.width - battery_width - battery_padding, 92 | geom.y - battery_y_offset - ((float) battery_height / 2 + (float) battery_plus_height / 2), 93 | battery_padding, 94 | battery_plus_height, 95 | 0xffffffff 96 | ); 97 | 98 | vita2d_draw_rectangle( 99 | geom.x + geom.width - battery_width + battery_padding, 100 | geom.y - battery_height + battery_padding - battery_y_offset, 101 | battery_width - battery_padding * 2, 102 | battery_height - battery_padding * 2, 103 | 0xff000000); 104 | 105 | vita2d_draw_rectangle( 106 | geom.x + geom.width - battery_charge_width + battery_padding, 107 | geom.y - battery_height + battery_padding - battery_y_offset, 108 | battery_charge_width - battery_padding * 2, 109 | battery_height - battery_padding * 2, 110 | battery_color); 111 | } 112 | 113 | SceTouchData touch_data; 114 | SceCtrlData ctrl_new_pad; 115 | 116 | static SceRtcTick button_current_tick, button_until_tick; 117 | bool was_button_pressed(short id) { 118 | sceRtcGetCurrentTick(&button_current_tick); 119 | 120 | if (ctrl_new_pad.buttons & id) { 121 | if (sceRtcCompareTick(&button_current_tick, &button_until_tick) > 0) { 122 | sceRtcTickAddMicroseconds(&button_until_tick, &button_current_tick, BUTTON_DELAY); 123 | return true; 124 | } 125 | } 126 | 127 | return false; 128 | } 129 | 130 | bool is_button_down(short id) { 131 | return ctrl_new_pad.buttons & id; 132 | } 133 | 134 | bool is_rectangle_touched(int lx, int ly, int rx, int ry) { 135 | for (int i = 0; i < touch_data.reportNum; i++) { 136 | int x = lerp(touch_data.report[i].x, 1919, WIDTH); 137 | int y = lerp(touch_data.report[i].y, 1087, HEIGHT); 138 | if (x < lx || x > rx || y < ly || y > ry) continue; 139 | return true; 140 | } 141 | 142 | return false; 143 | } 144 | 145 | void draw_menu(struct menu_entry menu[], int total_elements, struct menu_geom geom, char *guides[4], int cursor, int offset) { 146 | vita2d_draw_rectangle(geom.x, geom.y, geom.width, geom.height, COLOR_PANEL_BG); 147 | 148 | long border_color = COLOR_PANEL_BORDER; 149 | draw_border(geom, border_color); 150 | 151 | if (geom.statusbar) { 152 | draw_statusbar(geom); 153 | } 154 | 155 | for (int i = 0, cursor_idx = 0; i < total_elements; i++) { 156 | long color = 0xffffffff; 157 | if (cursor == cursor_idx) { 158 | color = COLOR_ITEM_SELECTED; 159 | } 160 | 161 | if (!menu[i].disabled) { 162 | cursor_idx++; 163 | } else { 164 | color = 0xffaaaaaa; 165 | } 166 | 167 | if (menu[i].color) { 168 | color = menu[i].color; 169 | } 170 | 171 | int el_x = geom.x + 10, 172 | el_y = geom.y + i * geom.el - offset + 10; 173 | 174 | if (el_y < geom.y || el_y > geom.total_y - geom.el) 175 | continue; 176 | 177 | int text_width, text_height; 178 | vita2d_pgf_text_dimensions(gui_font, 1.f, menu[i].name, &text_width, &text_height); 179 | 180 | if (menu[i].separator) { 181 | int border = strlen(menu[i].name) ? 7 : 0; 182 | int height = strlen(menu[i].name) ? text_height : geom.el / 2; 183 | vita2d_draw_line( 184 | el_x + text_width + border, 185 | el_y + height, 186 | el_x + geom.width - 10 * 2, 187 | el_y + height, 188 | 0xffaaaaaa 189 | ); 190 | } 191 | 192 | vita2d_pgf_draw_text( 193 | gui_font, 194 | el_x + 2, 195 | el_y + text_height, 196 | color, 197 | 1.0f, 198 | menu[i].name 199 | ); 200 | 201 | int right_x_offset = 20; 202 | if (menu[i].suffix) { 203 | int text_width = vita2d_pgf_text_width(gui_font, 1.f, menu[i].suffix); 204 | vita2d_pgf_draw_text( 205 | gui_font, 206 | el_x + geom.width - text_width - right_x_offset, 207 | el_y + text_height, 208 | color, 209 | 1.f, 210 | menu[i].suffix 211 | ); 212 | 213 | right_x_offset += text_width + 10; 214 | } 215 | 216 | if (menu[i].subname) { 217 | int text_width = vita2d_pgf_text_width(gui_font, 1.f, menu[i].subname); 218 | vita2d_pgf_draw_text( 219 | gui_font, 220 | el_x + geom.width - text_width - right_x_offset, 221 | el_y + text_height, 222 | color, 223 | 1.f, 224 | menu[i].subname 225 | ); 226 | } 227 | } 228 | 229 | // it struck me that you don't actually need an array and can just go with single string 230 | // too bad the code has already been written, so.. 231 | int guide_spacing = 5; 232 | int guide_x = geom.x + geom.width; 233 | 234 | for (int i = 3; i >= 0; i--) { 235 | if (guides[i]) { 236 | guide_x -= vita2d_pgf_text_width(gui_font, 1.f, guides[i]) + guide_spacing; 237 | 238 | vita2d_pgf_draw_text( 239 | gui_font, 240 | guide_x, 241 | geom.y + geom.height + 20, 242 | 0xffffffff, 243 | 1.f, 244 | guides[i] 245 | ); 246 | } 247 | } 248 | } 249 | 250 | void draw_alert(char *message, struct menu_geom geom, char *buttons_captions[], int buttons_count) { 251 | vita2d_draw_rectangle(geom.x, geom.y, geom.width, geom.height, COLOR_PANEL_BG); 252 | 253 | long border_color = COLOR_PANEL_BORDER; 254 | draw_border(geom, border_color); 255 | 256 | char *buf = malloc(sizeof(char) * (strlen(message) + 1)); 257 | int top_padding = 30; 258 | int x_border = 10, y = top_padding; 259 | for (int i = 0, idx = 0; i < strlen(message); i++) { 260 | buf[idx] = message[i]; 261 | buf[idx+1] = 0; 262 | 263 | if (message[i] == '\n' || vita2d_pgf_text_width(gui_font, 1.f, buf) > geom.width - x_border*2) { 264 | draw_text_hcentered(geom.x + geom.width / 2, y + geom.y, 0xffffffff, buf); 265 | y += vita2d_pgf_text_height(gui_font, 1.f, buf); 266 | idx = 0; 267 | } else { 268 | idx++; 269 | } 270 | } 271 | 272 | if (strlen(buf)) { 273 | if (y == top_padding) { 274 | int text_height = vita2d_pgf_text_height(gui_font, 1.f, buf); 275 | y = geom.height / 2 - text_height / 2; 276 | } 277 | 278 | draw_text_hcentered(geom.x + geom.width / 2, y + geom.y, 0xffffffff, buf); 279 | } 280 | 281 | free(buf); 282 | 283 | char caption[256]; 284 | strcpy(caption, ""); 285 | 286 | char *icons[4] = {"x", "◯", "△", "□"}; 287 | char *default_captions[4] = {"Ok", "Cancel", "Options", "Delete"}; 288 | for (int i = 0; i < buttons_count; i++) { 289 | char single_button_caption[64]; 290 | char button_caption[256]; 291 | if (buttons_captions && buttons_captions[i]) { 292 | strcpy(button_caption, buttons_captions[i]); 293 | } else { 294 | strcpy(button_caption, default_captions[i]); 295 | } 296 | 297 | sprintf(single_button_caption, "%s %s ", icons[i], button_caption); 298 | strcat(caption, single_button_caption); 299 | } 300 | 301 | int caption_width = vita2d_pgf_text_width(gui_font, 1.f, caption); 302 | vita2d_pgf_draw_text(gui_font, geom.x + geom.width - caption_width, geom.total_y - 10, 0xffffffff, 1.f, caption); 303 | } 304 | 305 | void gui_ctrl_begin() { 306 | sceCtrlPeekBufferPositive(0, &ctrl_new_pad, 1); 307 | sceTouchPeek(SCE_TOUCH_PORT_FRONT, &touch_data, 1); 308 | } 309 | 310 | void gui_ctrl_end() { 311 | } 312 | 313 | void gui_ctrl_cursor(int *cursor_ptr, int total_elements) { 314 | int cursor = *cursor_ptr; 315 | if (was_button_pressed(SCE_CTRL_DOWN)) { 316 | cursor += 1; 317 | } 318 | 319 | if (was_button_pressed(SCE_CTRL_UP)) { 320 | cursor -= 1; 321 | } 322 | 323 | cursor = cursor < 0 ? total_elements-1 : cursor; 324 | cursor = cursor > total_elements - 1 ? 0 : cursor; 325 | 326 | *cursor_ptr = cursor; 327 | } 328 | 329 | void gui_ctrl_offset(int *offset_ptr, struct menu_geom geom, int cursor) { 330 | int offset = *offset_ptr; 331 | 332 | int cursor_y = geom.y + (cursor * geom.el) - offset; 333 | 334 | int speed = 8; 335 | offset -= cursor_y < geom.y ? speed : 0; 336 | offset -= cursor_y > geom.total_y - geom.el * 2 ? -speed : 0; 337 | 338 | *offset_ptr = offset; 339 | } 340 | 341 | int display_menu( 342 | struct menu_entry menu[], 343 | int total_elements, 344 | struct menu_geom *geom_ptr, 345 | gui_loop_callback cb, 346 | gui_back_callback back_cb, 347 | gui_draw_callback draw_callback, 348 | char *guide_strings[], 349 | void *context 350 | ) { 351 | vita2d_end_drawing(); 352 | vita2d_swap_buffers(); 353 | gui_ctrl_end(); 354 | 355 | int offset = 0; 356 | int cursor = 0; 357 | int active_elements = 0; 358 | for (int i = 0; i < total_elements; i++) { 359 | active_elements += menu[i].disabled ? 0 : 1; 360 | } 361 | 362 | struct menu_geom geom; 363 | if (!geom_ptr) { 364 | geom = make_geom_centered(600, 400); 365 | geom.el = 24; 366 | } else { 367 | geom = *geom_ptr; 368 | } 369 | 370 | int tick_number = 0; 371 | int exit_code = 0; 372 | while (true) { 373 | vita2d_start_drawing(); 374 | vita2d_clear_screen(); 375 | tick_number++; 376 | if (draw_callback && tick_number > 3) { 377 | draw_callback(); 378 | } 379 | 380 | if (gui_global_draw_callback && tick_number > 3) { 381 | gui_global_draw_callback(); 382 | } 383 | 384 | draw_menu(menu, total_elements, geom, guide_strings, cursor, offset); 385 | 386 | int real_cursor = 0; 387 | for (int c = 0; real_cursor < total_elements; real_cursor++) { 388 | if (!menu[real_cursor].disabled) { 389 | if (cursor == c) { 390 | break; 391 | } 392 | 393 | c++; 394 | } 395 | } 396 | 397 | gui_ctrl_begin(); 398 | gui_ctrl_cursor(&cursor, active_elements); 399 | gui_ctrl_offset(&offset, geom, cursor == 0 ? 0 : real_cursor); 400 | 401 | if (cb) { 402 | exit_code = cb(menu[real_cursor].id, context); 403 | } 404 | 405 | if (gui_global_loop_callback) { 406 | gui_global_loop_callback(menu[real_cursor].id, context); 407 | } 408 | 409 | if (was_button_pressed(SCE_CTRL_CIRCLE)) { 410 | if (!back_cb || back_cb(context) == GUI_EXIT) { 411 | exit_code = GUI_EXIT; 412 | } 413 | } 414 | 415 | gui_ctrl_end(); 416 | 417 | vita2d_end_drawing(); 418 | vita2d_swap_buffers(); 419 | sceDisplayWaitVblankStart(); 420 | 421 | if (exit_code) { 422 | return exit_code; 423 | } 424 | } 425 | 426 | return 0; 427 | } 428 | 429 | 430 | int display_alert(char *message, struct menu_geom alert_geom, char *button_captions[], int buttons_count, gui_loop_callback cb, void *context) { 431 | gui_ctrl_end(); 432 | 433 | while (true) { 434 | vita2d_start_drawing(); 435 | vita2d_clear_screen(); 436 | draw_alert(message, alert_geom, button_captions, buttons_count); 437 | 438 | gui_ctrl_begin(); 439 | 440 | int result = -1; 441 | if (was_button_pressed(SCE_CTRL_CROSS)) { 442 | result = 0; 443 | } else if (was_button_pressed(SCE_CTRL_CIRCLE)) { 444 | result = 1; 445 | } else if (was_button_pressed(SCE_CTRL_TRIANGLE)) { 446 | result = 2; 447 | } else if (was_button_pressed(SCE_CTRL_SQUARE)) { 448 | result = 3; 449 | } 450 | 451 | if (cb) { 452 | int code; 453 | if ((code = cb(result, context)) != GUI_CONTINUE) { 454 | gui_ctrl_end(); 455 | return code; 456 | } 457 | } 458 | 459 | if (result == 0 && buttons_count > 0) { 460 | gui_ctrl_end(); 461 | return GUI_EXIT; 462 | } 463 | 464 | gui_ctrl_end(); 465 | vita2d_end_drawing(); 466 | vita2d_swap_buffers(); 467 | } 468 | } 469 | 470 | void display_error(char *format, ...) { 471 | char buf[0x1000]; 472 | 473 | va_list opt; 474 | va_start(opt, format); 475 | vsnprintf(buf, sizeof(buf), format, opt); 476 | struct menu_geom alert_geom = make_geom_centered(400, 200); 477 | display_alert(buf, alert_geom, NULL, 1, NULL, NULL); 478 | va_end(opt); 479 | } 480 | 481 | void flash_message(char *format, ...) { 482 | char buf[0x1000]; 483 | 484 | va_list opt; 485 | va_start(opt, format); 486 | vsnprintf(buf, sizeof(buf), format, opt); 487 | va_end(opt); 488 | 489 | vita2d_end_drawing(); 490 | vita2d_swap_buffers(); 491 | 492 | struct menu_geom alert_geom = make_geom_centered(400, 200); 493 | vita2d_start_drawing(); 494 | vita2d_clear_screen(); 495 | vita2d_draw_rectangle(0, 0, WIDTH, HEIGHT, 0xff000000); 496 | draw_alert(buf, alert_geom, NULL, 0); 497 | vita2d_end_drawing(); 498 | vita2d_swap_buffers(); 499 | } 500 | 501 | void guilib_init(gui_loop_callback global_loop_cb, gui_draw_callback global_draw_cb) { 502 | vita2d_init(); 503 | vita2d_set_clear_color(0xff000000); 504 | gui_font = vita2d_load_default_pgf(); 505 | 506 | gui_global_draw_callback = global_draw_cb; 507 | gui_global_loop_callback = global_loop_cb; 508 | } 509 | -------------------------------------------------------------------------------- /src/remap/remap.c: -------------------------------------------------------------------------------- 1 | #include "remap.h" 2 | 3 | #include "../guilib/lib.h" 4 | 5 | int TRIGGERS[] = { 6 | CTRL_SELECT, 7 | CTRL_L3, 8 | CTRL_R3, 9 | CTRL_START, 10 | CTRL_UP, 11 | CTRL_RIGHT, 12 | CTRL_DOWN, 13 | CTRL_LEFT, 14 | CTRL_LTRIGGER, 15 | CTRL_RTRIGGER, 16 | CTRL_L1, 17 | CTRL_R1, 18 | CTRL_TRIANGLE, 19 | CTRL_CIRCLE, 20 | CTRL_CROSS, 21 | CTRL_SQUARE, 22 | 23 | RS_UP, 24 | RS_DOWN, 25 | RS_LEFT, 26 | RS_RIGHT, 27 | 28 | LS_UP, 29 | LS_DOWN, 30 | LS_LEFT, 31 | LS_RIGHT, 32 | 33 | RS_ANY, 34 | LS_ANY, 35 | 36 | TOUCHSCREEN_NW, 37 | TOUCHSCREEN_NE, 38 | TOUCHSCREEN_SW, 39 | TOUCHSCREEN_SE, 40 | }; 41 | 42 | // trigger 43 | enum TriggerType { 44 | TRIGGER_TYPE_BUTTON, 45 | TRIGGER_TYPE_TOUCH, 46 | TRIGGER_TYPE_STICK 47 | }; 48 | 49 | int trigger_type(trigger_t trigger) { 50 | if (trigger <= CTRL_SQUARE) { 51 | return TRIGGER_TYPE_BUTTON; 52 | } else if (trigger <= TOUCHSCREEN_SE) { 53 | return TRIGGER_TYPE_TOUCH; 54 | } else if (trigger <= LS_RIGHT) { 55 | return TRIGGER_TYPE_STICK; 56 | } 57 | 58 | return -1; 59 | } 60 | 61 | // actionshortcuts 62 | action_t make_button_action(int identifier) { 63 | return (action_t) { 64 | .type = ACTION_BUTTON, 65 | .value = identifier, 66 | }; 67 | } 68 | 69 | action_t make_touch_action(int x, int y, int port) { 70 | return (action_t) { 71 | .type = port == SCE_TOUCH_PORT_FRONT ? ACTION_FRONTTOUCHSCREEN : ACTION_BACKTOUCHSCREEN, 72 | .x = x, 73 | .y = y, 74 | }; 75 | } 76 | 77 | action_t make_stick_action(int x, int y, int type) { 78 | return (action_t) { 79 | .type = type, 80 | .x = x, 81 | .y = y 82 | }; 83 | } 84 | 85 | // check 86 | #define lerp(value, from_max, to_max) ((((value*10) * (to_max*10))/(from_max*10))/10) 87 | static int check_touch(SceTouchData scr, int lx, int ly, int rx, int ry) { 88 | for (int i = 0; i < scr.reportNum; i++) { 89 | int x = lerp(scr.report[i].x, 1919, WIDTH); 90 | int y = lerp(scr.report[i].y, 1087, HEIGHT); 91 | if (x < lx || x > rx || y < ly || y > ry) continue; 92 | return i; 93 | } 94 | 95 | return -1; 96 | } 97 | 98 | int trigger_check_touch(trigger_t trigger, SceTouchData data) { 99 | switch (trigger) { 100 | case TOUCHSCREEN_NW: 101 | return check_touch(data, 0, 0, WIDTH / 2, HEIGHT / 2); 102 | case TOUCHSCREEN_NE: 103 | return check_touch(data, WIDTH / 2, 0, WIDTH, HEIGHT / 2); 104 | case TOUCHSCREEN_SW: 105 | return check_touch(data, 0, HEIGHT / 2, WIDTH / 2, HEIGHT); 106 | case TOUCHSCREEN_SE: 107 | return check_touch(data, WIDTH / 2, HEIGHT / 2, WIDTH, HEIGHT); 108 | } 109 | 110 | return -1; 111 | } 112 | 113 | #define STICK_ZERO 255 / 2 114 | #define TRIGGER_CHECK_STICK_DEADZONE 70 115 | 116 | bool trigger_check_stick(trigger_t trigger, SceCtrlData data) { 117 | int deadzone = TRIGGER_CHECK_STICK_DEADZONE; 118 | 119 | switch (trigger) { 120 | case RS_UP: 121 | return data.ry < STICK_ZERO - deadzone; 122 | case RS_DOWN: 123 | return data.ry > STICK_ZERO + deadzone; 124 | case RS_RIGHT: 125 | return data.rx > STICK_ZERO + deadzone; 126 | case RS_LEFT: 127 | return data.rx < STICK_ZERO - deadzone; 128 | 129 | case LS_UP: 130 | return data.ly < STICK_ZERO - deadzone; 131 | case LS_DOWN: 132 | return data.ly > STICK_ZERO + deadzone; 133 | case LS_RIGHT: 134 | return data.lx > STICK_ZERO + deadzone; 135 | case LS_LEFT: 136 | return data.lx < STICK_ZERO - deadzone; 137 | } 138 | 139 | return false; 140 | } 141 | 142 | // cancel 143 | void cancel_button(int identifier, SceCtrlData *mut_pad) { 144 | mut_pad->buttons ^= identifier; 145 | } 146 | 147 | void cancel_touch(int id, SceTouchData *mut_data) { 148 | mut_data->reportNum -= 1; 149 | 150 | for (; id <= mut_data->reportNum; id++) { 151 | mut_data->report[id] = mut_data->report[id+1]; 152 | } 153 | } 154 | 155 | void cancel_stick(trigger_t trigger, SceCtrlData *mut_pad) { 156 | switch (trigger) { 157 | case LS_UP: 158 | case LS_DOWN: 159 | mut_pad->ly = STICK_ZERO; 160 | break; 161 | case LS_RIGHT: 162 | case LS_LEFT: 163 | mut_pad->lx = STICK_ZERO; 164 | break; 165 | case RS_UP: 166 | case RS_DOWN: 167 | mut_pad->ry = STICK_ZERO; 168 | break; 169 | case RS_RIGHT: 170 | case RS_LEFT: 171 | mut_pad->rx = STICK_ZERO; 172 | break; 173 | case RS_ANY: 174 | mut_pad->rx = STICK_ZERO; 175 | mut_pad->ry = STICK_ZERO; 176 | break; 177 | case LS_ANY: 178 | mut_pad->lx = STICK_ZERO; 179 | mut_pad->ly = STICK_ZERO; 180 | break; 181 | } 182 | } 183 | 184 | // spawn 185 | static int id = 0; 186 | void spawn_touch(int x, int y, SceTouchData *mut_data) { 187 | if (mut_data->reportNum < 4) { 188 | struct SceTouchReport touch = { 189 | .x = x, 190 | .y = y, 191 | .force = 0, 192 | .id = id++, 193 | }; 194 | 195 | mut_data->report[mut_data->reportNum] = touch; 196 | mut_data->reportNum += 1; 197 | } 198 | } 199 | 200 | int remap_test_trigger(trigger_t trigger, SceCtrlData pad, SceTouchData front, SceTouchData back) { 201 | int type = trigger_type(trigger); 202 | switch (type) { 203 | case TRIGGER_TYPE_BUTTON: 204 | return pad.buttons & trigger ? 0 : -1; 205 | case TRIGGER_TYPE_TOUCH: 206 | return trigger_check_touch(trigger, back); 207 | case TRIGGER_TYPE_STICK: 208 | return trigger_check_stick(trigger, pad) ? 0 : -1; 209 | default: 210 | return -1; 211 | } 212 | } 213 | 214 | // deadzone 215 | void deadzone_ignore_touch(int horizontal, int vertical, SceTouchData *data) { 216 | int cancel_ids_count = 0; 217 | int cancel_ids[8]; 218 | 219 | for (int i = 0; i < data->reportNum; i++) { 220 | int x = lerp(data->report[i].x, 1919, WIDTH); 221 | int y = lerp(data->report[i].y, 1087, HEIGHT); 222 | 223 | if (x < horizontal || x > WIDTH - horizontal || 224 | y < vertical || y > HEIGHT - vertical) { 225 | cancel_ids[cancel_ids_count] = i; 226 | cancel_ids_count++; 227 | } 228 | } 229 | 230 | for (int i = cancel_ids_count - 1; i >= 0; i--) { 231 | cancel_touch(cancel_ids[i], data); 232 | } 233 | } 234 | 235 | void remap_deadzone_ignore(remap_config_t config, SceCtrlData *mut_pad, SceTouchData *mut_front, SceTouchData *mut_back) { 236 | if (abs(mut_pad->rx - STICK_ZERO) < config.rs_deadzone && abs(mut_pad->ry - STICK_ZERO) < config.rs_deadzone ) { 237 | cancel_stick(RS_ANY, mut_pad); 238 | } 239 | 240 | if (abs(mut_pad->lx - STICK_ZERO) < config.ls_deadzone && abs(mut_pad->ly - STICK_ZERO) < config.ls_deadzone ) { 241 | cancel_stick(LS_ANY, mut_pad); 242 | } 243 | 244 | deadzone_ignore_touch(config.front_touch_deadzone_horizontal, config.front_touch_deadzone_vertical, mut_front); 245 | deadzone_ignore_touch(config.back_touch_deadzone_horizontal, config.back_touch_deadzone_vertical, mut_back); 246 | } 247 | 248 | int remap_read_actions(action_list_t *actions, SceCtrlData pad, SceTouchData front, SceTouchData back) { 249 | int actions_i = 0; 250 | 251 | for (int i = 0; i < TRIGGERS_NOTOUCH_COUNT; i++) { 252 | if (remap_test_trigger(TRIGGERS[i], pad, front, back) >= 0) { 253 | 254 | int type = trigger_type(TRIGGERS[i]); 255 | int stick_type = TRIGGERS[i] <= RS_RIGHT ? ACTION_RS : ACTION_LS; 256 | 257 | switch (type) { 258 | case TRIGGER_TYPE_BUTTON: 259 | actions->list[actions_i++] = make_button_action(TRIGGERS[i]); 260 | break; 261 | case TRIGGER_TYPE_STICK: 262 | if (true) { 263 | int x = stick_type == ACTION_RS ? pad.rx : pad.lx; 264 | int y = stick_type == ACTION_RS ? pad.ry : pad.ly; 265 | 266 | x -= STICK_ZERO; 267 | y -= STICK_ZERO; 268 | 269 | actions->list[actions_i++] = make_stick_action( 270 | abs(x) > 15 ? x : 0, 271 | abs(y) > 15 ? y : 0, 272 | stick_type 273 | ); 274 | } 275 | 276 | break; 277 | } 278 | } 279 | } 280 | 281 | for (int i = 0; i < front.reportNum; i++) { 282 | actions->list[actions_i++] = make_touch_action(front.report[i].x, front.report[i].y, SCE_TOUCH_PORT_FRONT); 283 | } 284 | 285 | for (int i = 0; i < back.reportNum; i++) { 286 | actions->list[actions_i++] = make_touch_action(back.report[i].x, back.report[i].y, SCE_TOUCH_PORT_BACK); 287 | } 288 | 289 | actions->size = actions_i; 290 | actions->list = realloc(actions->list, sizeof(action_t) * actions_i); 291 | 292 | return actions->size > 0 ? 0 : -1; 293 | } 294 | 295 | int remap_read_trigger(trigger_t *trigger, SceCtrlData pad, SceTouchData front, SceTouchData back) { 296 | for (int i = 0; i < TRIGGERS_COUNT; i++) { 297 | if (remap_test_trigger(TRIGGERS[i], pad, front, back) >= 0) { 298 | *trigger = TRIGGERS[i]; 299 | return 0; 300 | } 301 | } 302 | 303 | return -1; 304 | } 305 | 306 | void stick_values_append(char *x, char *y, int dx, int dy) { 307 | int overflow = *x; 308 | if (overflow + dx >= 255) { 309 | *x = 255; 310 | } else if (overflow + dx <= 0) { 311 | *x = 0; 312 | } else { 313 | *x += dx; 314 | } 315 | 316 | overflow = *y; 317 | if (overflow + dy > 255) { 318 | *y = 255; 319 | } else if (overflow - dy < 0) { 320 | *y = 0; 321 | } else { 322 | *y += dy; 323 | } 324 | } 325 | 326 | // remap 327 | void remap(remap_config_t config, SceCtrlData *mut_pad, SceTouchData *mut_front, SceTouchData *mut_back) { 328 | remap_deadzone_ignore(config, mut_pad, mut_front, mut_back); 329 | 330 | SceCtrlData pad; 331 | memcpy(&pad, mut_pad, sizeof(pad)); 332 | SceTouchData front, back; 333 | memcpy(&front, mut_front, sizeof(front)); 334 | memcpy(&back, mut_back, sizeof(back)); 335 | 336 | int spawned_buttons[TRIGGERS_BUTTONS_COUNT]; 337 | int spawned_buttons_i = 0; 338 | 339 | for (int i = 0; i < config.size; i++) { 340 | trigger_t trigger = config.triggers[i]; 341 | 342 | int type = trigger_type(trigger); 343 | int trigger_test = remap_test_trigger(trigger, pad, front, back); 344 | if (trigger_test >= 0) { 345 | // prevent 346 | bool should_prevent = true; 347 | for (int n = 0; n < spawned_buttons_i; n++) { 348 | if (spawned_buttons[n] == trigger) { 349 | should_prevent = false; 350 | } 351 | } 352 | 353 | if (should_prevent) { 354 | switch (type) { 355 | case TRIGGER_TYPE_BUTTON: 356 | cancel_button((int) trigger, mut_pad); 357 | break; 358 | case TRIGGER_TYPE_TOUCH: 359 | cancel_touch(trigger_test, mut_back); 360 | break; 361 | case TRIGGER_TYPE_STICK: 362 | cancel_stick(trigger, mut_pad); 363 | break; 364 | } 365 | } 366 | 367 | action_list_t array = config.actions[i]; 368 | for (int n = 0; n < array.size; n++) { 369 | action_t action = array.list[n]; 370 | int overflow = 0; 371 | 372 | switch (action.type) { 373 | case ACTION_BUTTON: 374 | mut_pad->buttons |= action.value; 375 | spawned_buttons[spawned_buttons_i++] = action.value; 376 | break; 377 | case ACTION_FRONTTOUCHSCREEN: 378 | case ACTION_BACKTOUCHSCREEN: 379 | spawn_touch(action.x, action.y, action.type == ACTION_FRONTTOUCHSCREEN ? mut_front : mut_back); 380 | break; 381 | case ACTION_RS: 382 | stick_values_append(&mut_pad->rx, &mut_pad->ry, action.x, action.y); 383 | break; 384 | case ACTION_LS: 385 | stick_values_append(&mut_pad->lx, &mut_pad->ly, action.x, action.y); 386 | break; 387 | } 388 | 389 | } 390 | } 391 | } 392 | } 393 | 394 | void remap_trigger_name(int id, char buf[TRIGGER_NAME_SIZE]) { 395 | char *trigger_name = NULL; 396 | switch (id) { 397 | case CTRL_SELECT: trigger_name = "Select"; break; 398 | case CTRL_START: trigger_name = "Start"; break; 399 | case CTRL_UP: trigger_name = "▲"; break; 400 | case CTRL_RIGHT: trigger_name = "▶"; break; 401 | case CTRL_DOWN: trigger_name = "▼"; break; 402 | case CTRL_LEFT: trigger_name = "◀"; break; 403 | case CTRL_LTRIGGER: trigger_name = "L◤"; break; 404 | case CTRL_RTRIGGER: trigger_name = "◥R"; break; 405 | case CTRL_TRIANGLE: trigger_name = "△"; break; 406 | case CTRL_CIRCLE: trigger_name = "◯"; break; 407 | case CTRL_CROSS: trigger_name = "╳"; break; 408 | case CTRL_SQUARE: trigger_name = "□"; break; 409 | 410 | case TOUCHSCREEN_NW: trigger_name = "⊂⊃ NW"; break; 411 | case TOUCHSCREEN_NE: trigger_name = "⊂⊃ NE"; break; 412 | case TOUCHSCREEN_SW: trigger_name = "⊂⊃ SW"; break; 413 | case TOUCHSCREEN_SE: trigger_name = "⊂⊃ SE"; break; 414 | case RS_UP: trigger_name = "RS▲"; break; 415 | case RS_DOWN: trigger_name = "RS▼"; break; 416 | case RS_LEFT: trigger_name = "RS◀"; break; 417 | case RS_RIGHT: trigger_name = "RS▶"; break; 418 | 419 | case LS_UP: trigger_name = "LS▲"; break; 420 | case LS_DOWN: trigger_name = "LS▼"; break; 421 | case LS_LEFT: trigger_name = "LS◀"; break; 422 | case LS_RIGHT: trigger_name = "LS▶"; break; 423 | } 424 | 425 | strcpy(buf, trigger_name); 426 | } 427 | 428 | void remap_config_action_name(remap_config_t config, int n, char buf[ACTION_NAME_SIZE]) { 429 | char trigger_name[256]; 430 | remap_trigger_name(config.triggers[n], trigger_name); 431 | 432 | sprintf(buf, "%s -> ", trigger_name); 433 | for (int i = 0; i < config.actions[n].size; i++) { 434 | if (strlen(buf) > 768) { 435 | sprintf(buf, "%s (%d others)", buf, config.actions[n].size - i); 436 | break; 437 | } 438 | 439 | action_t action = config.actions[n].list[i]; 440 | char name[256]; 441 | bool name_set = false; 442 | switch (action.type) { 443 | case ACTION_BUTTON: 444 | name_set = true; 445 | remap_trigger_name(action.value, name); 446 | break; 447 | case ACTION_FRONTTOUCHSCREEN: 448 | name_set = true; 449 | strcpy(name, "[ ]"); 450 | break; 451 | case ACTION_BACKTOUCHSCREEN: 452 | name_set = true; 453 | strcpy(name, "⊂⊃"); 454 | break; 455 | case ACTION_RS: 456 | name_set = true; 457 | strcpy(name, "RS"); 458 | break; 459 | case ACTION_LS: 460 | name_set = true; 461 | strcpy(name, "LS"); 462 | break; 463 | } 464 | 465 | if (name_set) { 466 | sprintf(buf, "%s %s", buf, name); 467 | } 468 | } 469 | } 470 | -------------------------------------------------------------------------------- /sqlite3/depcomp: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # depcomp - compile a program generating dependencies as side-effects 3 | 4 | scriptversion=2005-07-09.11 5 | 6 | # Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. 7 | 8 | # This program is free software; you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation; either version 2, or (at your option) 11 | # any later version. 12 | 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 21 | # 02110-1301, USA. 22 | 23 | # As a special exception to the GNU General Public License, if you 24 | # distribute this file as part of a program that contains a 25 | # configuration script generated by Autoconf, you may include it under 26 | # the same distribution terms that you use for the rest of that program. 27 | 28 | # Originally written by Alexandre Oliva . 29 | 30 | case $1 in 31 | '') 32 | echo "$0: No command. Try \`$0 --help' for more information." 1>&2 33 | exit 1; 34 | ;; 35 | -h | --h*) 36 | cat <<\EOF 37 | Usage: depcomp [--help] [--version] PROGRAM [ARGS] 38 | 39 | Run PROGRAMS ARGS to compile a file, generating dependencies 40 | as side-effects. 41 | 42 | Environment variables: 43 | depmode Dependency tracking mode. 44 | source Source file read by `PROGRAMS ARGS'. 45 | object Object file output by `PROGRAMS ARGS'. 46 | DEPDIR directory where to store dependencies. 47 | depfile Dependency file to output. 48 | tmpdepfile Temporary file to use when outputing dependencies. 49 | libtool Whether libtool is used (yes/no). 50 | 51 | Report bugs to . 52 | EOF 53 | exit $? 54 | ;; 55 | -v | --v*) 56 | echo "depcomp $scriptversion" 57 | exit $? 58 | ;; 59 | esac 60 | 61 | if test -z "$depmode" || test -z "$source" || test -z "$object"; then 62 | echo "depcomp: Variables source, object and depmode must be set" 1>&2 63 | exit 1 64 | fi 65 | 66 | # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. 67 | depfile=${depfile-`echo "$object" | 68 | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} 69 | tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} 70 | 71 | rm -f "$tmpdepfile" 72 | 73 | # Some modes work just like other modes, but use different flags. We 74 | # parameterize here, but still list the modes in the big case below, 75 | # to make depend.m4 easier to write. Note that we *cannot* use a case 76 | # here, because this file can only contain one case statement. 77 | if test "$depmode" = hp; then 78 | # HP compiler uses -M and no extra arg. 79 | gccflag=-M 80 | depmode=gcc 81 | fi 82 | 83 | if test "$depmode" = dashXmstdout; then 84 | # This is just like dashmstdout with a different argument. 85 | dashmflag=-xM 86 | depmode=dashmstdout 87 | fi 88 | 89 | case "$depmode" in 90 | gcc3) 91 | ## gcc 3 implements dependency tracking that does exactly what 92 | ## we want. Yay! Note: for some reason libtool 1.4 doesn't like 93 | ## it if -MD -MP comes after the -MF stuff. Hmm. 94 | "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" 95 | stat=$? 96 | if test $stat -eq 0; then : 97 | else 98 | rm -f "$tmpdepfile" 99 | exit $stat 100 | fi 101 | mv "$tmpdepfile" "$depfile" 102 | ;; 103 | 104 | gcc) 105 | ## There are various ways to get dependency output from gcc. Here's 106 | ## why we pick this rather obscure method: 107 | ## - Don't want to use -MD because we'd like the dependencies to end 108 | ## up in a subdir. Having to rename by hand is ugly. 109 | ## (We might end up doing this anyway to support other compilers.) 110 | ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like 111 | ## -MM, not -M (despite what the docs say). 112 | ## - Using -M directly means running the compiler twice (even worse 113 | ## than renaming). 114 | if test -z "$gccflag"; then 115 | gccflag=-MD, 116 | fi 117 | "$@" -Wp,"$gccflag$tmpdepfile" 118 | stat=$? 119 | if test $stat -eq 0; then : 120 | else 121 | rm -f "$tmpdepfile" 122 | exit $stat 123 | fi 124 | rm -f "$depfile" 125 | echo "$object : \\" > "$depfile" 126 | alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz 127 | ## The second -e expression handles DOS-style file names with drive letters. 128 | sed -e 's/^[^:]*: / /' \ 129 | -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" 130 | ## This next piece of magic avoids the `deleted header file' problem. 131 | ## The problem is that when a header file which appears in a .P file 132 | ## is deleted, the dependency causes make to die (because there is 133 | ## typically no way to rebuild the header). We avoid this by adding 134 | ## dummy dependencies for each header file. Too bad gcc doesn't do 135 | ## this for us directly. 136 | tr ' ' ' 137 | ' < "$tmpdepfile" | 138 | ## Some versions of gcc put a space before the `:'. On the theory 139 | ## that the space means something, we add a space to the output as 140 | ## well. 141 | ## Some versions of the HPUX 10.20 sed can't process this invocation 142 | ## correctly. Breaking it into two sed invocations is a workaround. 143 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 144 | rm -f "$tmpdepfile" 145 | ;; 146 | 147 | hp) 148 | # This case exists only to let depend.m4 do its work. It works by 149 | # looking at the text of this script. This case will never be run, 150 | # since it is checked for above. 151 | exit 1 152 | ;; 153 | 154 | sgi) 155 | if test "$libtool" = yes; then 156 | "$@" "-Wp,-MDupdate,$tmpdepfile" 157 | else 158 | "$@" -MDupdate "$tmpdepfile" 159 | fi 160 | stat=$? 161 | if test $stat -eq 0; then : 162 | else 163 | rm -f "$tmpdepfile" 164 | exit $stat 165 | fi 166 | rm -f "$depfile" 167 | 168 | if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files 169 | echo "$object : \\" > "$depfile" 170 | 171 | # Clip off the initial element (the dependent). Don't try to be 172 | # clever and replace this with sed code, as IRIX sed won't handle 173 | # lines with more than a fixed number of characters (4096 in 174 | # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; 175 | # the IRIX cc adds comments like `#:fec' to the end of the 176 | # dependency line. 177 | tr ' ' ' 178 | ' < "$tmpdepfile" \ 179 | | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ 180 | tr ' 181 | ' ' ' >> $depfile 182 | echo >> $depfile 183 | 184 | # The second pass generates a dummy entry for each header file. 185 | tr ' ' ' 186 | ' < "$tmpdepfile" \ 187 | | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ 188 | >> $depfile 189 | else 190 | # The sourcefile does not contain any dependencies, so just 191 | # store a dummy comment line, to avoid errors with the Makefile 192 | # "include basename.Plo" scheme. 193 | echo "#dummy" > "$depfile" 194 | fi 195 | rm -f "$tmpdepfile" 196 | ;; 197 | 198 | aix) 199 | # The C for AIX Compiler uses -M and outputs the dependencies 200 | # in a .u file. In older versions, this file always lives in the 201 | # current directory. Also, the AIX compiler puts `$object:' at the 202 | # start of each line; $object doesn't have directory information. 203 | # Version 6 uses the directory in both cases. 204 | stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` 205 | tmpdepfile="$stripped.u" 206 | if test "$libtool" = yes; then 207 | "$@" -Wc,-M 208 | else 209 | "$@" -M 210 | fi 211 | stat=$? 212 | 213 | if test -f "$tmpdepfile"; then : 214 | else 215 | stripped=`echo "$stripped" | sed 's,^.*/,,'` 216 | tmpdepfile="$stripped.u" 217 | fi 218 | 219 | if test $stat -eq 0; then : 220 | else 221 | rm -f "$tmpdepfile" 222 | exit $stat 223 | fi 224 | 225 | if test -f "$tmpdepfile"; then 226 | outname="$stripped.o" 227 | # Each line is of the form `foo.o: dependent.h'. 228 | # Do two passes, one to just change these to 229 | # `$object: dependent.h' and one to simply `dependent.h:'. 230 | sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" 231 | sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" 232 | else 233 | # The sourcefile does not contain any dependencies, so just 234 | # store a dummy comment line, to avoid errors with the Makefile 235 | # "include basename.Plo" scheme. 236 | echo "#dummy" > "$depfile" 237 | fi 238 | rm -f "$tmpdepfile" 239 | ;; 240 | 241 | icc) 242 | # Intel's C compiler understands `-MD -MF file'. However on 243 | # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c 244 | # ICC 7.0 will fill foo.d with something like 245 | # foo.o: sub/foo.c 246 | # foo.o: sub/foo.h 247 | # which is wrong. We want: 248 | # sub/foo.o: sub/foo.c 249 | # sub/foo.o: sub/foo.h 250 | # sub/foo.c: 251 | # sub/foo.h: 252 | # ICC 7.1 will output 253 | # foo.o: sub/foo.c sub/foo.h 254 | # and will wrap long lines using \ : 255 | # foo.o: sub/foo.c ... \ 256 | # sub/foo.h ... \ 257 | # ... 258 | 259 | "$@" -MD -MF "$tmpdepfile" 260 | stat=$? 261 | if test $stat -eq 0; then : 262 | else 263 | rm -f "$tmpdepfile" 264 | exit $stat 265 | fi 266 | rm -f "$depfile" 267 | # Each line is of the form `foo.o: dependent.h', 268 | # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. 269 | # Do two passes, one to just change these to 270 | # `$object: dependent.h' and one to simply `dependent.h:'. 271 | sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" 272 | # Some versions of the HPUX 10.20 sed can't process this invocation 273 | # correctly. Breaking it into two sed invocations is a workaround. 274 | sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | 275 | sed -e 's/$/ :/' >> "$depfile" 276 | rm -f "$tmpdepfile" 277 | ;; 278 | 279 | tru64) 280 | # The Tru64 compiler uses -MD to generate dependencies as a side 281 | # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. 282 | # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put 283 | # dependencies in `foo.d' instead, so we check for that too. 284 | # Subdirectories are respected. 285 | dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` 286 | test "x$dir" = "x$object" && dir= 287 | base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` 288 | 289 | if test "$libtool" = yes; then 290 | # With Tru64 cc, shared objects can also be used to make a 291 | # static library. This mecanism is used in libtool 1.4 series to 292 | # handle both shared and static libraries in a single compilation. 293 | # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. 294 | # 295 | # With libtool 1.5 this exception was removed, and libtool now 296 | # generates 2 separate objects for the 2 libraries. These two 297 | # compilations output dependencies in in $dir.libs/$base.o.d and 298 | # in $dir$base.o.d. We have to check for both files, because 299 | # one of the two compilations can be disabled. We should prefer 300 | # $dir$base.o.d over $dir.libs/$base.o.d because the latter is 301 | # automatically cleaned when .libs/ is deleted, while ignoring 302 | # the former would cause a distcleancheck panic. 303 | tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 304 | tmpdepfile2=$dir$base.o.d # libtool 1.5 305 | tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 306 | tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 307 | "$@" -Wc,-MD 308 | else 309 | tmpdepfile1=$dir$base.o.d 310 | tmpdepfile2=$dir$base.d 311 | tmpdepfile3=$dir$base.d 312 | tmpdepfile4=$dir$base.d 313 | "$@" -MD 314 | fi 315 | 316 | stat=$? 317 | if test $stat -eq 0; then : 318 | else 319 | rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" 320 | exit $stat 321 | fi 322 | 323 | for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" 324 | do 325 | test -f "$tmpdepfile" && break 326 | done 327 | if test -f "$tmpdepfile"; then 328 | sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" 329 | # That's a tab and a space in the []. 330 | sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" 331 | else 332 | echo "#dummy" > "$depfile" 333 | fi 334 | rm -f "$tmpdepfile" 335 | ;; 336 | 337 | #nosideeffect) 338 | # This comment above is used by automake to tell side-effect 339 | # dependency tracking mechanisms from slower ones. 340 | 341 | dashmstdout) 342 | # Important note: in order to support this mode, a compiler *must* 343 | # always write the preprocessed file to stdout, regardless of -o. 344 | "$@" || exit $? 345 | 346 | # Remove the call to Libtool. 347 | if test "$libtool" = yes; then 348 | while test $1 != '--mode=compile'; do 349 | shift 350 | done 351 | shift 352 | fi 353 | 354 | # Remove `-o $object'. 355 | IFS=" " 356 | for arg 357 | do 358 | case $arg in 359 | -o) 360 | shift 361 | ;; 362 | $object) 363 | shift 364 | ;; 365 | *) 366 | set fnord "$@" "$arg" 367 | shift # fnord 368 | shift # $arg 369 | ;; 370 | esac 371 | done 372 | 373 | test -z "$dashmflag" && dashmflag=-M 374 | # Require at least two characters before searching for `:' 375 | # in the target name. This is to cope with DOS-style filenames: 376 | # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. 377 | "$@" $dashmflag | 378 | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" 379 | rm -f "$depfile" 380 | cat < "$tmpdepfile" > "$depfile" 381 | tr ' ' ' 382 | ' < "$tmpdepfile" | \ 383 | ## Some versions of the HPUX 10.20 sed can't process this invocation 384 | ## correctly. Breaking it into two sed invocations is a workaround. 385 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 386 | rm -f "$tmpdepfile" 387 | ;; 388 | 389 | dashXmstdout) 390 | # This case only exists to satisfy depend.m4. It is never actually 391 | # run, as this mode is specially recognized in the preamble. 392 | exit 1 393 | ;; 394 | 395 | makedepend) 396 | "$@" || exit $? 397 | # Remove any Libtool call 398 | if test "$libtool" = yes; then 399 | while test $1 != '--mode=compile'; do 400 | shift 401 | done 402 | shift 403 | fi 404 | # X makedepend 405 | shift 406 | cleared=no 407 | for arg in "$@"; do 408 | case $cleared in 409 | no) 410 | set ""; shift 411 | cleared=yes ;; 412 | esac 413 | case "$arg" in 414 | -D*|-I*) 415 | set fnord "$@" "$arg"; shift ;; 416 | # Strip any option that makedepend may not understand. Remove 417 | # the object too, otherwise makedepend will parse it as a source file. 418 | -*|$object) 419 | ;; 420 | *) 421 | set fnord "$@" "$arg"; shift ;; 422 | esac 423 | done 424 | obj_suffix="`echo $object | sed 's/^.*\././'`" 425 | touch "$tmpdepfile" 426 | ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" 427 | rm -f "$depfile" 428 | cat < "$tmpdepfile" > "$depfile" 429 | sed '1,2d' "$tmpdepfile" | tr ' ' ' 430 | ' | \ 431 | ## Some versions of the HPUX 10.20 sed can't process this invocation 432 | ## correctly. Breaking it into two sed invocations is a workaround. 433 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 434 | rm -f "$tmpdepfile" "$tmpdepfile".bak 435 | ;; 436 | 437 | cpp) 438 | # Important note: in order to support this mode, a compiler *must* 439 | # always write the preprocessed file to stdout. 440 | "$@" || exit $? 441 | 442 | # Remove the call to Libtool. 443 | if test "$libtool" = yes; then 444 | while test $1 != '--mode=compile'; do 445 | shift 446 | done 447 | shift 448 | fi 449 | 450 | # Remove `-o $object'. 451 | IFS=" " 452 | for arg 453 | do 454 | case $arg in 455 | -o) 456 | shift 457 | ;; 458 | $object) 459 | shift 460 | ;; 461 | *) 462 | set fnord "$@" "$arg" 463 | shift # fnord 464 | shift # $arg 465 | ;; 466 | esac 467 | done 468 | 469 | "$@" -E | 470 | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ 471 | -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | 472 | sed '$ s: \\$::' > "$tmpdepfile" 473 | rm -f "$depfile" 474 | echo "$object : \\" > "$depfile" 475 | cat < "$tmpdepfile" >> "$depfile" 476 | sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" 477 | rm -f "$tmpdepfile" 478 | ;; 479 | 480 | msvisualcpp) 481 | # Important note: in order to support this mode, a compiler *must* 482 | # always write the preprocessed file to stdout, regardless of -o, 483 | # because we must use -o when running libtool. 484 | "$@" || exit $? 485 | IFS=" " 486 | for arg 487 | do 488 | case "$arg" in 489 | "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") 490 | set fnord "$@" 491 | shift 492 | shift 493 | ;; 494 | *) 495 | set fnord "$@" "$arg" 496 | shift 497 | shift 498 | ;; 499 | esac 500 | done 501 | "$@" -E | 502 | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" 503 | rm -f "$depfile" 504 | echo "$object : \\" > "$depfile" 505 | . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" 506 | echo " " >> "$depfile" 507 | . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" 508 | rm -f "$tmpdepfile" 509 | ;; 510 | 511 | none) 512 | exec "$@" 513 | ;; 514 | 515 | *) 516 | echo "Unknown depmode $depmode" 1>&2 517 | exit 1 518 | ;; 519 | esac 520 | 521 | exit 0 522 | 523 | # Local Variables: 524 | # mode: shell-script 525 | # sh-indentation: 2 526 | # eval: (add-hook 'write-file-hooks 'time-stamp) 527 | # time-stamp-start: "scriptversion=" 528 | # time-stamp-format: "%:y-%02m-%02d.%02H" 529 | # time-stamp-end: "$" 530 | # End: 531 | -------------------------------------------------------------------------------- /sqlite3/sqlite3ext.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** 2006 June 7 3 | ** 4 | ** The author disclaims copyright to this source code. In place of 5 | ** a legal notice, here is a blessing: 6 | ** 7 | ** May you do good and not evil. 8 | ** May you find forgiveness for yourself and forgive others. 9 | ** May you share freely, never taking more than you give. 10 | ** 11 | ************************************************************************* 12 | ** This header file defines the SQLite interface for use by 13 | ** shared libraries that want to be imported as extensions into 14 | ** an SQLite instance. Shared libraries that intend to be loaded 15 | ** as extensions by SQLite should #include this file instead of 16 | ** sqlite3.h. 17 | */ 18 | #ifndef _SQLITE3EXT_H_ 19 | #define _SQLITE3EXT_H_ 20 | #include "sqlite3.h" 21 | 22 | typedef struct sqlite3_api_routines sqlite3_api_routines; 23 | 24 | /* 25 | ** The following structure holds pointers to all of the SQLite API 26 | ** routines. 27 | ** 28 | ** WARNING: In order to maintain backwards compatibility, add new 29 | ** interfaces to the end of this structure only. If you insert new 30 | ** interfaces in the middle of this structure, then older different 31 | ** versions of SQLite will not be able to load each others' shared 32 | ** libraries! 33 | */ 34 | struct sqlite3_api_routines { 35 | void * (*aggregate_context)(sqlite3_context*,int nBytes); 36 | int (*aggregate_count)(sqlite3_context*); 37 | int (*bind_blob)(sqlite3_stmt*,int,const void*,int n,void(*)(void*)); 38 | int (*bind_double)(sqlite3_stmt*,int,double); 39 | int (*bind_int)(sqlite3_stmt*,int,int); 40 | int (*bind_int64)(sqlite3_stmt*,int,sqlite_int64); 41 | int (*bind_null)(sqlite3_stmt*,int); 42 | int (*bind_parameter_count)(sqlite3_stmt*); 43 | int (*bind_parameter_index)(sqlite3_stmt*,const char*zName); 44 | const char * (*bind_parameter_name)(sqlite3_stmt*,int); 45 | int (*bind_text)(sqlite3_stmt*,int,const char*,int n,void(*)(void*)); 46 | int (*bind_text16)(sqlite3_stmt*,int,const void*,int,void(*)(void*)); 47 | int (*bind_value)(sqlite3_stmt*,int,const sqlite3_value*); 48 | int (*busy_handler)(sqlite3*,int(*)(void*,int),void*); 49 | int (*busy_timeout)(sqlite3*,int ms); 50 | int (*changes)(sqlite3*); 51 | int (*close)(sqlite3*); 52 | int (*collation_needed)(sqlite3*,void*,void(*)(void*,sqlite3*,int eTextRep,const char*)); 53 | int (*collation_needed16)(sqlite3*,void*,void(*)(void*,sqlite3*,int eTextRep,const void*)); 54 | const void * (*column_blob)(sqlite3_stmt*,int iCol); 55 | int (*column_bytes)(sqlite3_stmt*,int iCol); 56 | int (*column_bytes16)(sqlite3_stmt*,int iCol); 57 | int (*column_count)(sqlite3_stmt*pStmt); 58 | const char * (*column_database_name)(sqlite3_stmt*,int); 59 | const void * (*column_database_name16)(sqlite3_stmt*,int); 60 | const char * (*column_decltype)(sqlite3_stmt*,int i); 61 | const void * (*column_decltype16)(sqlite3_stmt*,int); 62 | double (*column_double)(sqlite3_stmt*,int iCol); 63 | int (*column_int)(sqlite3_stmt*,int iCol); 64 | sqlite_int64 (*column_int64)(sqlite3_stmt*,int iCol); 65 | const char * (*column_name)(sqlite3_stmt*,int); 66 | const void * (*column_name16)(sqlite3_stmt*,int); 67 | const char * (*column_origin_name)(sqlite3_stmt*,int); 68 | const void * (*column_origin_name16)(sqlite3_stmt*,int); 69 | const char * (*column_table_name)(sqlite3_stmt*,int); 70 | const void * (*column_table_name16)(sqlite3_stmt*,int); 71 | const unsigned char * (*column_text)(sqlite3_stmt*,int iCol); 72 | const void * (*column_text16)(sqlite3_stmt*,int iCol); 73 | int (*column_type)(sqlite3_stmt*,int iCol); 74 | sqlite3_value* (*column_value)(sqlite3_stmt*,int iCol); 75 | void * (*commit_hook)(sqlite3*,int(*)(void*),void*); 76 | int (*complete)(const char*sql); 77 | int (*complete16)(const void*sql); 78 | int (*create_collation)(sqlite3*,const char*,int,void*,int(*)(void*,int,const void*,int,const void*)); 79 | int (*create_collation16)(sqlite3*,const void*,int,void*,int(*)(void*,int,const void*,int,const void*)); 80 | int (*create_function)(sqlite3*,const char*,int,int,void*,void (*xFunc)(sqlite3_context*,int,sqlite3_value**),void (*xStep)(sqlite3_context*,int,sqlite3_value**),void (*xFinal)(sqlite3_context*)); 81 | int (*create_function16)(sqlite3*,const void*,int,int,void*,void (*xFunc)(sqlite3_context*,int,sqlite3_value**),void (*xStep)(sqlite3_context*,int,sqlite3_value**),void (*xFinal)(sqlite3_context*)); 82 | int (*create_module)(sqlite3*,const char*,const sqlite3_module*,void*); 83 | int (*data_count)(sqlite3_stmt*pStmt); 84 | sqlite3 * (*db_handle)(sqlite3_stmt*); 85 | int (*declare_vtab)(sqlite3*,const char*); 86 | int (*enable_shared_cache)(int); 87 | int (*errcode)(sqlite3*db); 88 | const char * (*errmsg)(sqlite3*); 89 | const void * (*errmsg16)(sqlite3*); 90 | int (*exec)(sqlite3*,const char*,sqlite3_callback,void*,char**); 91 | int (*expired)(sqlite3_stmt*); 92 | int (*finalize)(sqlite3_stmt*pStmt); 93 | void (*free)(void*); 94 | void (*free_table)(char**result); 95 | int (*get_autocommit)(sqlite3*); 96 | void * (*get_auxdata)(sqlite3_context*,int); 97 | int (*get_table)(sqlite3*,const char*,char***,int*,int*,char**); 98 | int (*global_recover)(void); 99 | void (*interruptx)(sqlite3*); 100 | sqlite_int64 (*last_insert_rowid)(sqlite3*); 101 | const char * (*libversion)(void); 102 | int (*libversion_number)(void); 103 | void *(*malloc)(int); 104 | char * (*mprintf)(const char*,...); 105 | int (*open)(const char*,sqlite3**); 106 | int (*open16)(const void*,sqlite3**); 107 | int (*prepare)(sqlite3*,const char*,int,sqlite3_stmt**,const char**); 108 | int (*prepare16)(sqlite3*,const void*,int,sqlite3_stmt**,const void**); 109 | void * (*profile)(sqlite3*,void(*)(void*,const char*,sqlite_uint64),void*); 110 | void (*progress_handler)(sqlite3*,int,int(*)(void*),void*); 111 | void *(*realloc)(void*,int); 112 | int (*reset)(sqlite3_stmt*pStmt); 113 | void (*result_blob)(sqlite3_context*,const void*,int,void(*)(void*)); 114 | void (*result_double)(sqlite3_context*,double); 115 | void (*result_error)(sqlite3_context*,const char*,int); 116 | void (*result_error16)(sqlite3_context*,const void*,int); 117 | void (*result_int)(sqlite3_context*,int); 118 | void (*result_int64)(sqlite3_context*,sqlite_int64); 119 | void (*result_null)(sqlite3_context*); 120 | void (*result_text)(sqlite3_context*,const char*,int,void(*)(void*)); 121 | void (*result_text16)(sqlite3_context*,const void*,int,void(*)(void*)); 122 | void (*result_text16be)(sqlite3_context*,const void*,int,void(*)(void*)); 123 | void (*result_text16le)(sqlite3_context*,const void*,int,void(*)(void*)); 124 | void (*result_value)(sqlite3_context*,sqlite3_value*); 125 | void * (*rollback_hook)(sqlite3*,void(*)(void*),void*); 126 | int (*set_authorizer)(sqlite3*,int(*)(void*,int,const char*,const char*,const char*,const char*),void*); 127 | void (*set_auxdata)(sqlite3_context*,int,void*,void (*)(void*)); 128 | char * (*snprintf)(int,char*,const char*,...); 129 | int (*step)(sqlite3_stmt*); 130 | int (*table_column_metadata)(sqlite3*,const char*,const char*,const char*,char const**,char const**,int*,int*,int*); 131 | void (*thread_cleanup)(void); 132 | int (*total_changes)(sqlite3*); 133 | void * (*trace)(sqlite3*,void(*xTrace)(void*,const char*),void*); 134 | int (*transfer_bindings)(sqlite3_stmt*,sqlite3_stmt*); 135 | void * (*update_hook)(sqlite3*,void(*)(void*,int ,char const*,char const*,sqlite_int64),void*); 136 | void * (*user_data)(sqlite3_context*); 137 | const void * (*value_blob)(sqlite3_value*); 138 | int (*value_bytes)(sqlite3_value*); 139 | int (*value_bytes16)(sqlite3_value*); 140 | double (*value_double)(sqlite3_value*); 141 | int (*value_int)(sqlite3_value*); 142 | sqlite_int64 (*value_int64)(sqlite3_value*); 143 | int (*value_numeric_type)(sqlite3_value*); 144 | const unsigned char * (*value_text)(sqlite3_value*); 145 | const void * (*value_text16)(sqlite3_value*); 146 | const void * (*value_text16be)(sqlite3_value*); 147 | const void * (*value_text16le)(sqlite3_value*); 148 | int (*value_type)(sqlite3_value*); 149 | char *(*vmprintf)(const char*,va_list); 150 | /* Added ??? */ 151 | int (*overload_function)(sqlite3*, const char *zFuncName, int nArg); 152 | /* Added by 3.3.13 */ 153 | int (*prepare_v2)(sqlite3*,const char*,int,sqlite3_stmt**,const char**); 154 | int (*prepare16_v2)(sqlite3*,const void*,int,sqlite3_stmt**,const void**); 155 | int (*clear_bindings)(sqlite3_stmt*); 156 | /* Added by 3.4.1 */ 157 | int (*create_module_v2)(sqlite3*,const char*,const sqlite3_module*,void*,void (*xDestroy)(void *)); 158 | /* Added by 3.5.0 */ 159 | int (*bind_zeroblob)(sqlite3_stmt*,int,int); 160 | int (*blob_bytes)(sqlite3_blob*); 161 | int (*blob_close)(sqlite3_blob*); 162 | int (*blob_open)(sqlite3*,const char*,const char*,const char*,sqlite3_int64,int,sqlite3_blob**); 163 | int (*blob_read)(sqlite3_blob*,void*,int,int); 164 | int (*blob_write)(sqlite3_blob*,const void*,int,int); 165 | int (*create_collation_v2)(sqlite3*,const char*,int,void*,int(*)(void*,int,const void*,int,const void*),void(*)(void*)); 166 | int (*file_control)(sqlite3*,const char*,int,void*); 167 | sqlite3_int64 (*memory_highwater)(int); 168 | sqlite3_int64 (*memory_used)(void); 169 | sqlite3_mutex *(*mutex_alloc)(int); 170 | void (*mutex_enter)(sqlite3_mutex*); 171 | void (*mutex_free)(sqlite3_mutex*); 172 | void (*mutex_leave)(sqlite3_mutex*); 173 | int (*mutex_try)(sqlite3_mutex*); 174 | int (*open_v2)(const char*,sqlite3**,int,const char*); 175 | int (*release_memory)(int); 176 | void (*result_error_nomem)(sqlite3_context*); 177 | void (*result_error_toobig)(sqlite3_context*); 178 | int (*sleep)(int); 179 | void (*soft_heap_limit)(int); 180 | sqlite3_vfs *(*vfs_find)(const char*); 181 | int (*vfs_register)(sqlite3_vfs*,int); 182 | int (*vfs_unregister)(sqlite3_vfs*); 183 | int (*xthreadsafe)(void); 184 | void (*result_zeroblob)(sqlite3_context*,int); 185 | void (*result_error_code)(sqlite3_context*,int); 186 | int (*test_control)(int, ...); 187 | void (*randomness)(int,void*); 188 | sqlite3 *(*context_db_handle)(sqlite3_context*); 189 | int (*extended_result_codes)(sqlite3*,int); 190 | int (*limit)(sqlite3*,int,int); 191 | sqlite3_stmt *(*next_stmt)(sqlite3*,sqlite3_stmt*); 192 | const char *(*sql)(sqlite3_stmt*); 193 | int (*status)(int,int*,int*,int); 194 | }; 195 | 196 | /* 197 | ** The following macros redefine the API routines so that they are 198 | ** redirected throught the global sqlite3_api structure. 199 | ** 200 | ** This header file is also used by the loadext.c source file 201 | ** (part of the main SQLite library - not an extension) so that 202 | ** it can get access to the sqlite3_api_routines structure 203 | ** definition. But the main library does not want to redefine 204 | ** the API. So the redefinition macros are only valid if the 205 | ** SQLITE_CORE macros is undefined. 206 | */ 207 | #ifndef SQLITE_CORE 208 | #define sqlite3_aggregate_context sqlite3_api->aggregate_context 209 | #ifndef SQLITE_OMIT_DEPRECATED 210 | #define sqlite3_aggregate_count sqlite3_api->aggregate_count 211 | #endif 212 | #define sqlite3_bind_blob sqlite3_api->bind_blob 213 | #define sqlite3_bind_double sqlite3_api->bind_double 214 | #define sqlite3_bind_int sqlite3_api->bind_int 215 | #define sqlite3_bind_int64 sqlite3_api->bind_int64 216 | #define sqlite3_bind_null sqlite3_api->bind_null 217 | #define sqlite3_bind_parameter_count sqlite3_api->bind_parameter_count 218 | #define sqlite3_bind_parameter_index sqlite3_api->bind_parameter_index 219 | #define sqlite3_bind_parameter_name sqlite3_api->bind_parameter_name 220 | #define sqlite3_bind_text sqlite3_api->bind_text 221 | #define sqlite3_bind_text16 sqlite3_api->bind_text16 222 | #define sqlite3_bind_value sqlite3_api->bind_value 223 | #define sqlite3_busy_handler sqlite3_api->busy_handler 224 | #define sqlite3_busy_timeout sqlite3_api->busy_timeout 225 | #define sqlite3_changes sqlite3_api->changes 226 | #define sqlite3_close sqlite3_api->close 227 | #define sqlite3_collation_needed sqlite3_api->collation_needed 228 | #define sqlite3_collation_needed16 sqlite3_api->collation_needed16 229 | #define sqlite3_column_blob sqlite3_api->column_blob 230 | #define sqlite3_column_bytes sqlite3_api->column_bytes 231 | #define sqlite3_column_bytes16 sqlite3_api->column_bytes16 232 | #define sqlite3_column_count sqlite3_api->column_count 233 | #define sqlite3_column_database_name sqlite3_api->column_database_name 234 | #define sqlite3_column_database_name16 sqlite3_api->column_database_name16 235 | #define sqlite3_column_decltype sqlite3_api->column_decltype 236 | #define sqlite3_column_decltype16 sqlite3_api->column_decltype16 237 | #define sqlite3_column_double sqlite3_api->column_double 238 | #define sqlite3_column_int sqlite3_api->column_int 239 | #define sqlite3_column_int64 sqlite3_api->column_int64 240 | #define sqlite3_column_name sqlite3_api->column_name 241 | #define sqlite3_column_name16 sqlite3_api->column_name16 242 | #define sqlite3_column_origin_name sqlite3_api->column_origin_name 243 | #define sqlite3_column_origin_name16 sqlite3_api->column_origin_name16 244 | #define sqlite3_column_table_name sqlite3_api->column_table_name 245 | #define sqlite3_column_table_name16 sqlite3_api->column_table_name16 246 | #define sqlite3_column_text sqlite3_api->column_text 247 | #define sqlite3_column_text16 sqlite3_api->column_text16 248 | #define sqlite3_column_type sqlite3_api->column_type 249 | #define sqlite3_column_value sqlite3_api->column_value 250 | #define sqlite3_commit_hook sqlite3_api->commit_hook 251 | #define sqlite3_complete sqlite3_api->complete 252 | #define sqlite3_complete16 sqlite3_api->complete16 253 | #define sqlite3_create_collation sqlite3_api->create_collation 254 | #define sqlite3_create_collation16 sqlite3_api->create_collation16 255 | #define sqlite3_create_function sqlite3_api->create_function 256 | #define sqlite3_create_function16 sqlite3_api->create_function16 257 | #define sqlite3_create_module sqlite3_api->create_module 258 | #define sqlite3_create_module_v2 sqlite3_api->create_module_v2 259 | #define sqlite3_data_count sqlite3_api->data_count 260 | #define sqlite3_db_handle sqlite3_api->db_handle 261 | #define sqlite3_declare_vtab sqlite3_api->declare_vtab 262 | #define sqlite3_enable_shared_cache sqlite3_api->enable_shared_cache 263 | #define sqlite3_errcode sqlite3_api->errcode 264 | #define sqlite3_errmsg sqlite3_api->errmsg 265 | #define sqlite3_errmsg16 sqlite3_api->errmsg16 266 | #define sqlite3_exec sqlite3_api->exec 267 | #ifndef SQLITE_OMIT_DEPRECATED 268 | #define sqlite3_expired sqlite3_api->expired 269 | #endif 270 | #define sqlite3_finalize sqlite3_api->finalize 271 | #define sqlite3_free sqlite3_api->free 272 | #define sqlite3_free_table sqlite3_api->free_table 273 | #define sqlite3_get_autocommit sqlite3_api->get_autocommit 274 | #define sqlite3_get_auxdata sqlite3_api->get_auxdata 275 | #define sqlite3_get_table sqlite3_api->get_table 276 | #ifndef SQLITE_OMIT_DEPRECATED 277 | #define sqlite3_global_recover sqlite3_api->global_recover 278 | #endif 279 | #define sqlite3_interrupt sqlite3_api->interruptx 280 | #define sqlite3_last_insert_rowid sqlite3_api->last_insert_rowid 281 | #define sqlite3_libversion sqlite3_api->libversion 282 | #define sqlite3_libversion_number sqlite3_api->libversion_number 283 | #define sqlite3_malloc sqlite3_api->malloc 284 | #define sqlite3_mprintf sqlite3_api->mprintf 285 | #define sqlite3_open sqlite3_api->open 286 | #define sqlite3_open16 sqlite3_api->open16 287 | #define sqlite3_prepare sqlite3_api->prepare 288 | #define sqlite3_prepare16 sqlite3_api->prepare16 289 | #define sqlite3_prepare_v2 sqlite3_api->prepare_v2 290 | #define sqlite3_prepare16_v2 sqlite3_api->prepare16_v2 291 | #define sqlite3_profile sqlite3_api->profile 292 | #define sqlite3_progress_handler sqlite3_api->progress_handler 293 | #define sqlite3_realloc sqlite3_api->realloc 294 | #define sqlite3_reset sqlite3_api->reset 295 | #define sqlite3_result_blob sqlite3_api->result_blob 296 | #define sqlite3_result_double sqlite3_api->result_double 297 | #define sqlite3_result_error sqlite3_api->result_error 298 | #define sqlite3_result_error16 sqlite3_api->result_error16 299 | #define sqlite3_result_int sqlite3_api->result_int 300 | #define sqlite3_result_int64 sqlite3_api->result_int64 301 | #define sqlite3_result_null sqlite3_api->result_null 302 | #define sqlite3_result_text sqlite3_api->result_text 303 | #define sqlite3_result_text16 sqlite3_api->result_text16 304 | #define sqlite3_result_text16be sqlite3_api->result_text16be 305 | #define sqlite3_result_text16le sqlite3_api->result_text16le 306 | #define sqlite3_result_value sqlite3_api->result_value 307 | #define sqlite3_rollback_hook sqlite3_api->rollback_hook 308 | #define sqlite3_set_authorizer sqlite3_api->set_authorizer 309 | #define sqlite3_set_auxdata sqlite3_api->set_auxdata 310 | #define sqlite3_snprintf sqlite3_api->snprintf 311 | #define sqlite3_step sqlite3_api->step 312 | #define sqlite3_table_column_metadata sqlite3_api->table_column_metadata 313 | #define sqlite3_thread_cleanup sqlite3_api->thread_cleanup 314 | #define sqlite3_total_changes sqlite3_api->total_changes 315 | #define sqlite3_trace sqlite3_api->trace 316 | #ifndef SQLITE_OMIT_DEPRECATED 317 | #define sqlite3_transfer_bindings sqlite3_api->transfer_bindings 318 | #endif 319 | #define sqlite3_update_hook sqlite3_api->update_hook 320 | #define sqlite3_user_data sqlite3_api->user_data 321 | #define sqlite3_value_blob sqlite3_api->value_blob 322 | #define sqlite3_value_bytes sqlite3_api->value_bytes 323 | #define sqlite3_value_bytes16 sqlite3_api->value_bytes16 324 | #define sqlite3_value_double sqlite3_api->value_double 325 | #define sqlite3_value_int sqlite3_api->value_int 326 | #define sqlite3_value_int64 sqlite3_api->value_int64 327 | #define sqlite3_value_numeric_type sqlite3_api->value_numeric_type 328 | #define sqlite3_value_text sqlite3_api->value_text 329 | #define sqlite3_value_text16 sqlite3_api->value_text16 330 | #define sqlite3_value_text16be sqlite3_api->value_text16be 331 | #define sqlite3_value_text16le sqlite3_api->value_text16le 332 | #define sqlite3_value_type sqlite3_api->value_type 333 | #define sqlite3_vmprintf sqlite3_api->vmprintf 334 | #define sqlite3_overload_function sqlite3_api->overload_function 335 | #define sqlite3_prepare_v2 sqlite3_api->prepare_v2 336 | #define sqlite3_prepare16_v2 sqlite3_api->prepare16_v2 337 | #define sqlite3_clear_bindings sqlite3_api->clear_bindings 338 | #define sqlite3_bind_zeroblob sqlite3_api->bind_zeroblob 339 | #define sqlite3_blob_bytes sqlite3_api->blob_bytes 340 | #define sqlite3_blob_close sqlite3_api->blob_close 341 | #define sqlite3_blob_open sqlite3_api->blob_open 342 | #define sqlite3_blob_read sqlite3_api->blob_read 343 | #define sqlite3_blob_write sqlite3_api->blob_write 344 | #define sqlite3_create_collation_v2 sqlite3_api->create_collation_v2 345 | #define sqlite3_file_control sqlite3_api->file_control 346 | #define sqlite3_memory_highwater sqlite3_api->memory_highwater 347 | #define sqlite3_memory_used sqlite3_api->memory_used 348 | #define sqlite3_mutex_alloc sqlite3_api->mutex_alloc 349 | #define sqlite3_mutex_enter sqlite3_api->mutex_enter 350 | #define sqlite3_mutex_free sqlite3_api->mutex_free 351 | #define sqlite3_mutex_leave sqlite3_api->mutex_leave 352 | #define sqlite3_mutex_try sqlite3_api->mutex_try 353 | #define sqlite3_open_v2 sqlite3_api->open_v2 354 | #define sqlite3_release_memory sqlite3_api->release_memory 355 | #define sqlite3_result_error_nomem sqlite3_api->result_error_nomem 356 | #define sqlite3_result_error_toobig sqlite3_api->result_error_toobig 357 | #define sqlite3_sleep sqlite3_api->sleep 358 | #define sqlite3_soft_heap_limit sqlite3_api->soft_heap_limit 359 | #define sqlite3_vfs_find sqlite3_api->vfs_find 360 | #define sqlite3_vfs_register sqlite3_api->vfs_register 361 | #define sqlite3_vfs_unregister sqlite3_api->vfs_unregister 362 | #define sqlite3_threadsafe sqlite3_api->xthreadsafe 363 | #define sqlite3_result_zeroblob sqlite3_api->result_zeroblob 364 | #define sqlite3_result_error_code sqlite3_api->result_error_code 365 | #define sqlite3_test_control sqlite3_api->test_control 366 | #define sqlite3_randomness sqlite3_api->randomness 367 | #define sqlite3_context_db_handle sqlite3_api->context_db_handle 368 | #define sqlite3_extended_result_codes sqlite3_api->extended_result_codes 369 | #define sqlite3_limit sqlite3_api->limit 370 | #define sqlite3_next_stmt sqlite3_api->next_stmt 371 | #define sqlite3_sql sqlite3_api->sql 372 | #define sqlite3_status sqlite3_api->status 373 | #endif /* SQLITE_CORE */ 374 | 375 | #define SQLITE_EXTENSION_INIT1 const sqlite3_api_routines *sqlite3_api = 0; 376 | #define SQLITE_EXTENSION_INIT2(v) sqlite3_api = v; 377 | 378 | #endif /* _SQLITE3EXT_H_ */ 379 | -------------------------------------------------------------------------------- /sqlite3/Makefile.in: -------------------------------------------------------------------------------- 1 | # Makefile.in generated by automake 1.9.6 from Makefile.am. 2 | # @configure_input@ 3 | 4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 5 | # 2003, 2004, 2005 Free Software Foundation, Inc. 6 | # This Makefile.in is free software; the Free Software Foundation 7 | # gives unlimited permission to copy and/or distribute it, 8 | # with or without modifications, as long as this notice is preserved. 9 | 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 12 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 13 | # PARTICULAR PURPOSE. 14 | 15 | @SET_MAKE@ 16 | 17 | 18 | 19 | 20 | srcdir = @srcdir@ 21 | top_srcdir = @top_srcdir@ 22 | VPATH = @srcdir@ 23 | pkgdatadir = $(datadir)/@PACKAGE@ 24 | pkglibdir = $(libdir)/@PACKAGE@ 25 | pkgincludedir = $(includedir)/@PACKAGE@ 26 | top_builddir = . 27 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 28 | INSTALL = @INSTALL@ 29 | install_sh_DATA = $(install_sh) -c -m 644 30 | install_sh_PROGRAM = $(install_sh) -c 31 | install_sh_SCRIPT = $(install_sh) -c 32 | INSTALL_HEADER = $(INSTALL_DATA) 33 | transform = $(program_transform_name) 34 | NORMAL_INSTALL = : 35 | PRE_INSTALL = : 36 | POST_INSTALL = : 37 | NORMAL_UNINSTALL = : 38 | PRE_UNINSTALL = : 39 | POST_UNINSTALL = : 40 | build_triplet = @build@ 41 | host_triplet = @host@ 42 | bin_PROGRAMS = sqlite3$(EXEEXT) 43 | DIST_COMMON = README $(am__configure_deps) $(include_HEADERS) \ 44 | $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ 45 | $(srcdir)/sqlite3.pc.in $(top_srcdir)/configure INSTALL \ 46 | config.guess config.sub depcomp install-sh ltmain.sh missing 47 | subdir = . 48 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 49 | am__aclocal_m4_deps = $(top_srcdir)/configure.ac 50 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 51 | $(ACLOCAL_M4) 52 | am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ 53 | configure.lineno configure.status.lineno 54 | mkinstalldirs = $(install_sh) -d 55 | CONFIG_CLEAN_FILES = sqlite3.pc 56 | am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; 57 | am__vpath_adj = case $$p in \ 58 | $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ 59 | *) f=$$p;; \ 60 | esac; 61 | am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; 62 | am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ 63 | "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pkgconfigdir)" \ 64 | "$(DESTDIR)$(includedir)" 65 | libLTLIBRARIES_INSTALL = $(INSTALL) 66 | LTLIBRARIES = $(lib_LTLIBRARIES) 67 | libsqlite3_la_LIBADD = 68 | am_libsqlite3_la_OBJECTS = sqlite3.lo 69 | libsqlite3_la_OBJECTS = $(am_libsqlite3_la_OBJECTS) 70 | binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) 71 | PROGRAMS = $(bin_PROGRAMS) 72 | am_sqlite3_OBJECTS = shell.$(OBJEXT) 73 | sqlite3_OBJECTS = $(am_sqlite3_OBJECTS) 74 | DEFAULT_INCLUDES = -I. -I$(srcdir) 75 | depcomp = $(SHELL) $(top_srcdir)/depcomp 76 | am__depfiles_maybe = depfiles 77 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ 78 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) 79 | LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ 80 | $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ 81 | $(AM_CFLAGS) $(CFLAGS) 82 | CCLD = $(CC) 83 | LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ 84 | $(AM_LDFLAGS) $(LDFLAGS) -o $@ 85 | SOURCES = $(libsqlite3_la_SOURCES) $(sqlite3_SOURCES) 86 | DIST_SOURCES = $(libsqlite3_la_SOURCES) $(sqlite3_SOURCES) 87 | man1dir = $(mandir)/man1 88 | NROFF = nroff 89 | MANS = $(man_MANS) 90 | pkgconfigDATA_INSTALL = $(INSTALL_DATA) 91 | DATA = $(pkgconfig_DATA) 92 | includeHEADERS_INSTALL = $(INSTALL_HEADER) 93 | HEADERS = $(include_HEADERS) 94 | ETAGS = etags 95 | CTAGS = ctags 96 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 97 | distdir = $(PACKAGE)-$(VERSION) 98 | top_distdir = $(distdir) 99 | am__remove_distdir = \ 100 | { test ! -d $(distdir) \ 101 | || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ 102 | && rm -fr $(distdir); }; } 103 | DIST_ARCHIVES = $(distdir).tar.gz 104 | GZIP_ENV = --best 105 | distuninstallcheck_listfiles = find . -type f -print 106 | distcleancheck_listfiles = find . -type f -print 107 | ACLOCAL = @ACLOCAL@ 108 | AMDEP_FALSE = @AMDEP_FALSE@ 109 | AMDEP_TRUE = @AMDEP_TRUE@ 110 | AMTAR = @AMTAR@ 111 | AR = @AR@ 112 | AUTOCONF = @AUTOCONF@ 113 | AUTOHEADER = @AUTOHEADER@ 114 | AUTOMAKE = @AUTOMAKE@ 115 | AWK = @AWK@ 116 | BUILD_CFLAGS = @BUILD_CFLAGS@ 117 | CC = @CC@ 118 | CCDEPMODE = @CCDEPMODE@ 119 | CFLAGS = @CFLAGS@ 120 | CPP = @CPP@ 121 | CPPFLAGS = @CPPFLAGS@ 122 | CXX = @CXX@ 123 | CXXCPP = @CXXCPP@ 124 | CXXDEPMODE = @CXXDEPMODE@ 125 | CXXFLAGS = @CXXFLAGS@ 126 | CYGPATH_W = @CYGPATH_W@ 127 | DEFS = @DEFS@ 128 | DEPDIR = @DEPDIR@ 129 | DYNAMIC_EXTENSION_FLAGS = @DYNAMIC_EXTENSION_FLAGS@ 130 | ECHO = @ECHO@ 131 | ECHO_C = @ECHO_C@ 132 | ECHO_N = @ECHO_N@ 133 | ECHO_T = @ECHO_T@ 134 | EGREP = @EGREP@ 135 | EXEEXT = @EXEEXT@ 136 | F77 = @F77@ 137 | FFLAGS = @FFLAGS@ 138 | GREP = @GREP@ 139 | INSTALL_DATA = @INSTALL_DATA@ 140 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 141 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ 142 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ 143 | LDFLAGS = @LDFLAGS@ 144 | LIBOBJS = @LIBOBJS@ 145 | LIBS = @LIBS@ 146 | LIBTOOL = @LIBTOOL@ 147 | LN_S = @LN_S@ 148 | LTLIBOBJS = @LTLIBOBJS@ 149 | MAKEINFO = @MAKEINFO@ 150 | OBJEXT = @OBJEXT@ 151 | PACKAGE = @PACKAGE@ 152 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ 153 | PACKAGE_NAME = @PACKAGE_NAME@ 154 | PACKAGE_STRING = @PACKAGE_STRING@ 155 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ 156 | PACKAGE_VERSION = @PACKAGE_VERSION@ 157 | PATH_SEPARATOR = @PATH_SEPARATOR@ 158 | RANLIB = @RANLIB@ 159 | READLINE_LIBS = @READLINE_LIBS@ 160 | SET_MAKE = @SET_MAKE@ 161 | SHELL = @SHELL@ 162 | STRIP = @STRIP@ 163 | THREADSAFE_FLAGS = @THREADSAFE_FLAGS@ 164 | VERSION = @VERSION@ 165 | ac_ct_CC = @ac_ct_CC@ 166 | ac_ct_CXX = @ac_ct_CXX@ 167 | ac_ct_F77 = @ac_ct_F77@ 168 | am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ 169 | am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ 170 | am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ 171 | am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ 172 | am__include = @am__include@ 173 | am__leading_dot = @am__leading_dot@ 174 | am__quote = @am__quote@ 175 | am__tar = @am__tar@ 176 | am__untar = @am__untar@ 177 | bindir = @bindir@ 178 | build = @build@ 179 | build_alias = @build_alias@ 180 | build_cpu = @build_cpu@ 181 | build_os = @build_os@ 182 | build_vendor = @build_vendor@ 183 | datadir = @datadir@ 184 | datarootdir = @datarootdir@ 185 | docdir = @docdir@ 186 | dvidir = @dvidir@ 187 | exec_prefix = @exec_prefix@ 188 | host = @host@ 189 | host_alias = @host_alias@ 190 | host_cpu = @host_cpu@ 191 | host_os = @host_os@ 192 | host_vendor = @host_vendor@ 193 | htmldir = @htmldir@ 194 | includedir = @includedir@ 195 | infodir = @infodir@ 196 | install_sh = @install_sh@ 197 | libdir = @libdir@ 198 | libexecdir = @libexecdir@ 199 | localedir = @localedir@ 200 | localstatedir = @localstatedir@ 201 | mandir = @mandir@ 202 | mkdir_p = @mkdir_p@ 203 | oldincludedir = @oldincludedir@ 204 | pdfdir = @pdfdir@ 205 | prefix = @prefix@ 206 | program_transform_name = @program_transform_name@ 207 | psdir = @psdir@ 208 | sbindir = @sbindir@ 209 | sharedstatedir = @sharedstatedir@ 210 | sysconfdir = @sysconfdir@ 211 | target_alias = @target_alias@ 212 | AM_CFLAGS = @THREADSAFE_FLAGS@ @DYNAMIC_EXTENSION_FLAGS@ -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE 213 | lib_LTLIBRARIES = libsqlite3.la 214 | libsqlite3_la_SOURCES = sqlite3.c 215 | libsqlite3_la_LDFLAGS = -no-undefined -version-info 8:6:8 216 | sqlite3_SOURCES = shell.c sqlite3.h 217 | sqlite3_LDADD = $(top_builddir)/libsqlite3.la @READLINE_LIBS@ 218 | sqlite3_DEPENDENCIES = $(top_builddir)/libsqlite3.la 219 | include_HEADERS = sqlite3.h sqlite3ext.h 220 | EXTRA_DIST = sqlite3.pc sqlite3.1 221 | pkgconfigdir = ${libdir}/pkgconfig 222 | pkgconfig_DATA = sqlite3.pc 223 | man_MANS = sqlite3.1 224 | all: all-am 225 | 226 | .SUFFIXES: 227 | .SUFFIXES: .c .lo .o .obj 228 | am--refresh: 229 | @: 230 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) 231 | @for dep in $?; do \ 232 | case '$(am__configure_deps)' in \ 233 | *$$dep*) \ 234 | echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ 235 | cd $(srcdir) && $(AUTOMAKE) --foreign \ 236 | && exit 0; \ 237 | exit 1;; \ 238 | esac; \ 239 | done; \ 240 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ 241 | cd $(top_srcdir) && \ 242 | $(AUTOMAKE) --foreign Makefile 243 | .PRECIOUS: Makefile 244 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 245 | @case '$?' in \ 246 | *config.status*) \ 247 | echo ' $(SHELL) ./config.status'; \ 248 | $(SHELL) ./config.status;; \ 249 | *) \ 250 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ 251 | cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ 252 | esac; 253 | 254 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) 255 | $(SHELL) ./config.status --recheck 256 | 257 | $(top_srcdir)/configure: $(am__configure_deps) 258 | cd $(srcdir) && $(AUTOCONF) 259 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) 260 | cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) 261 | sqlite3.pc: $(top_builddir)/config.status $(srcdir)/sqlite3.pc.in 262 | cd $(top_builddir) && $(SHELL) ./config.status $@ 263 | install-libLTLIBRARIES: $(lib_LTLIBRARIES) 264 | @$(NORMAL_INSTALL) 265 | test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" 266 | @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ 267 | if test -f $$p; then \ 268 | f=$(am__strip_dir) \ 269 | echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ 270 | $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ 271 | else :; fi; \ 272 | done 273 | 274 | uninstall-libLTLIBRARIES: 275 | @$(NORMAL_UNINSTALL) 276 | @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ 277 | p=$(am__strip_dir) \ 278 | echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ 279 | $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ 280 | done 281 | 282 | clean-libLTLIBRARIES: 283 | -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) 284 | @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ 285 | dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ 286 | test "$$dir" != "$$p" || dir=.; \ 287 | echo "rm -f \"$${dir}/so_locations\""; \ 288 | rm -f "$${dir}/so_locations"; \ 289 | done 290 | libsqlite3.la: $(libsqlite3_la_OBJECTS) $(libsqlite3_la_DEPENDENCIES) 291 | $(LINK) -rpath $(libdir) $(libsqlite3_la_LDFLAGS) $(libsqlite3_la_OBJECTS) $(libsqlite3_la_LIBADD) $(LIBS) 292 | install-binPROGRAMS: $(bin_PROGRAMS) 293 | @$(NORMAL_INSTALL) 294 | test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" 295 | @list='$(bin_PROGRAMS)'; for p in $$list; do \ 296 | p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ 297 | if test -f $$p \ 298 | || test -f $$p1 \ 299 | ; then \ 300 | f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ 301 | echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ 302 | $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ 303 | else :; fi; \ 304 | done 305 | 306 | uninstall-binPROGRAMS: 307 | @$(NORMAL_UNINSTALL) 308 | @list='$(bin_PROGRAMS)'; for p in $$list; do \ 309 | f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ 310 | echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ 311 | rm -f "$(DESTDIR)$(bindir)/$$f"; \ 312 | done 313 | 314 | clean-binPROGRAMS: 315 | @list='$(bin_PROGRAMS)'; for p in $$list; do \ 316 | f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ 317 | echo " rm -f $$p $$f"; \ 318 | rm -f $$p $$f ; \ 319 | done 320 | sqlite3$(EXEEXT): $(sqlite3_OBJECTS) $(sqlite3_DEPENDENCIES) 321 | @rm -f sqlite3$(EXEEXT) 322 | $(LINK) $(sqlite3_LDFLAGS) $(sqlite3_OBJECTS) $(sqlite3_LDADD) $(LIBS) 323 | 324 | mostlyclean-compile: 325 | -rm -f *.$(OBJEXT) 326 | 327 | distclean-compile: 328 | -rm -f *.tab.c 329 | 330 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shell.Po@am__quote@ 331 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sqlite3.Plo@am__quote@ 332 | 333 | .c.o: 334 | @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ 335 | @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi 336 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 337 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 338 | @am__fastdepCC_FALSE@ $(COMPILE) -c $< 339 | 340 | .c.obj: 341 | @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ 342 | @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi 343 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 344 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 345 | @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` 346 | 347 | .c.lo: 348 | @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ 349 | @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi 350 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ 351 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 352 | @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< 353 | 354 | mostlyclean-libtool: 355 | -rm -f *.lo 356 | 357 | clean-libtool: 358 | -rm -rf .libs _libs 359 | 360 | distclean-libtool: 361 | -rm -f libtool 362 | uninstall-info-am: 363 | install-man1: $(man1_MANS) $(man_MANS) 364 | @$(NORMAL_INSTALL) 365 | test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)" 366 | @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ 367 | l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ 368 | for i in $$l2; do \ 369 | case "$$i" in \ 370 | *.1*) list="$$list $$i" ;; \ 371 | esac; \ 372 | done; \ 373 | for i in $$list; do \ 374 | if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ 375 | else file=$$i; fi; \ 376 | ext=`echo $$i | sed -e 's/^.*\\.//'`; \ 377 | case "$$ext" in \ 378 | 1*) ;; \ 379 | *) ext='1' ;; \ 380 | esac; \ 381 | inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ 382 | inst=`echo $$inst | sed -e 's/^.*\///'`; \ 383 | inst=`echo $$inst | sed '$(transform)'`.$$ext; \ 384 | echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ 385 | $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ 386 | done 387 | uninstall-man1: 388 | @$(NORMAL_UNINSTALL) 389 | @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ 390 | l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ 391 | for i in $$l2; do \ 392 | case "$$i" in \ 393 | *.1*) list="$$list $$i" ;; \ 394 | esac; \ 395 | done; \ 396 | for i in $$list; do \ 397 | ext=`echo $$i | sed -e 's/^.*\\.//'`; \ 398 | case "$$ext" in \ 399 | 1*) ;; \ 400 | *) ext='1' ;; \ 401 | esac; \ 402 | inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ 403 | inst=`echo $$inst | sed -e 's/^.*\///'`; \ 404 | inst=`echo $$inst | sed '$(transform)'`.$$ext; \ 405 | echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ 406 | rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ 407 | done 408 | install-pkgconfigDATA: $(pkgconfig_DATA) 409 | @$(NORMAL_INSTALL) 410 | test -z "$(pkgconfigdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfigdir)" 411 | @list='$(pkgconfig_DATA)'; for p in $$list; do \ 412 | if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ 413 | f=$(am__strip_dir) \ 414 | echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ 415 | $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \ 416 | done 417 | 418 | uninstall-pkgconfigDATA: 419 | @$(NORMAL_UNINSTALL) 420 | @list='$(pkgconfig_DATA)'; for p in $$list; do \ 421 | f=$(am__strip_dir) \ 422 | echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ 423 | rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \ 424 | done 425 | install-includeHEADERS: $(include_HEADERS) 426 | @$(NORMAL_INSTALL) 427 | test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)" 428 | @list='$(include_HEADERS)'; for p in $$list; do \ 429 | if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ 430 | f=$(am__strip_dir) \ 431 | echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ 432 | $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ 433 | done 434 | 435 | uninstall-includeHEADERS: 436 | @$(NORMAL_UNINSTALL) 437 | @list='$(include_HEADERS)'; for p in $$list; do \ 438 | f=$(am__strip_dir) \ 439 | echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ 440 | rm -f "$(DESTDIR)$(includedir)/$$f"; \ 441 | done 442 | 443 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) 444 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 445 | unique=`for i in $$list; do \ 446 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 447 | done | \ 448 | $(AWK) ' { files[$$0] = 1; } \ 449 | END { for (i in files) print i; }'`; \ 450 | mkid -fID $$unique 451 | tags: TAGS 452 | 453 | TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ 454 | $(TAGS_FILES) $(LISP) 455 | tags=; \ 456 | here=`pwd`; \ 457 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 458 | unique=`for i in $$list; do \ 459 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 460 | done | \ 461 | $(AWK) ' { files[$$0] = 1; } \ 462 | END { for (i in files) print i; }'`; \ 463 | if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ 464 | test -n "$$unique" || unique=$$empty_fix; \ 465 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 466 | $$tags $$unique; \ 467 | fi 468 | ctags: CTAGS 469 | CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ 470 | $(TAGS_FILES) $(LISP) 471 | tags=; \ 472 | here=`pwd`; \ 473 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 474 | unique=`for i in $$list; do \ 475 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 476 | done | \ 477 | $(AWK) ' { files[$$0] = 1; } \ 478 | END { for (i in files) print i; }'`; \ 479 | test -z "$(CTAGS_ARGS)$$tags$$unique" \ 480 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ 481 | $$tags $$unique 482 | 483 | GTAGS: 484 | here=`$(am__cd) $(top_builddir) && pwd` \ 485 | && cd $(top_srcdir) \ 486 | && gtags -i $(GTAGS_ARGS) $$here 487 | 488 | distclean-tags: 489 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 490 | 491 | distdir: $(DISTFILES) 492 | $(am__remove_distdir) 493 | mkdir $(distdir) 494 | $(mkdir_p) $(distdir)/. 495 | @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ 496 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ 497 | list='$(DISTFILES)'; for file in $$list; do \ 498 | case $$file in \ 499 | $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ 500 | $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ 501 | esac; \ 502 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 503 | dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ 504 | if test "$$dir" != "$$file" && test "$$dir" != "."; then \ 505 | dir="/$$dir"; \ 506 | $(mkdir_p) "$(distdir)$$dir"; \ 507 | else \ 508 | dir=''; \ 509 | fi; \ 510 | if test -d $$d/$$file; then \ 511 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 512 | cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ 513 | fi; \ 514 | cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ 515 | else \ 516 | test -f $(distdir)/$$file \ 517 | || cp -p $$d/$$file $(distdir)/$$file \ 518 | || exit 1; \ 519 | fi; \ 520 | done 521 | -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ 522 | ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ 523 | ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ 524 | ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ 525 | || chmod -R a+r $(distdir) 526 | dist-gzip: distdir 527 | tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz 528 | $(am__remove_distdir) 529 | 530 | dist-bzip2: distdir 531 | tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 532 | $(am__remove_distdir) 533 | 534 | dist-tarZ: distdir 535 | tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z 536 | $(am__remove_distdir) 537 | 538 | dist-shar: distdir 539 | shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz 540 | $(am__remove_distdir) 541 | 542 | dist-zip: distdir 543 | -rm -f $(distdir).zip 544 | zip -rq $(distdir).zip $(distdir) 545 | $(am__remove_distdir) 546 | 547 | dist dist-all: distdir 548 | tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz 549 | $(am__remove_distdir) 550 | 551 | # This target untars the dist file and tries a VPATH configuration. Then 552 | # it guarantees that the distribution is self-contained by making another 553 | # tarfile. 554 | distcheck: dist 555 | case '$(DIST_ARCHIVES)' in \ 556 | *.tar.gz*) \ 557 | GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ 558 | *.tar.bz2*) \ 559 | bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ 560 | *.tar.Z*) \ 561 | uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ 562 | *.shar.gz*) \ 563 | GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ 564 | *.zip*) \ 565 | unzip $(distdir).zip ;;\ 566 | esac 567 | chmod -R a-w $(distdir); chmod a+w $(distdir) 568 | mkdir $(distdir)/_build 569 | mkdir $(distdir)/_inst 570 | chmod a-w $(distdir) 571 | dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ 572 | && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ 573 | && cd $(distdir)/_build \ 574 | && ../configure --srcdir=.. --prefix="$$dc_install_base" \ 575 | $(DISTCHECK_CONFIGURE_FLAGS) \ 576 | && $(MAKE) $(AM_MAKEFLAGS) \ 577 | && $(MAKE) $(AM_MAKEFLAGS) dvi \ 578 | && $(MAKE) $(AM_MAKEFLAGS) check \ 579 | && $(MAKE) $(AM_MAKEFLAGS) install \ 580 | && $(MAKE) $(AM_MAKEFLAGS) installcheck \ 581 | && $(MAKE) $(AM_MAKEFLAGS) uninstall \ 582 | && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ 583 | distuninstallcheck \ 584 | && chmod -R a-w "$$dc_install_base" \ 585 | && ({ \ 586 | (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ 587 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ 588 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ 589 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ 590 | distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ 591 | } || { rm -rf "$$dc_destdir"; exit 1; }) \ 592 | && rm -rf "$$dc_destdir" \ 593 | && $(MAKE) $(AM_MAKEFLAGS) dist \ 594 | && rm -rf $(DIST_ARCHIVES) \ 595 | && $(MAKE) $(AM_MAKEFLAGS) distcleancheck 596 | $(am__remove_distdir) 597 | @(echo "$(distdir) archives ready for distribution: "; \ 598 | list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ 599 | sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' 600 | distuninstallcheck: 601 | @cd $(distuninstallcheck_dir) \ 602 | && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ 603 | || { echo "ERROR: files left after uninstall:" ; \ 604 | if test -n "$(DESTDIR)"; then \ 605 | echo " (check DESTDIR support)"; \ 606 | fi ; \ 607 | $(distuninstallcheck_listfiles) ; \ 608 | exit 1; } >&2 609 | distcleancheck: distclean 610 | @if test '$(srcdir)' = . ; then \ 611 | echo "ERROR: distcleancheck can only run from a VPATH build" ; \ 612 | exit 1 ; \ 613 | fi 614 | @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ 615 | || { echo "ERROR: files left in build directory after distclean:" ; \ 616 | $(distcleancheck_listfiles) ; \ 617 | exit 1; } >&2 618 | check-am: all-am 619 | check: check-am 620 | all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(MANS) $(DATA) $(HEADERS) 621 | install-binPROGRAMS: install-libLTLIBRARIES 622 | 623 | installdirs: 624 | for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)"; do \ 625 | test -z "$$dir" || $(mkdir_p) "$$dir"; \ 626 | done 627 | install: install-am 628 | install-exec: install-exec-am 629 | install-data: install-data-am 630 | uninstall: uninstall-am 631 | 632 | install-am: all-am 633 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 634 | 635 | installcheck: installcheck-am 636 | install-strip: 637 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 638 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 639 | `test -z '$(STRIP)' || \ 640 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 641 | mostlyclean-generic: 642 | 643 | clean-generic: 644 | 645 | distclean-generic: 646 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 647 | 648 | maintainer-clean-generic: 649 | @echo "This command is intended for maintainers to use" 650 | @echo "it deletes files that may require special tools to rebuild." 651 | clean: clean-am 652 | 653 | clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ 654 | clean-libtool mostlyclean-am 655 | 656 | distclean: distclean-am 657 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) 658 | -rm -rf ./$(DEPDIR) 659 | -rm -f Makefile 660 | distclean-am: clean-am distclean-compile distclean-generic \ 661 | distclean-libtool distclean-tags 662 | 663 | dvi: dvi-am 664 | 665 | dvi-am: 666 | 667 | html: html-am 668 | 669 | info: info-am 670 | 671 | info-am: 672 | 673 | install-data-am: install-includeHEADERS install-man \ 674 | install-pkgconfigDATA 675 | 676 | install-exec-am: install-binPROGRAMS install-libLTLIBRARIES 677 | 678 | install-info: install-info-am 679 | 680 | install-man: install-man1 681 | 682 | installcheck-am: 683 | 684 | maintainer-clean: maintainer-clean-am 685 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) 686 | -rm -rf $(top_srcdir)/autom4te.cache 687 | -rm -rf ./$(DEPDIR) 688 | -rm -f Makefile 689 | maintainer-clean-am: distclean-am maintainer-clean-generic 690 | 691 | mostlyclean: mostlyclean-am 692 | 693 | mostlyclean-am: mostlyclean-compile mostlyclean-generic \ 694 | mostlyclean-libtool 695 | 696 | pdf: pdf-am 697 | 698 | pdf-am: 699 | 700 | ps: ps-am 701 | 702 | ps-am: 703 | 704 | uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS \ 705 | uninstall-info-am uninstall-libLTLIBRARIES uninstall-man \ 706 | uninstall-pkgconfigDATA 707 | 708 | uninstall-man: uninstall-man1 709 | 710 | .PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ 711 | clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ 712 | clean-libtool ctags dist dist-all dist-bzip2 dist-gzip \ 713 | dist-shar dist-tarZ dist-zip distcheck distclean \ 714 | distclean-compile distclean-generic distclean-libtool \ 715 | distclean-tags distcleancheck distdir distuninstallcheck dvi \ 716 | dvi-am html html-am info info-am install install-am \ 717 | install-binPROGRAMS install-data install-data-am install-exec \ 718 | install-exec-am install-includeHEADERS install-info \ 719 | install-info-am install-libLTLIBRARIES install-man \ 720 | install-man1 install-pkgconfigDATA install-strip installcheck \ 721 | installcheck-am installdirs maintainer-clean \ 722 | maintainer-clean-generic mostlyclean mostlyclean-compile \ 723 | mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ 724 | tags uninstall uninstall-am uninstall-binPROGRAMS \ 725 | uninstall-includeHEADERS uninstall-info-am \ 726 | uninstall-libLTLIBRARIES uninstall-man uninstall-man1 \ 727 | uninstall-pkgconfigDATA 728 | 729 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 730 | # Otherwise a system limit (for SysV at least) may be exceeded. 731 | .NOEXPORT: 732 | --------------------------------------------------------------------------------