summaryrefslogtreecommitdiff
path: root/src/warning.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2014-03-11 16:41:11 -0700
committerRussell Belfer <rb@github.com>2014-03-11 16:41:11 -0700
commit680f306d361609a818e8d9ebb382286be084263c (patch)
tree35095a63ca4686f8213e9793b5071ff1dd928bb6 /src/warning.h
parent676a34a33d9ef18163c3a33bac60083de471144f (diff)
downloadlibgit2-680f306d361609a818e8d9ebb382286be084263c.tar.gz
Warnings that default to being errorsrb/warnings-for-commit-headers
This is a try at extending the warning API to include warnings that would be errors unless the user callback decides to demote them to warnings. This allows for relaxed parsing logic that will default to strict behavior but can continue if possible.
Diffstat (limited to 'src/warning.h')
-rw-r--r--src/warning.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/warning.h b/src/warning.h
index 6d25783f4..8c14e2869 100644
--- a/src/warning.h
+++ b/src/warning.h
@@ -10,13 +10,26 @@
#include "common.h"
#include "git2/sys/warning.h"
+/**
+ * Use this to raise a warning
+ *
+ * @param warning A git_warning_t code from include/git2/sys/warning.h
+ * @param default_rval Default return value (i.e. error code or zero)
+ * @param fmt Printf-style format string for warning message
+ * @return 0 to continue, less than 0 to raise error
+ */
int git_warn(
git_warning_t warning,
+ int default_rval,
const char *fmt,
...);
+/**
+ * Raise a warning about invalid data, via a git_warning_invalid_data struct
+ */
int git_warn_invalid_data(
git_warning_t warning,
+ int default_rval,
const char *data,
int datalen,
const char *fmt,