/* Copyright (C) 2015-2020, Dirk Krause SPDX-License-Identifier: BSD-3-Clause */ /* WARNING: This file was generated by the dkct program (see http://dktools.sourceforge.net/ for details). Changes you make here will be lost if dkct is run again! You should modify the original source and run dkct on it. Original source: dk4aopt04.ctr */ /** @file dk4aopt04.c The dk4aopt04 module. */ #line 10 "dk4aopt04.ctr" #include "dk4opt.h" #include "dk4aopt.h" #if DK4_HAVE_ASSERT_H #ifndef ASSERT_H_INCLUDED #include #define ASSERT_H_INCLUDED 1 #endif #endif #line 23 "dk4aopt04.ctr" int dk4app_opt_get_string_long( dkChar *dptr, size_t szdptr, dk4_app_t *app, const dkChar *n, dk4_er_t *erp ) { dk4_option_t *optr; int back = 0; #line 34 "dk4aopt04.ctr" #if DK4_USE_ASSERT assert(NULL != n); assert(NULL != app); assert(NULL != dptr); assert(0 < szdptr); #endif if ((NULL != dptr) && (0 < szdptr) && (NULL != app) && (NULL != n)) { #line 42 "dk4aopt04.ctr" if (NULL != app->i_opt_long) { #line 43 "dk4aopt04.ctr" optr = (dk4_option_t *)dk4sto_it_find_like(app->i_opt_long, n, 3); if (NULL != optr) { #line 45 "dk4aopt04.ctr" if (0 != optr->found) { #line 46 "dk4aopt04.ctr" back = dk4opt_get_string(dptr, szdptr, optr, NULL); } else { #line 48 "dk4aopt04.ctr" dk4error_set_simple_error_code(erp, DK4_E_NOT_FOUND); } } else { #line 51 "dk4aopt04.ctr" dk4error_set_simple_error_code(erp, DK4_E_SYNTAX); } } else { #line 54 "dk4aopt04.ctr" dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS); } } else { #line 57 "dk4aopt04.ctr" dk4error_set_simple_error_code(erp, DK4_E_INVALID_ARGUMENTS); } #line 59 "dk4aopt04.ctr" return back; }