pi-error.h

Go to the documentation of this file.
00001 /*
00002  * $Id: pi-error.h,v 1.11 2006-10-17 13:24:07 desrod Exp $
00003  *
00004  * pi-error.h:  definitions for errors returned by the SOCKET, DLP and
00005  *              FILE layers
00006  *
00007  * Copyright (c) 2004-2005, Florent Pillet.
00008  *
00009  * This library is free software; you can redistribute it and/or modify it
00010  * under the terms of the GNU Library General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or (at
00012  * your option) any later version.
00013  *
00014  * This library is distributed in the hope that it will be useful, but
00015  * WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library
00017  * General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU Library General Public License
00020  * along with this library; if not, write to the Free Software Foundation,
00021  * * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 
00022  */
00023  
00024 #ifndef _PILOT_ERROR_H_
00025 #define _PILOT_ERROR_H_
00026 
00048 typedef int PI_ERR;
00049 
00051 enum dlpErrorDefinitions {
00052         /* PROTOCOL level errors */
00053         PI_ERR_PROT_ABORTED             = -100, 
00054         PI_ERR_PROT_INCOMPATIBLE        = -101, 
00055         PI_ERR_PROT_BADPACKET           = -102, 
00057         /* SOCKET level errors */
00058         PI_ERR_SOCK_DISCONNECTED        = -200, 
00059         PI_ERR_SOCK_INVALID             = -201, 
00060         PI_ERR_SOCK_TIMEOUT             = -202, 
00061         PI_ERR_SOCK_CANCELED            = -203, 
00062         PI_ERR_SOCK_IO                  = -204, 
00063         PI_ERR_SOCK_LISTENER            = -205, 
00065         /* DLP level errors */
00066         PI_ERR_DLP_BUFSIZE              = -300, 
00067         PI_ERR_DLP_PALMOS               = -301, 
00068         PI_ERR_DLP_UNSUPPORTED          = -302, 
00069         PI_ERR_DLP_SOCKET               = -303, 
00070         PI_ERR_DLP_DATASIZE             = -304, 
00071         PI_ERR_DLP_COMMAND              = -305, 
00073         /* FILE level error */
00074         PI_ERR_FILE_INVALID             = -400, 
00075         PI_ERR_FILE_ERROR               = -401, 
00076         PI_ERR_FILE_ABORTED             = -402, 
00077         PI_ERR_FILE_NOT_FOUND           = -403, 
00078         PI_ERR_FILE_ALREADY_EXISTS      = -404, 
00080         /* GENERIC errors */
00081         PI_ERR_GENERIC_MEMORY           = -500, 
00082         PI_ERR_GENERIC_ARGUMENT         = -501, 
00083         PI_ERR_GENERIC_SYSTEM           = -502  
00084 };
00085 
00088         #define IS_PROT_ERR(error)      ((error)<=-100 && (error)>-200) 
00089         #define IS_SOCK_ERR(error)      ((error)<=-200 && (error)>-300) 
00090         #define IS_DLP_ERR(error)       ((error)<=-300 && (error)>-400) 
00091         #define IS_FILE_ERR(error)      ((error)<=-400 && (error)>-500) 
00092         #define IS_GENERIC_ERR(error)   ((error)<=-500 && (error)>-600) 
00094 
00095 #endif

© 1996-2007 by pilot-link.org. All rights reserved.