• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

ut_go_file.h

Go to the documentation of this file.
00001 /*
00002  * go-file.h :
00003  *
00004  * Copyright (C) 2004 Morten Welinder (terra@gnome.org)
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00019  * 02110-1301 USA.
00020  */
00021 #ifndef UT_GO_FILE_H
00022 #define UT_GO_FILE_H
00023 
00024 /* pre-emptive dismissal; ut_types.h is needed by just about everything,
00025  * so even if it's commented out in-file that's still a lot of work for
00026  * the preprocessor to do...
00027  */
00028 #ifndef UT_TYPES_H
00029 #include "ut_types.h"
00030 #endif
00031 
00032 #include "ut_compiler.h"
00033 ABI_W_NO_CONST_QUAL
00034 #include <glib.h>
00035 #include <gsf/gsf.h>
00036 ABI_W_POP
00037 #include <time.h>
00038 
00039 G_BEGIN_DECLS
00040 
00041 typedef struct _UT_GOFilePermissions UT_GOFilePermissions;
00042 
00043 struct _UT_GOFilePermissions {
00044     gboolean owner_read;
00045     gboolean owner_write;
00046     gboolean owner_execute;
00047 
00048     gboolean group_read;
00049     gboolean group_write;
00050     gboolean group_execute;
00051 
00052     gboolean others_read;
00053     gboolean others_write;
00054     gboolean others_execute;
00055 };
00056 
00057 enum UT_GODotDot {
00058     UT_GO_DOTDOT_SYNTACTIC,    /* Assume no symlinks.  */
00059     UT_GO_DOTDOT_TEST,         /* Check.  */
00060     UT_GO_DOTDOT_LEAVE         /* Leave alone.  */
00061 };
00062 
00063 ABI_EXPORT gboolean UT_go_path_is_uri (const char * path);
00064 ABI_EXPORT gboolean UT_go_path_is_path (const char * path);
00065 
00066 ABI_EXPORT char *UT_go_filename_simplify (const char *filename, UT_GODotDot dotdot, gboolean make_absolute);
00067 ABI_EXPORT char *UT_go_url_simplify (const char *uri);
00068 
00069 ABI_EXPORT char *UT_go_filename_from_uri (const char *uri);
00070 ABI_EXPORT char *UT_go_filename_to_uri (const char *filename);
00071 
00072 ABI_EXPORT char *UT_go_url_resolve_relative (const char *ref_uri, const char *rel_uri);
00073 ABI_EXPORT char *UT_go_url_make_relative (const char *uri, const char *ref_uri);
00074 
00075 ABI_EXPORT char *UT_go_shell_arg_to_uri (const char *arg);
00076 ABI_EXPORT char *UT_go_basename_from_uri (const char *uri);
00077 ABI_EXPORT char *UT_go_dirname_from_uri (const char *uri, gboolean brief);
00078 ABI_EXPORT gboolean UT_go_directory_create (char const *uri, GError **err);
00079 
00080 ABI_EXPORT GsfInput  *UT_go_file_open       (char const *uri, GError **err);
00081 ABI_EXPORT GsfOutput *UT_go_file_create (char const *uri, GError **err);
00082 
00083 ABI_EXPORT gboolean UT_go_file_remove (char const *uri, GError **err);
00084 
00085 ABI_EXPORT gboolean UT_go_file_exists (char const *uri);
00086 
00087 ABI_EXPORT UT_GOFilePermissions *UT_go_get_file_permissions (char const *uri);
00088 ABI_EXPORT void UT_go_set_file_permissions (char const *uri, UT_GOFilePermissions * file_permissions);
00089 
00090 ABI_EXPORT time_t UT_go_file_get_date_accessed (char const *uri);
00091 ABI_EXPORT time_t UT_go_file_get_date_modified (char const *uri);
00092 ABI_EXPORT time_t UT_go_file_get_date_changed  (char const *uri);
00093 
00094 ABI_EXPORT GError   *UT_go_url_show     (gchar const *url);
00095 ABI_EXPORT gchar    *UT_go_get_mime_type    (gchar const *uri);
00096 
00097 ABI_EXPORT gint UT_go_utf8_collate_casefold (const char *a, const char *b);
00098 
00099 G_END_DECLS
00100 
00101 #endif /* UT_GO_FILE_H */
00102 //#endif
00103 

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1