Just a little correction at the it.po file.
[midnight-commander.git] / src / fileopctx.c
blob2cd6aa98e6b41ae0a9da4e03d7482fbb00a37d99
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>
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 #include <config.h>
24 #include <unistd.h>
26 #include "global.h"
27 #include "fileopctx.h"
28 #include "../vfs/vfs.h"
31 /**
32 * file_op_context_new:
34 * Creates a new file operation context with the default values. If you later want
35 * to have a user interface for this, call #file_op_context_create_ui().
37 * Return value: The newly-created context, filled with the default file mask values.
38 **/
39 FileOpContext *
40 file_op_context_new (void)
42 FileOpContext *ctx;
44 ctx = g_new0 (FileOpContext, 1);
45 ctx->eta_secs = 0.0;
46 ctx->progress_bytes = 0.0;
47 ctx->op_preserve = TRUE;
48 ctx->do_reget = TRUE;
49 ctx->stat_func = (mc_stat_fn) mc_lstat;
50 ctx->preserve = TRUE;
51 ctx->preserve_uidgid = (geteuid () == 0) ? TRUE : FALSE;
52 ctx->umask_kill = 0777777;
53 ctx->erase_at_end = TRUE;
55 return ctx;
59 /**
60 * file_op_context_destroy:
61 * @ctx: The file operation context to destroy.
63 * Destroys the specified file operation context and its associated UI data, if
64 * it exists.
65 **/
66 void
67 file_op_context_destroy (FileOpContext *ctx)
69 g_return_if_fail (ctx != NULL);
71 if (ctx->ui)
72 file_op_context_destroy_ui (ctx);
74 regfree (&ctx->rx);
76 /* FIXME: do we need to free ctx->dest_mask? */
78 g_free (ctx);