1 /*
2 WARNING: This file was generated by the dkct program (see
3 http://dktools.sourceforge.net/ for details).
4 Changes you make here will be lost if dkct is run again!
5 You should modify the original source and run dkct on it.
6 Original source: test-mkdir.ctr
7 */
8
9 /** @file test-mkdir.c The test-mkdir module.
10 */
11
12
13
14 #include <stdio.h>
15
16
17
18 #include <libdk4app/dk4app.h>
19 #include <libdk4c/dk4fput.h>
20 #include <libdk4app/dk4appmkdh.h>
21
22
23
24
25
26
27
28 static const dkChar * const test_mkdir_help_text[] = {
29 dkT("This is a test program to create directories."),
30 NULL
31
32 };
33
34 static const dkChar * const test_mkdir_license_text[] = {
35 dkT("Copyright (c) 2014-2016, Dirk Krause"),
36 dkT("All rights reserved."),
37 dkT(""),
38 dkT("Redistribution and use in source and binary forms, with or without"),
39 dkT("modification, are permitted provided that the following conditions are met:"),
40 dkT(""),
41 dkT("1. Redistributions of source code must retain the above copyright notice,"),
42 dkT(" this list of conditions and the following disclaimer."),
43 dkT("2. Redistributions in binary form must reproduce the above copyright"),
44 dkT(" notice, this list of conditions and the following disclaimer in the"),
45 dkT(" documentation and/or other materials provided with the distribution."),
46 dkT("3. Neither the name of the copyright holder nor the names of its"),
47 dkT(" contributors may be used to endorse or promote products derived from"),
48 dkT(" this software without specific prior written permission."),
49 dkT(""),
50 dkT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"),
51 dkT("``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT"),
52 dkT("LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR"),
53 dkT("A PARTICULAR PURPOSE ARE DISCLAIMED."),
54 dkT("IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY"),
55 dkT("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES"),
56 dkT("(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR"),
57 dkT("SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER"),
58 dkT("CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT"),
59 dkT("LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY"),
60 dkT("OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF"),
61 dkT("SUCH DAMAGE."),
62 dkT(""),
63 NULL
64
65 };
66
67 static dk4_app_t *app = NULL;
68
69 /** Main function.
70 @param argc Number of command line arguments.
71 @param argv Command line arguments array.
72 @return 0 on success, all other values indicate errors.
73 */
74 #if DK4_CHAR_SIZE > 1
wmain(int argc,wchar_t * argv[])75 int wmain(int argc, wchar_t *argv[])
76 #else
77 int main(int argc, char *argv[])
78 #endif
79 {
80 int res;
81 int nargs;
82 int i;
83 const dkChar *arg;
84
85 app = dk4app_open_cmd(
86 argc, argv, NULL, 0,
87 dkT("dktools-4-test"), dkT("1.0.0"),
88 dkT("test-mkdir.txt"), test_mkdir_help_text,
89 test_mkdir_license_text
90 );
91 if (NULL != app) {
92 nargs = dk4app_get_argc(app);
93 if (0 < nargs) {
94 dk4fput_initialize_stdout();
95 for (i = 0; i < nargs; i++) {
96 arg = dk4app_get_argv(app, i);
97 if (NULL != arg) {
98 res = dk4app_mkdir_hierarchy(arg, 1, app);
99 dk4fputs(arg, stdout, NULL);
100 dk4fputc(dkT(' '), stdout, NULL);
101 if (0 < res) {
102 dk4fputs(dkT("SUCCESS"), stdout, NULL);
103 } else {
104 dk4fputs(dkT("FAILED"), stdout, NULL);
105 }
106 dk4fputc(dkT('\n'), stdout, NULL);
107 }
108 }
109 }
110 dk4app_close(app);
111 } else {
112 }
113
114 return 0;
115 }
116
117