*/
extern int usbg_import_gadget(usbg_state *s, FILE *stream,
const char *name, usbg_gadget **g);
+
+/**
+ * @brief Get text of error which occurred during last function import
+ * @param g gadget where function import error occurred
+ * @return Text of error or NULL if no error data
+ */
+extern const char *usbg_get_func_import_error_text(usbg_gadget *g);
+
+/**
+ * @brief Get line number where function import error occurred
+ * @param g gadget where function import error occurred
+ * @return line number or value below 0 if no error data
+ */
+extern int usbg_get_func_import_error_line(usbg_gadget *g);
+
+/**
+ * @brief Get text of error which occurred during last config import
+ * @param g gadget where config import error occurred
+ * @return Text of error or NULL if no error data
+ */
+extern const char *usbg_get_config_import_error_text(usbg_gadget *g);
+
+/**
+ * @brief Get line number where config import error occurred
+ * @param g gadget where config import error occurred
+ * @return line number or value below 0 if no error data
+ */
+extern int usbg_get_config_import_error_line(usbg_gadget *g);
+
+/**
+ * @brief Get text of error which occurred during last gadget import
+ * @param s where gadget import error occurred
+ * @return Text of error or NULL if no error data
+ */
+extern const char *usbg_get_gadget_import_error_text(usbg_state *s);
+
+/**
+ * @brief Get line number where gadget import error occurred
+ * @param s where gadget import error occurred
+ * @return line number or value below 0 if no error data
+ */
+extern int usbg_get_gadget_import_error_line(usbg_state *s);
+
/**
* @}
*/
return ret;
}
+const char *usbg_get_func_import_error_text(usbg_gadget *g)
+{
+ if (!g || !g->last_failed_import)
+ return NULL;
+
+ return config_error_text(g->last_failed_import);
+}
+
+const char *usbg_get_func_import_error_line(usbg_gadget *g)
+{
+ if (!g || !g->last_failed_import)
+ return -1;
+
+ return config_error_line(g->last_failed_import);
+}
+
+const char *usbg_get_config_import_error_text(usbg_gadget *g)
+{
+ if (!g || !g->last_failed_import)
+ return NULL;
+
+ return config_error_text(g->last_failed_import);
+}
+
+const char *usbg_get_config_import_error_line(usbg_gadget *g)
+{
+ if (!g || !g->last_failed_import)
+ return -1;
+
+ return config_error_line(g->last_failed_import);
+}
+
+const char *usbg_get_gadget_import_error_text(usbg_state *s)
+{
+ if (!s || !s->last_failed_import)
+ return NULL;
+
+ return config_error_text(s->last_failed_import);
+}
+
+const char *usbg_get_gadget_import_error_line(usbg_state *s)
+{
+ if (!s || !s->last_failed_import)
+ return -1;
+
+ return config_error_line(s->last_failed_import);
+}
+