Index: sp.c =================================================================== RCS file: /storage/cvsroot/spread/daemon/sp.c,v retrieving revision 1.14 diff -u -r1.14 sp.c --- sp.c 5 Oct 2004 14:08:10 -0000 1.14 +++ sp.c 4 Dec 2004 05:15:11 -0000 @@ -1569,6 +1569,67 @@ } return( -1 ); } + +const char *SP_get_error_string( int error ) { + const char *error_string = NULL; + + switch( error ) + { + case ILLEGAL_SPREAD: + error_string = "SP_error: (-1) Illegal spread was provided\n"; + break; + case COULD_NOT_CONNECT: + error_string = "SP_error: (-2) Could not connect. Is Spread running?\n"; + break; + case REJECT_QUOTA: + error_string = "SP_error: (-3) Connection rejected, to many users\n"; + break; + case REJECT_NO_NAME: + error_string = "SP_error: (-4) Connection rejected, no name was supplied\n"; + break; + case REJECT_ILLEGAL_NAME: + error_string = "SP_error: (-5) Connection rejected, illegal name\n"; + break; + case REJECT_NOT_UNIQUE: + error_string = "SP_error: (-6) Connection rejected, name not unique\n"; + break; + case REJECT_VERSION: + error_string = "SP_error: (-7) Connection rejected, library does not fit daemon\n"; + break; + case CONNECTION_CLOSED: + error_string = "SP_error: (-8) Connection closed by spread\n"; + break; + case REJECT_AUTH: + error_string = "SP_error: (-9) Connection rejected, authentication failed\n"; + break; + case ILLEGAL_SESSION: + error_string = "SP_error: (%-11) Illegal session was supplied\n"; + break; + case ILLEGAL_SERVICE: + error_string = "SP_error: (-12) Illegal service request\n"; + break; + case ILLEGAL_MESSAGE: + error_string = "SP_error: (-13) Illegal message\n"; + break; + case ILLEGAL_GROUP: + error_string = "SP_error: (-14) Illegal group\n"; + break; + case BUFFER_TOO_SHORT: + error_string = "SP_error: (-15) The supplied buffer was too short\n"; + break; + case GROUPS_TOO_SHORT: + error_string = "SP_error: (-16) The supplied groups list was too short\n"; + break; + case MESSAGE_TOO_LONG: + error_string = "SP_error: (-17) The message body + group names was too large to fit in a message\n"; + break; + default: + error_string = "SP_error: unrecognized error\n"; + break; + } + return error_string; +} + void SP_error( int error ) { switch( error ) Index: sp_func.h =================================================================== RCS file: /storage/cvsroot/spread/daemon/sp_func.h,v retrieving revision 1.5 diff -u -r1.5 sp_func.h --- sp_func.h 5 Mar 2004 00:32:46 -0000 1.5 +++ sp_func.h 4 Dec 2004 05:15:11 -0000 @@ -98,4 +98,6 @@ int SP_equal_group_ids( group_id g1, group_id g2 ); +const char *SP_get_error_string( int error ); + void SP_error( int error );