summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--UError.pas115
-rw-r--r--tuxcmd.dpr1
2 files changed, 116 insertions, 0 deletions
diff --git a/UError.pas b/UError.pas
new file mode 100644
index 0000000..cf722e3
--- /dev/null
+++ b/UError.pas
@@ -0,0 +1,115 @@
+(*
+ Tux Commander - UError - Error system functions
+ Copyright (C) 2009 Tomas Bzatek <tbzatek@users.sourceforge.net>
+ Check for updates on tuxcmd.sourceforge.net
+
+ 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.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*)
+unit UError;
+
+interface
+
+uses glib2, gdk2, Classes, ULibc;
+
+
+// Ported from gioerror.h
+
+type GIOErrorEnum = (G_IO_ERROR_FAILED,
+ G_IO_ERROR_NOT_FOUND,
+ G_IO_ERROR_EXISTS,
+ G_IO_ERROR_IS_DIRECTORY,
+ G_IO_ERROR_NOT_DIRECTORY,
+ G_IO_ERROR_NOT_EMPTY,
+ G_IO_ERROR_NOT_REGULAR_FILE,
+ G_IO_ERROR_NOT_SYMBOLIC_LINK,
+ G_IO_ERROR_NOT_MOUNTABLE_FILE,
+ G_IO_ERROR_FILENAME_TOO_LONG,
+ G_IO_ERROR_INVALID_FILENAME,
+ G_IO_ERROR_TOO_MANY_LINKS,
+ G_IO_ERROR_NO_SPACE,
+ G_IO_ERROR_INVALID_ARGUMENT,
+ G_IO_ERROR_PERMISSION_DENIED,
+ G_IO_ERROR_NOT_SUPPORTED,
+ G_IO_ERROR_NOT_MOUNTED,
+ G_IO_ERROR_ALREADY_MOUNTED,
+ G_IO_ERROR_CLOSED,
+ G_IO_ERROR_CANCELLED,
+ G_IO_ERROR_PENDING,
+ G_IO_ERROR_READ_ONLY,
+ G_IO_ERROR_CANT_CREATE_BACKUP,
+ G_IO_ERROR_WRONG_ETAG,
+ G_IO_ERROR_TIMED_OUT,
+ G_IO_ERROR_WOULD_RECURSE,
+ G_IO_ERROR_BUSY,
+ G_IO_ERROR_WOULD_BLOCK,
+ G_IO_ERROR_HOST_NOT_FOUND,
+ G_IO_ERROR_WOULD_MERGE,
+ G_IO_ERROR_FAILED_HANDLED,
+ G_IO_ERROR_TOO_MANY_OPEN_FILES,
+ G_IO_ERROR_NOT_INITIALIZED,
+ G_IO_ERROR_ADDRESS_IN_USE,
+ G_IO_ERROR_PARTIAL_INPUT,
+ G_IO_ERROR_INVALID_DATA);
+
+function g_io_error_quark: TGQuark;
+function G_IO_ERROR: TGQuark;
+
+function g_io_error_from_errno(err_no: gint): GIOErrorEnum;
+
+implementation
+
+uses SysUtils, UCoreUtils, UGnome;
+
+(********************************************************************************************************************************)
+
+function g_io_error_quark: TGQuark;
+begin
+ Result := g_quark_from_static_string('g-io-error-quark');
+end;
+
+function G_IO_ERROR: TGQuark;
+begin
+ Result := g_io_error_quark;
+end;
+
+function g_io_error_from_errno(err_no: gint): GIOErrorEnum;
+begin
+ case err_no of
+ EEXIST: Result := G_IO_ERROR_EXISTS;
+ EISDIR: Result := G_IO_ERROR_IS_DIRECTORY;
+ EACCES: Result := G_IO_ERROR_PERMISSION_DENIED;
+ ENAMETOOLONG: Result := G_IO_ERROR_FILENAME_TOO_LONG;
+ ENOENT: Result := G_IO_ERROR_NOT_FOUND;
+ ENOTDIR: Result := G_IO_ERROR_NOT_DIRECTORY;
+ EROFS: Result := G_IO_ERROR_READ_ONLY;
+ ELOOP: Result := G_IO_ERROR_TOO_MANY_LINKS;
+ ENOSPC: Result := G_IO_ERROR_NO_SPACE;
+ ENOMEM: Result := G_IO_ERROR_NO_SPACE;
+ EINVAL: Result := G_IO_ERROR_INVALID_ARGUMENT;
+ EPERM: Result := G_IO_ERROR_PERMISSION_DENIED;
+ ECANCELED: Result := G_IO_ERROR_CANCELLED;
+ ENOTEMPTY: Result := G_IO_ERROR_NOT_EMPTY;
+ ENOTSUP: Result := G_IO_ERROR_NOT_SUPPORTED;
+ ETIMEDOUT: Result := G_IO_ERROR_TIMED_OUT;
+ EBUSY: Result := G_IO_ERROR_BUSY;
+ EAGAIN: Result := G_IO_ERROR_WOULD_BLOCK;
+ EMFILE: Result := G_IO_ERROR_TOO_MANY_OPEN_FILES;
+ EADDRINUSE: Result := G_IO_ERROR_ADDRESS_IN_USE;
+ else Result := G_IO_ERROR_FAILED;
+ end;
+end;
+
+end.
+
diff --git a/tuxcmd.dpr b/tuxcmd.dpr
index b613d20..bae66d6 100644
--- a/tuxcmd.dpr
+++ b/tuxcmd.dpr
@@ -63,6 +63,7 @@ uses
URunFromVFS in 'URunFromVFS.pas',
ULibc in 'ULibc.pas',
UQuickConnect in 'UQuickConnect.pas',
+ UError in 'UError.pas',
UTranslation_EN in 'translations/UTranslation_EN.pas',
UTranslation_CZ in 'translations/UTranslation_CZ.pas',
UTranslation_RU in 'translations/UTranslation_RU.pas',