Navigation Menu

Skip to content

Commit

Permalink
grn_ts: add macros for error handling and debugging
Browse files Browse the repository at this point in the history
GitHub: #412
  • Loading branch information
s-yata committed Oct 5, 2015
1 parent 028b302 commit 486f4d0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/ts.c
Expand Up @@ -43,6 +43,20 @@

enum { GRN_TS_BATCH_SIZE = 1024 };

/* GRN_TS_DEBUG() logs a message that is useful for debug. */
#define GRN_TS_DEBUG(...) GRN_LOG(ctx, GRN_LOG_DEBUG, __VA_ARGS__)

/* GRN_TS_WARN() logs a warning. */
#define GRN_TS_WARN(rc, ...) WARN(rc, __VA_ARGS__)

/* GRN_TS_ERR() reports an error. */
#define GRN_TS_ERR(rc, ...) ERR(rc, __VA_ARGS__)
/* GRN_TS_ERR_RETURN() reports an error and returns its error code. */
#define GRN_TS_ERR_RETURN(rc, ...) do {\
GRN_TS_ERR(rc, __VA_ARGS__);\
return rc;\
} while (GRN_FALSE)

/*-------------------------------------------------------------
* grn_ts_str.
*/
Expand Down

0 comments on commit 486f4d0

Please sign in to comment.