Skip to content

Commit

Permalink
Use error constants
Browse files Browse the repository at this point in the history
  • Loading branch information
emboss committed Nov 29, 2012
1 parent 39f8af4 commit edad7f4
Show file tree
Hide file tree
Showing 24 changed files with 613 additions and 608 deletions.
8 changes: 3 additions & 5 deletions ext/krypt/core/binyo-error.h
Expand Up @@ -12,15 +12,13 @@
#define _BINYO_ERROR_H_

#define BINYO_OK 1
#define BINYO_ERR 0
#define BINYO_ERR -1

#define BINYO_IO_READ_ERR -2
#define BINYO_IO_READ_EOF -1

#define BINYO_IO_WRITE_ERR -1
#define BINYO_IO_EOF -2

int binyo_has_errors(void);
int binyo_error_message(char *buf, int buf_len);
void binyo_error_clear(void);

#endif /* BINYO_ERROR_H */

8 changes: 8 additions & 0 deletions ext/krypt/core/krypt-provider.h
Expand Up @@ -24,6 +24,13 @@

#include <ruby.h>

#ifndef KRYPT_OK
#define KRYPT_OK 1
#endif
#ifndef KRYPT_ERR
#define KRYPT_ERR -1
#endif

typedef struct krypt_provider_st krypt_provider;

/* Message digest */
Expand Down Expand Up @@ -60,3 +67,4 @@ void krypt_error_add(const char * format, ...);
void krypt_provider_register(krypt_provider *provider);

#endif /* _KRYPT_PROVIDER_H_ */

0 comments on commit edad7f4

Please sign in to comment.