From 75094d0afafd5284ed7fa6b888cefcc67c57a70a Mon Sep 17 00:00:00 2001 From: Krzysztof Opasiak Date: Wed, 29 Oct 2014 16:15:21 +0100 Subject: [PATCH] libusbgx: Add empty definitions of gadget schemes functions In some cases user may want to not use gadget schemes functionality so he should be able to remove libconfig dependency. To be able to do this without API break add empty definitions of gadget schemes functions which only returns USBG_ERROR_NOT_SUPPORTED. Signed-off-by: Krzysztof Opasiak --- src/usbg_schemes_none.c | 89 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 src/usbg_schemes_none.c diff --git a/src/usbg_schemes_none.c b/src/usbg_schemes_none.c new file mode 100644 index 0000000..6263d1a --- /dev/null +++ b/src/usbg_schemes_none.c @@ -0,0 +1,89 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + */ + +#include +#include "usbg/usbg_internal.h" + +int usbg_export_function(__attribute__ ((unused)) usbg_function *f, + __attribute__ ((unused)) FILE *stream) +{ + return USBG_ERROR_NOT_SUPPORTED; +} + +int usbg_export_config(__attribute__ ((unused)) usbg_config *c, + __attribute__ ((unused)) FILE *stream) +{ + return USBG_ERROR_NOT_SUPPORTED; +} + +int usbg_export_gadget(__attribute__ ((unused)) usbg_gadget *g, + __attribute__ ((unused)) FILE *stream) +{ + return USBG_ERROR_NOT_SUPPORTED; +} + +int usbg_import_function(__attribute__ ((unused)) usbg_gadget *g, + __attribute__ ((unused)) FILE *stream, + __attribute__ ((unused)) const char *instance, + __attribute__ ((unused)) usbg_function **f) +{ + return USBG_ERROR_NOT_SUPPORTED; +} + +int usbg_import_config(__attribute__ ((unused)) usbg_gadget *g, + __attribute__ ((unused)) FILE *stream, + __attribute__ ((unused)) int id, + __attribute__ ((unused)) usbg_config **c) +{ + return USBG_ERROR_NOT_SUPPORTED; +} + +int usbg_import_gadget(__attribute__ ((unused)) usbg_state *s, + __attribute__ ((unused)) FILE *stream, + __attribute__ ((unused)) const char *name, + __attribute__ ((unused)) usbg_gadget **g) +{ + return USBG_ERROR_NOT_SUPPORTED; +} + +const char *usbg_get_func_import_error_text( + __attribute__ ((unused)) usbg_gadget *g) +{ + return NULL; +} + +int usbg_get_func_import_error_line(__attribute__ ((unused)) usbg_gadget *g) +{ + return USBG_ERROR_NOT_SUPPORTED; +} + +const char *usbg_get_config_import_error_text( + __attribute__ ((unused)) usbg_gadget *g) +{ + return NULL; +} + +int usbg_get_config_import_error_line(__attribute__ ((unused)) usbg_gadget *g) +{ + return USBG_ERROR_NOT_SUPPORTED; +} + +const char *usbg_get_gadget_import_error_text( + __attribute__ ((unused)) usbg_state *s) +{ + return NULL; +} + +int usbg_get_gadget_import_error_line(__attribute__ ((unused)) usbg_state *s) +{ + return USBG_ERROR_NOT_SUPPORTED; +} -- 2.7.4