*NIX用コマンドライン手順書自動作成ツール開発
修訂 | a2abb73bed073c26843e24233f4ca4790ae6a36d (tree) |
---|---|
時間 | 2016-09-04 20:44:09 |
作者 | Koine Yuusuke(koinec) <koinec@user...> |
Commiter | Koine Yuusuke(koinec) |
* AddFiles: Add default config. param. setting header.(config.h)
@@ -38,6 +38,7 @@ PARTS_OBJS = cmdline.o \ | ||
38 | 38 | outbuffer.o \ |
39 | 39 | depend_freebsd.o |
40 | 40 | HEADERS = procedure.h \ |
41 | + config.h \ | |
41 | 42 | master.h \ |
42 | 43 | cmdline.h \ |
43 | 44 | outbuffer.h \ |
@@ -0,0 +1,42 @@ | ||
1 | +/*PrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcE | |
2 | + * | |
3 | + * procedure - Command-Line Procedure Manual generater for FreeBSD/Linux | |
4 | + * | |
5 | + * Copyrihgt (c) 2016 Koine Yuusuke (koinec). / All Rights Reserved. | |
6 | + * | |
7 | + * Redistribution and use in source and binary forms, with or without | |
8 | + * modification, are permitted provided that the following conditions | |
9 | + * are met: | |
10 | + * 1. Redistributions of source code must retain the above copyright | |
11 | + * notice, this list of conditions and the following disclaimer. | |
12 | + * 2. Redistributions in binary form must reproduce the above copyright | |
13 | + * notice, this list of conditions and the following disclaimer in the | |
14 | + * documentation and/or other materials provided with the distribution. | |
15 | + * 4. Neither the name of the University nor the names of its contributors | |
16 | + * may be used to endorse or promote products derived from this software | |
17 | + * without specific prior written permission. | |
18 | + * | |
19 | + * THIS SOFTWARE IS PROVIDED BY Koine Yuusuke(koinec) ``AS IS'' AND | |
20 | + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
21 | + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
22 | + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
23 | + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
24 | + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
25 | + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
26 | + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
27 | + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
28 | + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
29 | + * SUCH DAMAGE. | |
30 | + * | |
31 | +PrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcE*/ | |
32 | + | |
33 | +#ifndef PROCEDURE_HEADER_CONFIG | |
34 | +#define PROCEDURE_HEADER_CONFIG | |
35 | + | |
36 | +#define OUTPUT_RINGBUFFER_SIZE 4096 | |
37 | +#define DEFAULT_OUTPUT_FILENAME "procedure.txt" | |
38 | + | |
39 | +#endif | |
40 | + | |
41 | +/* EOF ======================================================================*/ | |
42 | + |
@@ -62,6 +62,12 @@ static int | ||
62 | 62 | i_err += -0x20; |
63 | 63 | goto goto_InitMasterProcess_post; |
64 | 64 | } |
65 | + | |
66 | + i_err = OutBuffer_Init( OUTPUT_RINGBUFFER_SIZE ); | |
67 | + if( 0x00 != i_err ) { | |
68 | + i_err += -0x30; | |
69 | + goto goto_InitMasterProcess_post; | |
70 | + } | |
65 | 71 | |
66 | 72 | goto_InitMasterProcess_post: |
67 | 73 | return i_err; |
@@ -81,6 +87,7 @@ static void | ||
81 | 87 | (void)fclose( fscript ); |
82 | 88 | (void)close( gi_fd_master ); |
83 | 89 | |
90 | + (void)OutBuffer_Term(); | |
84 | 91 | (void)CmdLine_Term(); |
85 | 92 | (void)TermDependOS(); |
86 | 93 |
@@ -76,7 +76,7 @@ int | ||
76 | 76 | |
77 | 77 | argv += 1; |
78 | 78 | |
79 | - fname = "procedure.txt"; | |
79 | + fname = DEFAULT_OUTPUT_FILENAME; | |
80 | 80 | |
81 | 81 | if ((fscript = fopen(fname, "w")) == NULL) |
82 | 82 | err(1, "%s", fname); |
@@ -49,6 +49,8 @@ PrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcE*/ | ||
49 | 49 | #include <termios.h> |
50 | 50 | #include <unistd.h> |
51 | 51 | |
52 | +#include "config.h" | |
53 | + | |
52 | 54 | #include "master.h" |
53 | 55 | #include "cmdline.h" |
54 | 56 | #include "outbuffer.h" |