0
0
mirror of https://github.com/rkd77/elinks.git synced 2025-06-30 22:19:29 -04:00

delete -> delete_ for C++ compatibility

This commit is contained in:
Witold Filipczyk 2016-04-20 18:57:32 +02:00
parent 67673f5fe5
commit 8cf00fa61c
11 changed files with 39 additions and 39 deletions

View File

@ -661,7 +661,7 @@ do_delete_item(struct listbox_item *item, struct listbox_context *info,
return; return;
} }
ops->delete(item, last); ops->delete_(item, last);
} }
static int static int
@ -723,14 +723,14 @@ query_delete_selected_item(void *context_)
const struct listbox_ops *ops = box->ops; const struct listbox_ops *ops = box->ops;
struct listbox_item *item = box->sel; struct listbox_item *item = box->sel;
unsigned char *text; unsigned char *text;
enum delete_error delete; enum delete_error delete_;
assert(item); assert(item);
delete = ops->can_delete(item) ? DELETE_LOCKED : DELETE_IMPOSSIBLE; delete_ = ops->can_delete(item) ? DELETE_LOCKED : DELETE_IMPOSSIBLE;
if (delete == DELETE_IMPOSSIBLE || ops->is_used(item)) { if (delete_ == DELETE_IMPOSSIBLE || ops->is_used(item)) {
print_delete_error(item, term, ops, delete); print_delete_error(item, term, ops, delete_);
return EVENT_PROCESSED; return EVENT_PROCESSED;
} }
@ -791,7 +791,7 @@ push_hierbox_delete_button(struct dialog_data *dlg_data,
if (!item) return EVENT_PROCESSED; if (!item) return EVENT_PROCESSED;
assert(ops && ops->can_delete && ops->delete); assert(ops && ops->can_delete && ops->delete_);
context = init_listbox_context(box, term, item, scan_for_marks); context = init_listbox_context(box, term, item, scan_for_marks);
if (!context) return EVENT_PROCESSED; if (!context) return EVENT_PROCESSED;

View File

@ -702,7 +702,7 @@ do_kbd_listbox_action(enum menu_action action_id, struct dialog_data *dlg_data,
box = get_listbox_widget_data(dlg_item); box = get_listbox_widget_data(dlg_item);
if (box->ops if (box->ops
&& box->ops->delete && box->ops->delete_
&& box->ops->can_delete) && box->ops->can_delete)
push_hierbox_delete_button(dlg_data, push_hierbox_delete_button(dlg_data,
widget_data); widget_data);

View File

@ -85,7 +85,7 @@ struct listbox_ops {
/* Delete the listbox item object, its data and all nested listboxes. /* Delete the listbox item object, its data and all nested listboxes.
* @last is non zero when either deleting only one item or when * @last is non zero when either deleting only one item or when
* deleting the last item. */ * deleting the last item. */
void (*delete)(struct listbox_item *, int last); void (*delete_)(struct listbox_item *, int last);
/* If defined it means that the it will control all drawing of the /* If defined it means that the it will control all drawing of the
* listbox item text and what might else be possible on the screen on * listbox item text and what might else be possible on the screen on

View File

@ -94,7 +94,7 @@ push_delete_button(struct dialog_data *dlg_data, struct widget_data *widget_data
{ {
struct file_download *file_download = dlg_data->dlg->udata; struct file_download *file_download = dlg_data->dlg->udata;
file_download->delete = 1; file_download->delete_ = 1;
#if CONFIG_BITTORRENT #if CONFIG_BITTORRENT
if (file_download->uri->protocol == PROTOCOL_BITTORRENT) if (file_download->uri->protocol == PROTOCOL_BITTORRENT)
set_bittorrent_files_for_deletion(&file_download->download); set_bittorrent_files_for_deletion(&file_download->download);

View File

@ -316,7 +316,7 @@ struct bittorrent_fetcher {
bittorrent_fetch_callback_T callback; bittorrent_fetch_callback_T callback;
void *data; void *data;
int redirects; int redirects;
unsigned int delete:1; unsigned int delete_:1;
struct download download; struct download download;
}; };
@ -384,7 +384,7 @@ bittorrent_fetch_callback(struct download *download, void *data)
fetcher->callback(fetcher->data, connection_state(S_OK), &response); fetcher->callback(fetcher->data, connection_state(S_OK), &response);
if (fetcher->delete) if (fetcher->delete_)
delete_cache_entry(cached); delete_cache_entry(cached);
if (fetcher->ref) if (fetcher->ref)
*fetcher->ref = NULL; *fetcher->ref = NULL;
@ -394,7 +394,7 @@ bittorrent_fetch_callback(struct download *download, void *data)
struct bittorrent_fetcher * struct bittorrent_fetcher *
init_bittorrent_fetch(struct bittorrent_fetcher **fetcher_ref, init_bittorrent_fetch(struct bittorrent_fetcher **fetcher_ref,
struct uri *uri, bittorrent_fetch_callback_T callback, struct uri *uri, bittorrent_fetch_callback_T callback,
void *data, int delete) void *data, int delete_)
{ {
struct bittorrent_fetcher *fetcher; struct bittorrent_fetcher *fetcher;
@ -410,7 +410,7 @@ init_bittorrent_fetch(struct bittorrent_fetcher **fetcher_ref,
fetcher->ref = fetcher_ref; fetcher->ref = fetcher_ref;
fetcher->callback = callback; fetcher->callback = callback;
fetcher->data = data; fetcher->data = data;
fetcher->delete = delete; fetcher->delete_ = delete_;
fetcher->download.callback = bittorrent_fetch_callback; fetcher->download.callback = bittorrent_fetch_callback;
fetcher->download.data = fetcher; fetcher->download.data = fetcher;

View File

@ -417,7 +417,7 @@ typedef void (*bittorrent_fetch_callback_T)(void *, struct connection_state,
struct bittorrent_fetcher * struct bittorrent_fetcher *
init_bittorrent_fetch(struct bittorrent_fetcher **fetcher_ref, init_bittorrent_fetch(struct bittorrent_fetcher **fetcher_ref,
struct uri *uri, bittorrent_fetch_callback_T callback, struct uri *uri, bittorrent_fetch_callback_T callback,
void *data, int delete); void *data, int delete_);
void done_bittorrent_fetch(struct bittorrent_fetcher **fetcher_ref); void done_bittorrent_fetch(struct bittorrent_fetcher **fetcher_ref);

View File

@ -299,9 +299,9 @@ user_protocol_handler(struct session *ses, struct uri *uri)
prog = subst_cmd(prog, uri, subj, filename); prog = subst_cmd(prog, uri, subj, filename);
mem_free_if(subj); mem_free_if(subj);
if (prog) { if (prog) {
unsigned char *delete = empty_string_or_(filename); unsigned char *delete_ = empty_string_or_(filename);
exec_on_terminal(ses->tab->term, prog, delete, TERM_EXEC_FG); exec_on_terminal(ses->tab->term, prog, delete_, TERM_EXEC_FG);
mem_free(prog); mem_free(prog);
} else if (filename) { } else if (filename) {

View File

@ -153,7 +153,7 @@ abort_download(struct file_download *file_download)
mem_free_if(file_download->external_handler); mem_free_if(file_download->external_handler);
if (file_download->file) { if (file_download->file) {
if (file_download->delete) unlink(file_download->file); if (file_download->delete_) unlink(file_download->file);
mem_free(file_download->file); mem_free(file_download->file);
} }
del_from_list(file_download); del_from_list(file_download);
@ -446,7 +446,7 @@ download_data_store(struct download *download, struct file_download *file_downlo
if (file_download->external_handler) { if (file_download->external_handler) {
if (term == NULL) { if (term == NULL) {
/* There is no terminal in which to run the handler. /* There is no terminal in which to run the handler.
* Abort the download. file_download->delete should * Abort the download. file_download->delete_ should
* be 1 here so that the following call also deletes * be 1 here so that the following call also deletes
* the temporary file. */ * the temporary file. */
abort_download(file_download); abort_download(file_download);
@ -460,14 +460,14 @@ download_data_store(struct download *download, struct file_download *file_downlo
exec_later(file_download->ses, exec_later(file_download->ses,
file_download->external_handler, file_download->file); file_download->external_handler, file_download->file);
/* Temporary file is deleted by the mailcap_protocol_handler */ /* Temporary file is deleted by the mailcap_protocol_handler */
file_download->delete = 0; file_download->delete_ = 0;
} else { } else {
exec_on_terminal(term, file_download->external_handler, exec_on_terminal(term, file_download->external_handler,
file_download->file, file_download->file,
file_download->block ? TERM_EXEC_FG : file_download->block ? TERM_EXEC_FG :
TERM_EXEC_BG); TERM_EXEC_BG);
} }
file_download->delete = 0; file_download->delete_ = 0;
abort_download_and_beep(file_download, term); abort_download_and_beep(file_download, term);
return; return;
} }
@ -1243,7 +1243,7 @@ continue_download_do(struct terminal *term, int fd, void *data,
if (type_query->external_handler) { if (type_query->external_handler) {
file_download->external_handler = subst_file(type_query->external_handler, file_download->external_handler = subst_file(type_query->external_handler,
codw_hop->file); codw_hop->file);
file_download->delete = 1; file_download->delete_ = 1;
file_download->copiousoutput = type_query->copiousoutput; file_download->copiousoutput = type_query->copiousoutput;
mem_free(codw_hop->file); mem_free(codw_hop->file);
mem_free_set(&type_query->external_handler, NULL); mem_free_set(&type_query->external_handler, NULL);

View File

@ -142,7 +142,7 @@ struct file_download {
struct download download; struct download download;
/** Should the file be deleted when destroying the structure */ /** Should the file be deleted when destroying the structure */
unsigned int delete:1; unsigned int delete_:1;
/** Should the download be stopped/interrupted when destroying the structure */ /** Should the download be stopped/interrupted when destroying the structure */
unsigned int stop:1; unsigned int stop:1;

View File

@ -568,7 +568,7 @@ static void
in_sock(struct itrm *itrm) in_sock(struct itrm *itrm)
{ {
struct string path; struct string path;
struct string delete; struct string delete_;
char ch; char ch;
int fg; /* enum term_exec */ int fg; /* enum term_exec */
ssize_t bytes_read, i, p; ssize_t bytes_read, i, p;
@ -614,7 +614,7 @@ has_nul_byte:
add_char_to_string(&path, ch); add_char_to_string(&path, ch);
} }
if (!init_string(&delete)) { if (!init_string(&delete_)) {
done_string(&path); done_string(&path);
goto free_and_return; goto free_and_return;
} }
@ -622,13 +622,13 @@ has_nul_byte:
while (1) { while (1) {
RD(ch); RD(ch);
if (!ch) break; if (!ch) break;
add_char_to_string(&delete, ch); add_char_to_string(&delete_, ch);
} }
#undef RD #undef RD
if (!*path.source) { if (!*path.source) {
dispatch_special(delete.source); dispatch_special(delete_.source);
} else { } else {
int blockh; int blockh;
@ -639,12 +639,12 @@ has_nul_byte:
* in a blocked terminal? There is similar code in * in a blocked terminal? There is similar code in
* exec_on_terminal(). --KON, 2007 */ * exec_on_terminal(). --KON, 2007 */
if (is_blocked() && fg != TERM_EXEC_BG) { if (is_blocked() && fg != TERM_EXEC_BG) {
if (*delete.source) unlink(delete.source); if (*delete_.source) unlink(delete_.source);
goto nasty_thing; goto nasty_thing;
} }
path_len = path.length; path_len = path.length;
del_len = delete.length; del_len = delete_.length;
param_len = path_len + del_len + 3; param_len = path_len + del_len + 3;
param = mem_alloc(param_len); param = mem_alloc(param_len);
@ -652,7 +652,7 @@ has_nul_byte:
param[0] = fg; param[0] = fg;
memcpy(param + 1, path.source, path_len + 1); memcpy(param + 1, path.source, path_len + 1);
memcpy(param + 1 + path_len + 1, delete.source, del_len + 1); memcpy(param + 1 + path_len + 1, delete_.source, del_len + 1);
if (fg == TERM_EXEC_FG) block_itrm(); if (fg == TERM_EXEC_FG) block_itrm();
@ -680,7 +680,7 @@ has_nul_byte:
nasty_thing: nasty_thing:
done_string(&path); done_string(&path);
done_string(&delete); done_string(&delete_);
assert(ITRM_OUT_QUEUE_SIZE - p > 0); assert(ITRM_OUT_QUEUE_SIZE - p > 0);
memmove(buf, buf + p, ITRM_OUT_QUEUE_SIZE - p); memmove(buf, buf + p, ITRM_OUT_QUEUE_SIZE - p);
bytes_read -= p; bytes_read -= p;

View File

@ -269,7 +269,7 @@ assert_terminal_ptr_not_dangling(const struct terminal *suspect)
static void static void
exec_on_master_terminal(struct terminal *term, exec_on_master_terminal(struct terminal *term,
unsigned char *path, int plen, unsigned char *path, int plen,
unsigned char *delete, int dlen, unsigned char *delete_, int dlen,
enum term_exec fg) enum term_exec fg)
{ {
int blockh; int blockh;
@ -280,7 +280,7 @@ exec_on_master_terminal(struct terminal *term,
param[0] = fg; param[0] = fg;
memcpy(param + 1, path, plen + 1); memcpy(param + 1, path, plen + 1);
memcpy(param + 1 + plen + 1, delete, dlen + 1); memcpy(param + 1 + plen + 1, delete_, dlen + 1);
if (fg == TERM_EXEC_FG) block_itrm(); if (fg == TERM_EXEC_FG) block_itrm();
@ -312,7 +312,7 @@ exec_on_master_terminal(struct terminal *term,
static void static void
exec_on_slave_terminal( struct terminal *term, exec_on_slave_terminal( struct terminal *term,
unsigned char *path, int plen, unsigned char *path, int plen,
unsigned char *delete, int dlen, unsigned char *delete_, int dlen,
enum term_exec fg) enum term_exec fg)
{ {
int data_size = plen + dlen + 1 /* 0 */ + 1 /* fg */ + 2 /* 2 null char */; int data_size = plen + dlen + 1 /* 0 */ + 1 /* fg */ + 2 /* 2 null char */;
@ -323,14 +323,14 @@ exec_on_slave_terminal( struct terminal *term,
data[0] = 0; data[0] = 0;
data[1] = fg; data[1] = fg;
memcpy(data + 2, path, plen + 1); memcpy(data + 2, path, plen + 1);
memcpy(data + 2 + plen + 1, delete, dlen + 1); memcpy(data + 2 + plen + 1, delete_, dlen + 1);
hard_write(term->fdout, data, data_size); hard_write(term->fdout, data, data_size);
fmem_free(data); fmem_free(data);
} }
void void
exec_on_terminal(struct terminal *term, unsigned char *path, exec_on_terminal(struct terminal *term, unsigned char *path,
unsigned char *delete, enum term_exec fg) unsigned char *delete_, enum term_exec fg)
{ {
if (path) { if (path) {
if (!*path) return; if (!*path) return;
@ -344,7 +344,7 @@ exec_on_terminal(struct terminal *term, unsigned char *path,
if (term->master) { if (term->master) {
if (!*path) { if (!*path) {
dispatch_special(delete); dispatch_special(delete_);
return; return;
} }
@ -352,18 +352,18 @@ exec_on_terminal(struct terminal *term, unsigned char *path,
* in a blocked terminal? There is similar code in * in a blocked terminal? There is similar code in
* in_sock(). --KON, 2007 */ * in_sock(). --KON, 2007 */
if (fg != TERM_EXEC_BG && is_blocked()) { if (fg != TERM_EXEC_BG && is_blocked()) {
unlink(delete); unlink(delete_);
return; return;
} }
exec_on_master_terminal(term, exec_on_master_terminal(term,
path, strlen(path), path, strlen(path),
delete, strlen(delete), delete_, strlen(delete_),
fg); fg);
} else { } else {
exec_on_slave_terminal( term, exec_on_slave_terminal( term,
path, strlen(path), path, strlen(path),
delete, strlen(delete), delete_, strlen(delete_),
fg); fg);
} }
} }