1 /* File operation contexts for the Midnight Commander
3 * Copyright (C) 1998 The Free Software Foundation
5 * Authors: Federico Mena <federico@nuclecu.unam.mx>
6 * Miguel de Icaza <miguel@nuclecu.unam.mx>
13 #include "fileopctx.h"
14 #include "../vfs/vfs.h"
18 * file_op_context_new:
20 * Creates a new file operation context with the default values. If you later want
21 * to have a user interface for this, call #file_op_context_create_ui().
23 * Return value: The newly-created context, filled with the default file mask values.
26 file_op_context_new (void)
30 ctx
= g_new0 (FileOpContext
, 1);
32 ctx
->progress_bytes
= 0.0;
33 ctx
->op_preserve
= TRUE
;
35 ctx
->stat_func
= (mc_stat_fn
) mc_lstat
;
37 ctx
->preserve_uidgid
= (geteuid () == 0) ? TRUE
: FALSE
;
38 ctx
->umask_kill
= 0777777;
39 ctx
->erase_at_end
= TRUE
;
46 * file_op_context_destroy:
47 * @ctx: The file operation context to destroy.
49 * Destroys the specified file operation context and its associated UI data, if
53 file_op_context_destroy (FileOpContext
*ctx
)
55 g_return_if_fail (ctx
!= NULL
);
58 file_op_context_destroy_ui (ctx
);
60 /* FIXME: do we need to free ctx->dest_mask? */