medit/moo/mooutils/mooutils-fs.h

69 lines
2.3 KiB
C
Raw Normal View History

/*
* mooutils-fs.h
*
* Copyright (C) 2004-2006 by Yevgen Muntyan <muntyan@math.tamu.edu>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* See COPYING file that comes with this distribution.
*/
#ifndef __MOO_UTILS_FS_H__
#define __MOO_UTILS_FS_H__
#include <glib.h>
G_BEGIN_DECLS
2006-04-16 10:14:12 -07:00
#define MOO_FILE_ERROR (moo_file_error_quark ())
typedef enum
{
MOO_FILE_ERROR_NONEXISTENT,
MOO_FILE_ERROR_NOT_FOLDER,
MOO_FILE_ERROR_BAD_FILENAME,
MOO_FILE_ERROR_FAILED,
MOO_FILE_ERROR_ALREADY_EXISTS,
MOO_FILE_ERROR_ACCESS_DENIED,
MOO_FILE_ERROR_READONLY,
MOO_FILE_ERROR_DIFFERENT_FS,
MOO_FILE_ERROR_NOT_IMPLEMENTED
} MooFileError;
GQuark moo_file_error_quark (void) G_GNUC_CONST;
MooFileError moo_file_error_from_errno (int err_code);
gboolean moo_save_file_utf8 (const char *name,
const char *text,
gssize len,
GError **error);
2006-04-16 10:14:12 -07:00
gboolean moo_rmdir (const char *path,
gboolean recursive,
GError **error);
gboolean moo_mkdir (const char *path,
2006-04-09 02:01:14 -07:00
GError **error);
2006-04-16 10:14:12 -07:00
char **moo_filenames_from_locale (char **files);
2006-03-16 12:01:15 -08:00
/*
* C library and WinAPI functions wrappers analogous to glib/gstdio.h
*/
2006-04-16 10:14:12 -07:00
int m_unlink (const char *path);
int m_mkdir (const char *path); /* S_IRWXU on unix */
int m_rmdir (const char *path);
int m_remove (const char *path);
gpointer m_fopen (const char *path,
const char *mode);
2006-04-16 10:14:12 -07:00
int m_rename (const char *old_name,
const char *new_name);
G_END_DECLS
#endif /* __MOO_UTILS_FS_H__ */