Mercurial > vim
comparison src/ex_docmd.c @ 21885:72525eabfe61 v8.2.1492
patch 8.2.1492: build failures
Commit: https://github.com/vim/vim/commit/20b23c6358131baefb57b9083387fb4524d3ff24
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Aug 20 15:25:00 2020 +0200
patch 8.2.1492: build failures
Problem: Build failures.
Solution: Move typedef out of #ifdef. Adjust argument types. Discover
America.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 20 Aug 2020 15:30:03 +0200 |
parents | a427f5f26419 |
children | f19ac9b8b011 |
comparison
equal
deleted
inserted
replaced
21884:c2f5f1b4a6e1 | 21885:72525eabfe61 |
---|---|
18 #ifndef FEAT_PRINTER | 18 #ifndef FEAT_PRINTER |
19 # define ex_hardcopy ex_ni | 19 # define ex_hardcopy ex_ni |
20 #endif | 20 #endif |
21 | 21 |
22 #ifdef FEAT_EVAL | 22 #ifdef FEAT_EVAL |
23 static char_u *do_one_cmd(char_u **, int, cstack_T *, char_u *(*fgetline)(int, void *, int, int), void *cookie); | 23 static char_u *do_one_cmd(char_u **, int, cstack_T *, char_u *(*fgetline)(int, void *, int, getline_opt_T), void *cookie); |
24 #else | 24 #else |
25 static char_u *do_one_cmd(char_u **, int, char_u *(*fgetline)(int, void *, int, int), void *cookie); | 25 static char_u *do_one_cmd(char_u **, int, char_u *(*fgetline)(int, void *, int, getline_opt_T), void *cookie); |
26 static int if_level = 0; // depth in :if | 26 static int if_level = 0; // depth in :if |
27 #endif | 27 #endif |
28 static void append_command(char_u *cmd); | 28 static void append_command(char_u *cmd); |
29 | 29 |
30 #ifndef FEAT_MENU | 30 #ifndef FEAT_MENU |
401 { | 401 { |
402 garray_T *lines_gap; // growarray with line info | 402 garray_T *lines_gap; // growarray with line info |
403 int current_line; // last read line from growarray | 403 int current_line; // last read line from growarray |
404 int repeating; // TRUE when looping a second time | 404 int repeating; // TRUE when looping a second time |
405 // When "repeating" is FALSE use "getline" and "cookie" to get lines | 405 // When "repeating" is FALSE use "getline" and "cookie" to get lines |
406 char_u *(*getline)(int, void *, int, int); | 406 char_u *(*getline)(int, void *, int, getline_opt_T); |
407 void *cookie; | 407 void *cookie; |
408 }; | 408 }; |
409 | 409 |
410 static char_u *get_loop_line(int c, void *cookie, int indent, int do_concat); | 410 static char_u *get_loop_line(int c, void *cookie, int indent, getline_opt_T options); |
411 static int store_loop_line(garray_T *gap, char_u *line); | 411 static int store_loop_line(garray_T *gap, char_u *line); |
412 static void free_cmdlines(garray_T *gap); | 412 static void free_cmdlines(garray_T *gap); |
413 | 413 |
414 // Struct to save a few things while debugging. Used in do_cmdline() only. | 414 // Struct to save a few things while debugging. Used in do_cmdline() only. |
415 struct dbg_stuff | 415 struct dbg_stuff |
1417 #ifdef FEAT_EVAL | 1417 #ifdef FEAT_EVAL |
1418 /* | 1418 /* |
1419 * Obtain a line when inside a ":while" or ":for" loop. | 1419 * Obtain a line when inside a ":while" or ":for" loop. |
1420 */ | 1420 */ |
1421 static char_u * | 1421 static char_u * |
1422 get_loop_line(int c, void *cookie, int indent, int do_concat) | 1422 get_loop_line(int c, void *cookie, int indent, getline_opt_T options) |
1423 { | 1423 { |
1424 struct loop_cookie *cp = (struct loop_cookie *)cookie; | 1424 struct loop_cookie *cp = (struct loop_cookie *)cookie; |
1425 wcmd_T *wp; | 1425 wcmd_T *wp; |
1426 char_u *line; | 1426 char_u *line; |
1427 | 1427 |
1430 if (cp->repeating) | 1430 if (cp->repeating) |
1431 return NULL; // trying to read past ":endwhile"/":endfor" | 1431 return NULL; // trying to read past ":endwhile"/":endfor" |
1432 | 1432 |
1433 // First time inside the ":while"/":for": get line normally. | 1433 // First time inside the ":while"/":for": get line normally. |
1434 if (cp->getline == NULL) | 1434 if (cp->getline == NULL) |
1435 line = getcmdline(c, 0L, indent, do_concat); | 1435 line = getcmdline(c, 0L, indent, options); |
1436 else | 1436 else |
1437 line = cp->getline(c, cp->cookie, indent, do_concat); | 1437 line = cp->getline(c, cp->cookie, indent, options); |
1438 if (line != NULL && store_loop_line(cp->lines_gap, line) == OK) | 1438 if (line != NULL && store_loop_line(cp->lines_gap, line) == OK) |
1439 ++cp->current_line; | 1439 ++cp->current_line; |
1440 | 1440 |
1441 return line; | 1441 return line; |
1442 } | 1442 } |
1485 char_u *(*fgetline)(int, void *, int, getline_opt_T), | 1485 char_u *(*fgetline)(int, void *, int, getline_opt_T), |
1486 void *cookie UNUSED, // argument for fgetline() | 1486 void *cookie UNUSED, // argument for fgetline() |
1487 char_u *(*func)(int, void *, int, getline_opt_T)) | 1487 char_u *(*func)(int, void *, int, getline_opt_T)) |
1488 { | 1488 { |
1489 #ifdef FEAT_EVAL | 1489 #ifdef FEAT_EVAL |
1490 char_u *(*gp)(int, void *, int, int); | 1490 char_u *(*gp)(int, void *, int, getline_opt_T); |
1491 struct loop_cookie *cp; | 1491 struct loop_cookie *cp; |
1492 | 1492 |
1493 // When "fgetline" is "get_loop_line()" use the "cookie" to find the | 1493 // When "fgetline" is "get_loop_line()" use the "cookie" to find the |
1494 // function that's originally used to obtain the lines. This may be | 1494 // function that's originally used to obtain the lines. This may be |
1495 // nested several levels. | 1495 // nested several levels. |
1514 getline_cookie( | 1514 getline_cookie( |
1515 char_u *(*fgetline)(int, void *, int, getline_opt_T) UNUSED, | 1515 char_u *(*fgetline)(int, void *, int, getline_opt_T) UNUSED, |
1516 void *cookie) // argument for fgetline() | 1516 void *cookie) // argument for fgetline() |
1517 { | 1517 { |
1518 #ifdef FEAT_EVAL | 1518 #ifdef FEAT_EVAL |
1519 char_u *(*gp)(int, void *, int, int); | 1519 char_u *(*gp)(int, void *, int, getline_opt_T); |
1520 struct loop_cookie *cp; | 1520 struct loop_cookie *cp; |
1521 | 1521 |
1522 // When "fgetline" is "get_loop_line()" use the "cookie" to find the | 1522 // When "fgetline" is "get_loop_line()" use the "cookie" to find the |
1523 // cookie that's originally used to obtain the lines. This may be nested | 1523 // cookie that's originally used to obtain the lines. This may be nested |
1524 // several levels. | 1524 // several levels. |
1542 char_u * | 1542 char_u * |
1543 getline_peek( | 1543 getline_peek( |
1544 char_u *(*fgetline)(int, void *, int, getline_opt_T) UNUSED, | 1544 char_u *(*fgetline)(int, void *, int, getline_opt_T) UNUSED, |
1545 void *cookie) // argument for fgetline() | 1545 void *cookie) // argument for fgetline() |
1546 { | 1546 { |
1547 char_u *(*gp)(int, void *, int, int); | 1547 char_u *(*gp)(int, void *, int, getline_opt_T); |
1548 struct loop_cookie *cp; | 1548 struct loop_cookie *cp; |
1549 wcmd_T *wp; | 1549 wcmd_T *wp; |
1550 | 1550 |
1551 // When "fgetline" is "get_loop_line()" use the "cookie" to find the | 1551 // When "fgetline" is "get_loop_line()" use the "cookie" to find the |
1552 // cookie that's originally used to obtain the lines. This may be nested | 1552 // cookie that's originally used to obtain the lines. This may be nested |
1692 char_u **cmdlinep, | 1692 char_u **cmdlinep, |
1693 int sourcing, | 1693 int sourcing, |
1694 #ifdef FEAT_EVAL | 1694 #ifdef FEAT_EVAL |
1695 cstack_T *cstack, | 1695 cstack_T *cstack, |
1696 #endif | 1696 #endif |
1697 char_u *(*fgetline)(int, void *, int, int), | 1697 char_u *(*fgetline)(int, void *, int, getline_opt_T), |
1698 void *cookie) // argument for fgetline() | 1698 void *cookie) // argument for fgetline() |
1699 { | 1699 { |
1700 char_u *p; | 1700 char_u *p; |
1701 linenr_T lnum; | 1701 linenr_T lnum; |
1702 long n; | 1702 long n; |