Skip to content

Commit

Permalink
Added GPGMakeErrorFromSystemError() and GPGErrorMissingErrno
Browse files Browse the repository at this point in the history
git-svn-id: http://macgpg.svn.sourceforge.net/svnroot/macgpg/GPGME/trunk@1875 c19e94ca-3d1d-0410-add0-bf5d5e3bda8e
  • Loading branch information
davelopper committed Nov 7, 2008
1 parent 386a9f5 commit 50e54ba
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
15 changes: 14 additions & 1 deletion GPGExceptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ typedef enum {
GPGErrorUser15 = 1038,
GPGErrorUser16 = 1039,

GPGErrorMissingErrno = 16381,
GPGErrorUnknownErrno = 16382,
GPGErrorEOF = 16383,

Expand Down Expand Up @@ -693,13 +694,25 @@ GPG_EXPORT GPGError GPGMakeError(GPGErrorSource src, GPGErrorCode cde);
* @discussion The function GPGMakeErrorFromErrno is like
* <code>@link GPGMakeError GPGMakeError@/link</code>,
* but it takes a system error like <code>errno</code> instead of a
* <code>@link //macgpg/c/tdef/GPGErrorCode GPGErrorCode@/link</code>
* <code>@link //macgpg/c/tdef/GPGErrorCode GPGErrorCode@/link</code>
* error code.
* @param src The error source
* @param cde The system error code
*/
GPG_EXPORT GPGError GPGMakeErrorFromErrno(GPGErrorSource src, int cde);

/*!
* @function GPGMakeErrorFromSystemError
* @abstract Returns the error value consisting of the default error source
* and the latest system error (<code>errno</code>).
* @discussion Retrieves the error code directly from the <code>errno</code>
* variable. This returns <code>GPGErrorUnknownErrno</code> as
* error code if the system error is not mapped and
* <code>GPGErrorMissingErrno</code> if <code>errno</code> has the
* value 0.
*/
GPG_EXPORT GPGError GPGMakeErrorFromSystemError();

/*!
* @constant GPGException
* @abstract Name of exceptions specific to MacGPGME framework.
Expand Down
5 changes: 5 additions & 0 deletions GPGExceptions.m
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ GPGError GPGMakeErrorFromErrno(GPGErrorSource src, int cde)
return gpgme_err_make_from_errno(src, cde);
}

GPGError GPGMakeErrorFromSystemError()
{
return gpg_error_from_syserror();
}

NSString *GPGErrorDescription(GPGError error)
{
const size_t bufferIncrement = 128;
Expand Down

0 comments on commit 50e54ba

Please sign in to comment.