mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
delete -> delete_ for C++ compatibility
This commit is contained in:
parent
67673f5fe5
commit
8cf00fa61c
@ -661,7 +661,7 @@ do_delete_item(struct listbox_item *item, struct listbox_context *info,
|
||||
return;
|
||||
}
|
||||
|
||||
ops->delete(item, last);
|
||||
ops->delete_(item, last);
|
||||
}
|
||||
|
||||
static int
|
||||
@ -723,14 +723,14 @@ query_delete_selected_item(void *context_)
|
||||
const struct listbox_ops *ops = box->ops;
|
||||
struct listbox_item *item = box->sel;
|
||||
unsigned char *text;
|
||||
enum delete_error delete;
|
||||
enum delete_error delete_;
|
||||
|
||||
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)) {
|
||||
print_delete_error(item, term, ops, delete);
|
||||
if (delete_ == DELETE_IMPOSSIBLE || ops->is_used(item)) {
|
||||
print_delete_error(item, term, ops, delete_);
|
||||
return EVENT_PROCESSED;
|
||||
}
|
||||
|
||||
@ -791,7 +791,7 @@ push_hierbox_delete_button(struct dialog_data *dlg_data,
|
||||
|
||||
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);
|
||||
if (!context) return EVENT_PROCESSED;
|
||||
|
@ -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);
|
||||
if (box->ops
|
||||
&& box->ops->delete
|
||||
&& box->ops->delete_
|
||||
&& box->ops->can_delete)
|
||||
push_hierbox_delete_button(dlg_data,
|
||||
widget_data);
|
||||
|
@ -85,7 +85,7 @@ struct listbox_ops {
|
||||
/* Delete the listbox item object, its data and all nested listboxes.
|
||||
* @last is non zero when either deleting only one item or when
|
||||
* 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
|
||||
* listbox item text and what might else be possible on the screen on
|
||||
|
@ -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;
|
||||
|
||||
file_download->delete = 1;
|
||||
file_download->delete_ = 1;
|
||||
#if CONFIG_BITTORRENT
|
||||
if (file_download->uri->protocol == PROTOCOL_BITTORRENT)
|
||||
set_bittorrent_files_for_deletion(&file_download->download);
|
||||
|
@ -316,7 +316,7 @@ struct bittorrent_fetcher {
|
||||
bittorrent_fetch_callback_T callback;
|
||||
void *data;
|
||||
int redirects;
|
||||
unsigned int delete:1;
|
||||
unsigned int delete_:1;
|
||||
struct download download;
|
||||
};
|
||||
|
||||
@ -384,7 +384,7 @@ bittorrent_fetch_callback(struct download *download, void *data)
|
||||
|
||||
fetcher->callback(fetcher->data, connection_state(S_OK), &response);
|
||||
|
||||
if (fetcher->delete)
|
||||
if (fetcher->delete_)
|
||||
delete_cache_entry(cached);
|
||||
if (fetcher->ref)
|
||||
*fetcher->ref = NULL;
|
||||
@ -394,7 +394,7 @@ bittorrent_fetch_callback(struct download *download, void *data)
|
||||
struct bittorrent_fetcher *
|
||||
init_bittorrent_fetch(struct bittorrent_fetcher **fetcher_ref,
|
||||
struct uri *uri, bittorrent_fetch_callback_T callback,
|
||||
void *data, int delete)
|
||||
void *data, int delete_)
|
||||
{
|
||||
struct bittorrent_fetcher *fetcher;
|
||||
|
||||
@ -410,7 +410,7 @@ init_bittorrent_fetch(struct bittorrent_fetcher **fetcher_ref,
|
||||
fetcher->ref = fetcher_ref;
|
||||
fetcher->callback = callback;
|
||||
fetcher->data = data;
|
||||
fetcher->delete = delete;
|
||||
fetcher->delete_ = delete_;
|
||||
fetcher->download.callback = bittorrent_fetch_callback;
|
||||
fetcher->download.data = fetcher;
|
||||
|
||||
|
@ -417,7 +417,7 @@ typedef void (*bittorrent_fetch_callback_T)(void *, struct connection_state,
|
||||
struct bittorrent_fetcher *
|
||||
init_bittorrent_fetch(struct bittorrent_fetcher **fetcher_ref,
|
||||
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);
|
||||
|
||||
|
||||
|
@ -299,9 +299,9 @@ user_protocol_handler(struct session *ses, struct uri *uri)
|
||||
prog = subst_cmd(prog, uri, subj, filename);
|
||||
mem_free_if(subj);
|
||||
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);
|
||||
|
||||
} else if (filename) {
|
||||
|
@ -153,7 +153,7 @@ abort_download(struct file_download *file_download)
|
||||
|
||||
mem_free_if(file_download->external_handler);
|
||||
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);
|
||||
}
|
||||
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 (term == NULL) {
|
||||
/* 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
|
||||
* the temporary file. */
|
||||
abort_download(file_download);
|
||||
@ -460,14 +460,14 @@ download_data_store(struct download *download, struct file_download *file_downlo
|
||||
exec_later(file_download->ses,
|
||||
file_download->external_handler, file_download->file);
|
||||
/* Temporary file is deleted by the mailcap_protocol_handler */
|
||||
file_download->delete = 0;
|
||||
file_download->delete_ = 0;
|
||||
} else {
|
||||
exec_on_terminal(term, file_download->external_handler,
|
||||
file_download->file,
|
||||
file_download->block ? TERM_EXEC_FG :
|
||||
TERM_EXEC_BG);
|
||||
}
|
||||
file_download->delete = 0;
|
||||
file_download->delete_ = 0;
|
||||
abort_download_and_beep(file_download, term);
|
||||
return;
|
||||
}
|
||||
@ -1243,7 +1243,7 @@ continue_download_do(struct terminal *term, int fd, void *data,
|
||||
if (type_query->external_handler) {
|
||||
file_download->external_handler = subst_file(type_query->external_handler,
|
||||
codw_hop->file);
|
||||
file_download->delete = 1;
|
||||
file_download->delete_ = 1;
|
||||
file_download->copiousoutput = type_query->copiousoutput;
|
||||
mem_free(codw_hop->file);
|
||||
mem_free_set(&type_query->external_handler, NULL);
|
||||
|
@ -142,7 +142,7 @@ struct file_download {
|
||||
struct download download;
|
||||
|
||||
/** 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 */
|
||||
unsigned int stop:1;
|
||||
|
@ -568,7 +568,7 @@ static void
|
||||
in_sock(struct itrm *itrm)
|
||||
{
|
||||
struct string path;
|
||||
struct string delete;
|
||||
struct string delete_;
|
||||
char ch;
|
||||
int fg; /* enum term_exec */
|
||||
ssize_t bytes_read, i, p;
|
||||
@ -614,7 +614,7 @@ has_nul_byte:
|
||||
add_char_to_string(&path, ch);
|
||||
}
|
||||
|
||||
if (!init_string(&delete)) {
|
||||
if (!init_string(&delete_)) {
|
||||
done_string(&path);
|
||||
goto free_and_return;
|
||||
}
|
||||
@ -622,13 +622,13 @@ has_nul_byte:
|
||||
while (1) {
|
||||
RD(ch);
|
||||
if (!ch) break;
|
||||
add_char_to_string(&delete, ch);
|
||||
add_char_to_string(&delete_, ch);
|
||||
}
|
||||
|
||||
#undef RD
|
||||
|
||||
if (!*path.source) {
|
||||
dispatch_special(delete.source);
|
||||
dispatch_special(delete_.source);
|
||||
|
||||
} else {
|
||||
int blockh;
|
||||
@ -639,12 +639,12 @@ has_nul_byte:
|
||||
* in a blocked terminal? There is similar code in
|
||||
* exec_on_terminal(). --KON, 2007 */
|
||||
if (is_blocked() && fg != TERM_EXEC_BG) {
|
||||
if (*delete.source) unlink(delete.source);
|
||||
if (*delete_.source) unlink(delete_.source);
|
||||
goto nasty_thing;
|
||||
}
|
||||
|
||||
path_len = path.length;
|
||||
del_len = delete.length;
|
||||
del_len = delete_.length;
|
||||
param_len = path_len + del_len + 3;
|
||||
|
||||
param = mem_alloc(param_len);
|
||||
@ -652,7 +652,7 @@ has_nul_byte:
|
||||
|
||||
param[0] = fg;
|
||||
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();
|
||||
|
||||
@ -680,7 +680,7 @@ has_nul_byte:
|
||||
|
||||
nasty_thing:
|
||||
done_string(&path);
|
||||
done_string(&delete);
|
||||
done_string(&delete_);
|
||||
assert(ITRM_OUT_QUEUE_SIZE - p > 0);
|
||||
memmove(buf, buf + p, ITRM_OUT_QUEUE_SIZE - p);
|
||||
bytes_read -= p;
|
||||
|
@ -269,7 +269,7 @@ assert_terminal_ptr_not_dangling(const struct terminal *suspect)
|
||||
static void
|
||||
exec_on_master_terminal(struct terminal *term,
|
||||
unsigned char *path, int plen,
|
||||
unsigned char *delete, int dlen,
|
||||
unsigned char *delete_, int dlen,
|
||||
enum term_exec fg)
|
||||
{
|
||||
int blockh;
|
||||
@ -280,7 +280,7 @@ exec_on_master_terminal(struct terminal *term,
|
||||
|
||||
param[0] = fg;
|
||||
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();
|
||||
|
||||
@ -312,7 +312,7 @@ exec_on_master_terminal(struct terminal *term,
|
||||
static void
|
||||
exec_on_slave_terminal( struct terminal *term,
|
||||
unsigned char *path, int plen,
|
||||
unsigned char *delete, int dlen,
|
||||
unsigned char *delete_, int dlen,
|
||||
enum term_exec fg)
|
||||
{
|
||||
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[1] = fg;
|
||||
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);
|
||||
fmem_free(data);
|
||||
}
|
||||
|
||||
void
|
||||
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) return;
|
||||
@ -344,7 +344,7 @@ exec_on_terminal(struct terminal *term, unsigned char *path,
|
||||
|
||||
if (term->master) {
|
||||
if (!*path) {
|
||||
dispatch_special(delete);
|
||||
dispatch_special(delete_);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -352,18 +352,18 @@ exec_on_terminal(struct terminal *term, unsigned char *path,
|
||||
* in a blocked terminal? There is similar code in
|
||||
* in_sock(). --KON, 2007 */
|
||||
if (fg != TERM_EXEC_BG && is_blocked()) {
|
||||
unlink(delete);
|
||||
unlink(delete_);
|
||||
return;
|
||||
}
|
||||
|
||||
exec_on_master_terminal(term,
|
||||
path, strlen(path),
|
||||
delete, strlen(delete),
|
||||
delete_, strlen(delete_),
|
||||
fg);
|
||||
} else {
|
||||
exec_on_slave_terminal( term,
|
||||
path, strlen(path),
|
||||
delete, strlen(delete),
|
||||
delete_, strlen(delete_),
|
||||
fg);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user