diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/Makefile | 6 | ||||
-rwxr-xr-x | src/doc | 6 | ||||
-rw-r--r-- | src/file.c | 10 |
3 files changed, 18 insertions, 4 deletions
diff --git a/src/Makefile b/src/Makefile index 454459f..cf183d2 100755 --- a/src/Makefile +++ b/src/Makefile @@ -122,7 +122,11 @@ ifneq (, $(shell which pkg-config)) LDLIBS += $(shell pkg-config --libs lua51) -Wl,--export-dynamic else ifneq ($(shell pkg-config --exists lua-5.1 || echo 'no'),no) # FreeBSD CFLAGS += -DXLUA $(shell pkg-config --cflags lua-5.1) - LDLIBS += $(shell pkg-config --libs lua-5.1) -Wl,--export-dynamic + ifneq ($(shell uname -s),Darwin) + LDLIBS += $(shell pkg-config --libs lua-5.1) -Wl,--export-dynamic + else + LDLIBS += $(shell pkg-config --libs lua-5.1) -rdynamic + endif endif else ifeq ($(shell uname -s),Darwin) # macOS without pkg-config @@ -791,7 +791,7 @@ Commands for handling cell content: available for dynamic linking with modules. The search path for LUA trigger files is - $HOME/.scim/lua/ or /usr/local/share/scim/lua + $PWD/lua/ or $HOME/.scim/lua/ or /usr/local/share/scim/lua (in that order) and for C Trigger $HOME/.scim/module or /usr/local/share/scim/module @@ -1284,7 +1284,7 @@ Commands for handling cell content: @lua("luascript",0) Executes a "luascript". Using Lua script scim can be extend with lot new functionality, such as complex programming, accessing databases etc. - The search patch for LUA scripts files is + The search patch for LUA scripts files is $PWD/lua/ $HOME/.scim/lua/ or /usr/local/share/scim/lua (in that order) Always use it only with @ston see example: @ston(@lua("luascript",0)) @@ -1354,7 +1354,7 @@ Commands for handling cell content: sc.curcol() - return current column sc.currow() - return current row - The search patch for LUA scripts files is + The search patch for LUA scripts files is $PWD/lua or $HOME/.scim/lua/ or /usr/local/share/scim/lua (in that order) Example can be found in sc-im/examples/lua in source code tree. @@ -1339,7 +1339,17 @@ int max_length(FILE * f) { int plugin_exists(char * name, int len, char * path) { FILE * fp; static char * HomeDir; + char cwd[1024]; + if (getcwd(cwd, sizeof(cwd)) != NULL) { + strcpy((char *) path, cwd); + strcat((char *) path, "/"); + strncat((char *) path, name, len); + if ((fp = fopen((char *) path, "r"))) { + fclose(fp); + return 1; + } + } if ((HomeDir = getenv("HOME"))) { strcpy((char *) path, HomeDir); strcat((char *) path, "/.scim/"); |