aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/charset.c1
-rw-r--r--src/edit.c1
-rw-r--r--src/edit.h2
-rw-r--r--src/ex_cmds.c1
-rw-r--r--src/ex_getln.c1
-rw-r--r--src/farsi.c42
-rw-r--r--src/farsi.h63
-rw-r--r--src/getchar.c1
-rw-r--r--src/globals.h5
-rw-r--r--src/main.c7
-rw-r--r--src/main.h12
-rw-r--r--src/normal.c1
-rw-r--r--src/screen.c1
-rw-r--r--src/search.c1
-rw-r--r--src/window.c1
16 files changed, 72 insertions, 70 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 8f9320ced9..1a5e6ebdc5 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -4,7 +4,7 @@ file( GLOB NEOVIM_SOURCES *.c )
foreach(sfile ${NEOVIM_SOURCES})
get_filename_component(f ${sfile} NAME)
- if(${f} MATCHES "^(regexp_nfa.c|farsi.c)$")
+ if(${f} MATCHES "^(regexp_nfa.c)$")
list(APPEND to_remove ${sfile})
endif()
endforeach()
diff --git a/src/charset.c b/src/charset.c
index fb2ed7be44..7d176ec092 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -4,6 +4,7 @@
#include "vim.h"
#include "charset.h"
+#include "farsi.h"
#include "main.h"
#include "mbyte.h"
#include "memline.h"
diff --git a/src/edit.c b/src/edit.c
index d7afd6d40d..f3a393a9a4 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -19,6 +19,7 @@
#include "eval.h"
#include "ex_docmd.h"
#include "ex_getln.h"
+#include "farsi.h"
#include "fileio.h"
#include "fold.h"
#include "getchar.h"
diff --git a/src/edit.h b/src/edit.h
index 9d45e54dc7..e52bfa61d6 100644
--- a/src/edit.h
+++ b/src/edit.h
@@ -1,6 +1,8 @@
#ifndef NEOVIM_EDIT_H
#define NEOVIM_EDIT_H
+#include "vim.h"
+
/*
* Array indexes used for cptext argument of ins_compl_add().
*/
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 006e788cb6..51e55b1300 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -24,6 +24,7 @@
#include "ex_docmd.h"
#include "ex_eval.h"
#include "ex_getln.h"
+#include "farsi.h"
#include "fileio.h"
#include "fold.h"
#include "getchar.h"
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 2079eafb8c..7008586663 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -23,6 +23,7 @@
#include "ex_cmds2.h"
#include "ex_docmd.h"
#include "ex_eval.h"
+#include "farsi.h"
#include "fileio.h"
#include "getchar.h"
#include "if_cscope.h"
diff --git a/src/farsi.c b/src/farsi.c
index b09c44ecc5..ea9432ac8b 100644
--- a/src/farsi.c
+++ b/src/farsi.c
@@ -2,11 +2,20 @@
///
/// Functions for Farsi language
///
-/// Included by main.c, when FEAT_FKMAP is defined.
-#include "farsi.h"
+
#include "edit.h"
+#include "ex_docmd.h"
+#include "ex_eval.h"
#include "ex_getln.h"
+#include "farsi.h"
+#include "getchar.h"
+#include "memline.h"
+#include "message.h"
+#include "misc1.h"
+#include "misc2.h"
+#include "screen.h"
+#include "vim.h"
#define SRC_EDT 0
@@ -14,6 +23,35 @@
#define AT_CURSOR 0
+// special Farsi text messages
+
+const char_u farsi_text_1[] = {
+ YE_, _SIN, RE, ALEF_, _FE, ' ', 'V', 'I', 'M',
+ ' ', F_HE, _BE, ' ', SHIN, RE, _GAF, DAL, ' ', NOON,
+ ALEF_, _YE, ALEF_, _PE, '\0'
+};
+
+const char_u farsi_text_2[] = {
+ YE_, _SIN, RE, ALEF_, _FE, ' ', FARSI_3, FARSI_3,
+ FARSI_4, FARSI_2, ' ', DAL, RE, ALEF, DAL, _NOON,
+ ALEF_, _TE, _SIN, ALEF, ' ', F_HE, _BE, ' ', SHIN,
+ RE, _GAF, DAL, ' ', NOON, ALEF_, _YE, ALEF_, _PE, '\0'
+};
+
+const char_u farsi_text_3[] = {
+ DAL, WAW, _SHIN, _YE, _MIM, _NOON, ' ', YE_, _NOON,
+ ALEF_, _BE, _YE, _TE, _SHIN, _PE, ' ', 'R', 'E', 'P', 'L',
+ 'A', 'C', 'E', ' ', NOON, ALEF_, _MIM, RE, _FE, ZE, ALEF,
+ ' ', 'R', 'E', 'V', 'E', 'R', 'S', 'E', ' ', 'I', 'N',
+ 'S', 'E', 'R', 'T', ' ', SHIN, WAW, RE, ' ', ALEF_, _BE,
+ ' ', YE_, _SIN, RE, ALEF_, _FE, ' ', RE, DAL, ' ', RE,
+ ALEF_, _KAF, ' ', MIM, ALEF_, _GAF, _NOON, _HE, '\0'
+};
+
+const char_u farsi_text_5[] = {
+ ' ', YE_, _SIN, RE, ALEF_, _FE, '\0'
+};
+
static int toF_Xor_X_(int c);
static int F_is_TyE(int c);
static int F_is_TyC_TyD(int c);
diff --git a/src/farsi.h b/src/farsi.h
index 50ba26ca80..c5ee336a0f 100644
--- a/src/farsi.h
+++ b/src/farsi.h
@@ -11,6 +11,9 @@
#ifndef NEOVIM_FARSI_H
#define NEOVIM_FARSI_H
+#include "normal.h"
+#include "types.h"
+
// Farsi character set definition
// Begin of the non-standard part
@@ -159,48 +162,22 @@
#define W_R_L 0x2
// special Farsi text messages
-
-#ifdef DO_INIT
-EXTERN char_u farsi_text_1[] = {
- YE_, _SIN, RE, ALEF_, _FE, ' ', 'V', 'I', 'M',
- ' ', F_HE, _BE, ' ', SHIN, RE, _GAF, DAL, ' ', NOON,
- ALEF_, _YE, ALEF_, _PE, '\0'
-};
-#else
-EXTERN char_u farsi_text_1[];
-#endif
-
-#ifdef DO_INIT
-EXTERN char_u farsi_text_2[] = {
- YE_, _SIN, RE, ALEF_, _FE, ' ', FARSI_3, FARSI_3,
- FARSI_4, FARSI_2, ' ', DAL, RE, ALEF, DAL, _NOON,
- ALEF_, _TE, _SIN, ALEF, ' ', F_HE, _BE, ' ', SHIN,
- RE, _GAF, DAL, ' ', NOON, ALEF_, _YE, ALEF_, _PE, '\0'
-};
-#else
-EXTERN char_u farsi_text_2[];
-#endif
-
-#ifdef DO_INIT
-EXTERN char_u farsi_text_3[] = {
- DAL, WAW, _SHIN, _YE, _MIM, _NOON, ' ', YE_, _NOON,
- ALEF_, _BE, _YE, _TE, _SHIN, _PE, ' ', 'R', 'E', 'P', 'L',
- 'A', 'C', 'E', ' ', NOON, ALEF_, _MIM, RE, _FE, ZE, ALEF,
- ' ', 'R', 'E', 'V', 'E', 'R', 'S', 'E', ' ', 'I', 'N',
- 'S', 'E', 'R', 'T', ' ', SHIN, WAW, RE, ' ', ALEF_, _BE,
- ' ', YE_, _SIN, RE, ALEF_, _FE, ' ', RE, DAL, ' ', RE,
- ALEF_, _KAF, ' ', MIM, ALEF_, _GAF, _NOON, _HE, '\0'
-};
-#else
-EXTERN char_u farsi_text_3[];
-#endif
-
-#ifdef DO_INIT
-EXTERN char_u farsi_text_5[] = {
- ' ', YE_, _SIN, RE, ALEF_, _FE, '\0'
-};
-#else
-EXTERN char_u farsi_text_5[];
-#endif
+extern const char_u farsi_text_1[];
+extern const char_u farsi_text_2[];
+extern const char_u farsi_text_3[];
+extern const char_u farsi_text_5[];
+
+int toF_TyA(int c);
+int fkmap(int c);
+void conv_to_pvim(void);
+void conv_to_pstd(void);
+char_u *lrswap(char_u *ibuf);
+char_u *lrFswap(char_u *cmdbuf, int len);
+char_u *lrF_sub(char_u *ibuf);
+int cmdl_fkmap(int c);
+int F_isalpha(int c);
+int F_isdigit(int c);
+int F_ischar(int c);
+void farsi_fkey(cmdarg_T *cap);
#endif // NEOVIM_FARSI_H
diff --git a/src/getchar.c b/src/getchar.c
index f33a2279cb..87bd899880 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -23,6 +23,7 @@
#include "eval.h"
#include "ex_docmd.h"
#include "ex_getln.h"
+#include "farsi.h"
#include "main.h"
#include "mbyte.h"
#include "memline.h"
diff --git a/src/globals.h b/src/globals.h
index 68ee584655..960e828532 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -1139,9 +1139,4 @@ EXTERN int curr_tmode INIT(= TMODE_COOK); /* contains current terminal mode */
/* volatile because it is used in signal handler deathtrap(). */
EXTERN volatile bool in_mch_delay INIT(= false); /* sleeping in mch_delay() */
-/*
- * Optional Farsi support. Include it here, so EXTERN and INIT are defined.
- */
-# include "farsi.h"
-
#endif /* NEOVIM_GLOBALS_H */
diff --git a/src/main.c b/src/main.c
index 1fec7ffc96..331801c46b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2392,10 +2392,3 @@ time_msg (
}
#endif
-
-
-
-/*
- * When FEAT_FKMAP is defined, also compile the Farsi source code.
- */
-# include "farsi.c"
diff --git a/src/main.h b/src/main.h
index e0659c9f87..286540b3cb 100644
--- a/src/main.h
+++ b/src/main.h
@@ -14,17 +14,5 @@ void time_msg(char *mesg, void *tv_start);
void server_to_input_buf(char_u *str);
char_u *eval_client_expr_to_string(char_u *expr);
char_u *serverConvert(char_u *client_enc, char_u *data, char_u **tofree);
-int toF_TyA(int c);
-int fkmap(int c);
-void conv_to_pvim(void);
-void conv_to_pstd(void);
-char_u *lrswap(char_u *ibuf);
-char_u *lrFswap(char_u *cmdbuf, int len);
-char_u *lrF_sub(char_u *ibuf);
-int cmdl_fkmap(int c);
-int F_isalpha(int c);
-int F_isdigit(int c);
-int F_ischar(int c);
-void farsi_fkey(cmdarg_T *cap);
/* vim: set ft=c : */
#endif /* NEOVIM_MAIN_H */
diff --git a/src/normal.c b/src/normal.c
index 771f8b7322..770a030db9 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -24,6 +24,7 @@
#include "ex_cmds2.h"
#include "ex_docmd.h"
#include "ex_getln.h"
+#include "farsi.h"
#include "fileio.h"
#include "fold.h"
#include "getchar.h"
diff --git a/src/screen.c b/src/screen.c
index 95775f3bcb..fa07cc651d 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -96,6 +96,7 @@
#include "eval.h"
#include "ex_cmds2.h"
#include "ex_getln.h"
+#include "farsi.h"
#include "fileio.h"
#include "fold.h"
#include "getchar.h"
diff --git a/src/search.c b/src/search.c
index c6365aedc0..ade09e8aed 100644
--- a/src/search.c
+++ b/src/search.c
@@ -18,6 +18,7 @@
#include "ex_cmds.h"
#include "ex_cmds2.h"
#include "ex_getln.h"
+#include "farsi.h"
#include "fileio.h"
#include "fold.h"
#include "getchar.h"
diff --git a/src/window.c b/src/window.c
index 93c63a1986..0f09424f21 100644
--- a/src/window.c
+++ b/src/window.c
@@ -19,6 +19,7 @@
#include "ex_docmd.h"
#include "ex_eval.h"
#include "ex_getln.h"
+#include "farsi.h"
#include "fileio.h"
#include "fold.h"
#include "getchar.h"