Mercurial > vim
comparison src/eval.c @ 2247:c40cd9aad546 vim73
Add patch to improve support of z/OS (OS/390). (Ralf Schandl)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Thu, 03 Jun 2010 21:17:25 +0200 |
parents | dc2e5ec0500d |
children | 6d3d35ff2c2b |
comparison
equal
deleted
inserted
replaced
2246:1e48f569b03d | 2247:c40cd9aad546 |
---|---|
818 static void getwinvar __ARGS((typval_T *argvars, typval_T *rettv, int off)); | 818 static void getwinvar __ARGS((typval_T *argvars, typval_T *rettv, int off)); |
819 static int searchpair_cmn __ARGS((typval_T *argvars, pos_T *match_pos)); | 819 static int searchpair_cmn __ARGS((typval_T *argvars, pos_T *match_pos)); |
820 static int search_cmn __ARGS((typval_T *argvars, pos_T *match_pos, int *flagsp)); | 820 static int search_cmn __ARGS((typval_T *argvars, pos_T *match_pos, int *flagsp)); |
821 static void setwinvar __ARGS((typval_T *argvars, typval_T *rettv, int off)); | 821 static void setwinvar __ARGS((typval_T *argvars, typval_T *rettv, int off)); |
822 | 822 |
823 | |
824 #ifdef EBCDIC | |
825 static int compare_func_name __ARGS((const void *s1, const void *s2)); | |
826 static void sortFunctions __ARGS(()); | |
827 #endif | |
828 | |
829 | |
823 /* Character used as separated in autoload function/variable names. */ | 830 /* Character used as separated in autoload function/variable names. */ |
824 #define AUTOLOAD_CHAR '#' | 831 #define AUTOLOAD_CHAR '#' |
825 | 832 |
826 /* | 833 /* |
827 * Initialize the global and v: variables. | 834 * Initialize the global and v: variables. |
854 if (p->vv_flags & VV_COMPAT) | 861 if (p->vv_flags & VV_COMPAT) |
855 /* add to compat scope dict */ | 862 /* add to compat scope dict */ |
856 hash_add(&compat_hashtab, p->vv_di.di_key); | 863 hash_add(&compat_hashtab, p->vv_di.di_key); |
857 } | 864 } |
858 set_vim_var_nr(VV_SEARCHFORWARD, 1L); | 865 set_vim_var_nr(VV_SEARCHFORWARD, 1L); |
866 | |
867 #ifdef EBCDIC | |
868 /* | |
869 * Sort the function table, to enable binary sort. | |
870 */ | |
871 sortFunctions(); | |
872 #endif | |
859 } | 873 } |
860 | 874 |
861 #if defined(EXITFREE) || defined(PROTO) | 875 #if defined(EXITFREE) || defined(PROTO) |
862 void | 876 void |
863 eval_clear() | 877 eval_clear() |
7899 return get_user_var_name(xp, ++intidx); | 7913 return get_user_var_name(xp, ++intidx); |
7900 } | 7914 } |
7901 | 7915 |
7902 #endif /* FEAT_CMDL_COMPL */ | 7916 #endif /* FEAT_CMDL_COMPL */ |
7903 | 7917 |
7918 #if defined(EBCDIC) || defined(PROTO) | |
7919 /* | |
7920 * Compare struct fst by function name. | |
7921 */ | |
7922 static int | |
7923 compare_func_name(s1, s2) | |
7924 const void *s1; | |
7925 const void *s2; | |
7926 { | |
7927 struct fst *p1 = (struct fst *)s1; | |
7928 struct fst *p2 = (struct fst *)s2; | |
7929 | |
7930 return STRCMP(p1->f_name, p2->f_name); | |
7931 } | |
7932 | |
7933 /* | |
7934 * Sort the function table by function name. | |
7935 * The sorting of the table above is ASCII dependant. | |
7936 * On machines using EBCDIC we have to sort it. | |
7937 */ | |
7938 static void | |
7939 sortFunctions() | |
7940 { | |
7941 int funcCnt = (int)(sizeof(functions) / sizeof(struct fst)) - 1; | |
7942 | |
7943 qsort(functions, (size_t)funcCnt, sizeof(struct fst), compare_func_name); | |
7944 } | |
7945 #endif | |
7946 | |
7947 | |
7904 /* | 7948 /* |
7905 * Find internal function in table above. | 7949 * Find internal function in table above. |
7906 * Return index, or -1 if not found | 7950 * Return index, or -1 if not found |
7907 */ | 7951 */ |
7908 static int | 7952 static int |
19241 sv->sv_var.di_tv.vval.v_dict = &sv->sv_dict; | 19285 sv->sv_var.di_tv.vval.v_dict = &sv->sv_dict; |
19242 } | 19286 } |
19243 | 19287 |
19244 while (ga_scripts.ga_len < id) | 19288 while (ga_scripts.ga_len < id) |
19245 { | 19289 { |
19246 sv = SCRIPT_SV(ga_scripts.ga_len + 1) = | 19290 sv = SCRIPT_SV(ga_scripts.ga_len + 1) = |
19247 (scriptvar_T *)alloc_clear(sizeof(scriptvar_T)); | 19291 (scriptvar_T *)alloc_clear(sizeof(scriptvar_T)); |
19248 init_var_dict(&sv->sv_dict, &sv->sv_var); | 19292 init_var_dict(&sv->sv_dict, &sv->sv_var); |
19249 ++ga_scripts.ga_len; | 19293 ++ga_scripts.ga_len; |
19250 } | 19294 } |
19251 } | 19295 } |
22479 * Some of the directories specified in "fname" may not exist. This function | 22523 * Some of the directories specified in "fname" may not exist. This function |
22480 * will shorten the existing directories at the beginning of the path and then | 22524 * will shorten the existing directories at the beginning of the path and then |
22481 * append the remaining non-existing path. | 22525 * append the remaining non-existing path. |
22482 * | 22526 * |
22483 * fname - Pointer to the filename to shorten. On return, contains the | 22527 * fname - Pointer to the filename to shorten. On return, contains the |
22484 * pointer to the shortened pathname | 22528 * pointer to the shortened pathname |
22485 * bufp - Pointer to an allocated buffer for the filename. | 22529 * bufp - Pointer to an allocated buffer for the filename. |
22486 * fnamelen - Length of the filename pointed to by fname | 22530 * fnamelen - Length of the filename pointed to by fname |
22487 * | 22531 * |
22488 * Returns OK on success (or nothing done) and FAIL on failure (out of memory). | 22532 * Returns OK on success (or nothing done) and FAIL on failure (out of memory). |
22489 */ | 22533 */ |