]> granicus.if.org Git - yasm/commitdiff
errwarn.c (yasm_warn_occurred): New, warning near-equivalent to
authorPeter Johnson <peter@tortall.net>
Sun, 26 Nov 2006 06:49:31 +0000 (06:49 -0000)
committerPeter Johnson <peter@tortall.net>
Sun, 26 Nov 2006 06:49:31 +0000 (06:49 -0000)
yasm_error_occurred().

svn path=/trunk/yasm/; revision=1699

libyasm/errwarn.c
libyasm/errwarn.h

index 6825a3d92823eabc08f91421f97f11e3149e53f7..cb8557439a70c25491799d18f03d8f812e37a41e 100644 (file)
@@ -344,6 +344,14 @@ void yasm_warn_clear(void)
     }
 }
 
+yasm_warn_class
+yasm_warn_occurred(void)
+{
+    if (STAILQ_EMPTY(&yasm_warns))
+       return YASM_WARN_NONE;
+    return STAILQ_FIRST(&yasm_warns)->wclass;
+}
+
 void
 yasm_warn_set_va(yasm_warn_class wclass, const char *format, va_list va)
 {
index f76d6d249b9a6716346fe893b332d3082f052a1d..0b382849aff7b1a72d598d8252add5c8fb03b923 100644 (file)
@@ -192,6 +192,13 @@ void yasm_error_fetch(/*@out@*/ yasm_error_class *eclass,
  */
 void yasm_warn_clear(void);
 
+/** Get the first warning indicator.  YASM_WARN_NONE is returned if no warning
+ * has been set.  Note that as YASM_WARN_NONE is 0, the return value can also
+ * be treated as a boolean value.
+ * \return First warning indicator.
+ */
+yasm_warn_class yasm_warn_occurred(void);
+
 /** Add a warning indicator (va_list version).
  * \param wclass    warning class
  * \param format    printf format string