*NIX用コマンドライン手順書自動作成ツール開発
修訂 | 823986530b414eb6ffa9efa2caa0345ed09edd0d (tree) |
---|---|
時間 | 2016-09-01 21:07:09 |
作者 | Koine Yuusuke(koinec) <koinec@user...> |
Commiter | Koine Yuusuke(koinec) |
* AddFiles: cmdline.[ch]
@@ -1,13 +1,48 @@ | ||
1 | - | |
2 | - | |
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 | +# Based on FreeBSD "script" command by | |
32 | +# David E. O'Brien / The Regents of the University of California.(Thanks!!) | |
33 | +# | |
34 | +#PrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcE | |
3 | 35 | |
4 | 36 | MAKE = make |
5 | 37 | TARGET = procedure |
6 | 38 | OBJS = procedure.o \ |
7 | 39 | master.o \ |
40 | + cmdline.o \ | |
8 | 41 | depend_freebsd.o |
9 | 42 | HEADERS = procedure.h \ |
10 | - master.h | |
43 | + master.h \ | |
44 | + cmdline.h \ | |
45 | + depend_freebsd.h | |
11 | 46 | FLAGS_LIB += -lutil -lkvm |
12 | 47 | FLAGS_DEBUG = |
13 | 48 | CFLAGS += -Wall |
@@ -16,6 +51,8 @@ CFLAGS += -Wall | ||
16 | 51 | all: $(TARGET) |
17 | 52 | build: $(TARGET) |
18 | 53 | |
54 | +cmdline.o: cmdline.c $(HEADERS) | |
55 | + $(CC) -c -o cmdline.o $(FLAGS_DEBUG) $(CFLAGS) cmdline.c | |
19 | 56 | master.o: master.c $(HEADERS) |
20 | 57 | $(CC) -c -o master.o $(FLAGS_DEBUG) $(CFLAGS) master.c |
21 | 58 | procedure.o: procedure.c $(HEADERS) |
@@ -0,0 +1,79 @@ | ||
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 | + * Based on FreeBSD "script" command by | |
32 | + * David E. O'Brien / The Regents of the University of California.(Thanks!!) | |
33 | + * | |
34 | +PrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcE*/ | |
35 | + | |
36 | +#define PROCEDURE_SRC_CMDLINE | |
37 | +#include "procedure.h" | |
38 | + | |
39 | +static char *gpstr_cmdline = NULL; | |
40 | + | |
41 | +/*===========================================================================*/ | |
42 | +PROCEDURE_CMDLINE_EXTERN | |
43 | +int | |
44 | + CmdLine_Init( | |
45 | + int i_maxlen ) | |
46 | +{ | |
47 | + if( NULL != gpstr_cmdline ) | |
48 | + { return 0x00; } | |
49 | + | |
50 | + gpstr_cmdline = (char *)malloc( i_maxlen + 8 ); | |
51 | + if( NULL == gpstr_cmdline ) | |
52 | + { return -0x01; } | |
53 | + | |
54 | + memset( gpstr_cmdline, 0x00, (i_maxlen + 8) ); | |
55 | + | |
56 | + return 0x00; | |
57 | +} | |
58 | + | |
59 | + | |
60 | +/*===========================================================================*/ | |
61 | +PROCEDURE_CMDLINE_EXTERN | |
62 | +int | |
63 | + CmdLine_Term( void ) | |
64 | +{ | |
65 | + if( NULL != gpstr_cmdline ) { | |
66 | + free( gpstr_cmdline ); | |
67 | + gpstr_cmdline = NULL; | |
68 | + } | |
69 | + | |
70 | + return 0x00; | |
71 | +} | |
72 | + | |
73 | + | |
74 | +/*===========================================================================*/ | |
75 | + | |
76 | + | |
77 | + | |
78 | +/* EOF ======================================================================*/ | |
79 | + |
@@ -0,0 +1,56 @@ | ||
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 | + * Based on FreeBSD "script" command by | |
32 | + * David E. O'Brien / The Regents of the University of California.(Thanks!!) | |
33 | + * | |
34 | +PrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcE*/ | |
35 | + | |
36 | +#ifndef PROCEDURE_HEADER_CMDLINE | |
37 | +#define PROCEDURE_HEADER_CMDLINE | |
38 | + | |
39 | +#include "procedure.h" | |
40 | + | |
41 | +#ifdef PROCEDURE_SRC_CMDLINE | |
42 | + #define PROCEDURE_CMDLINE_EXTERN | |
43 | +#else | |
44 | + #define PROCEDURE_CMDLINE_EXTERN extern | |
45 | +#endif | |
46 | + | |
47 | +PROCEDURE_CMDLINE_EXTERN | |
48 | + int CmdLine_Init( int i_maxlen ); | |
49 | +PROCEDURE_CMDLINE_EXTERN | |
50 | + int CmdLine_Term( void ); | |
51 | + | |
52 | + | |
53 | +#endif | |
54 | + | |
55 | +/* EOF ======================================================================*/ | |
56 | + |
@@ -1,3 +1,37 @@ | ||
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 | + * Based on FreeBSD "script" command by | |
32 | + * David E. O'Brien / The Regents of the University of California.(Thanks!!) | |
33 | + * | |
34 | +PrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcE*/ | |
1 | 35 | |
2 | 36 | #define PROCEDURE_SRC_DEPEND_FREEBSD |
3 | 37 | #include "procedure.h" |
@@ -102,7 +136,6 @@ int | ||
102 | 136 | { |
103 | 137 | int i_mib[2]; |
104 | 138 | int i_argsize; |
105 | - int i_err; | |
106 | 139 | size_t sz_len; |
107 | 140 | |
108 | 141 | i_mib[0] = CTL_KERN; |
@@ -115,4 +148,5 @@ int | ||
115 | 148 | return i_argsize; |
116 | 149 | } |
117 | 150 | |
151 | +/* EOF ======================================================================*/ | |
118 | 152 |
@@ -1,3 +1,37 @@ | ||
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 | + * Based on FreeBSD "script" command by | |
32 | + * David E. O'Brien / The Regents of the University of California.(Thanks!!) | |
33 | + * | |
34 | +PrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcE*/ | |
1 | 35 | |
2 | 36 | #ifndef PROCEDURE_HEADER_DEPEND_FREEBSD |
3 | 37 | #define PROCEDURE_HEADER_DEPEND_FREEBSD |
@@ -21,3 +55,5 @@ PROCEDURE_DEPEND_FREEBSD_EXTERN | ||
21 | 55 | |
22 | 56 | #endif |
23 | 57 | |
58 | +/* EOF ======================================================================*/ | |
59 | + |
@@ -1,9 +1,46 @@ | ||
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 | + * Based on FreeBSD "script" command by | |
32 | + * David E. O'Brien / The Regents of the University of California.(Thanks!!) | |
33 | + * | |
34 | +PrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcE*/ | |
1 | 35 | |
2 | 36 | #define PROCEDURE_SRC_MASTER |
3 | 37 | #include "procedure.h" |
4 | 38 | |
39 | +static int gi_maxarg; | |
40 | + | |
5 | 41 | static void ExitProcess(int) __dead2; |
6 | 42 | |
43 | + | |
7 | 44 | /*===========================================================================*/ |
8 | 45 | static int |
9 | 46 | InitMasterProcess( void ) |
@@ -13,7 +50,23 @@ static int | ||
13 | 50 | close( gi_fd_slave ); |
14 | 51 | |
15 | 52 | i_err = InitDependOS(); |
53 | + if( 0x00 != i_err ) { | |
54 | + goto goto_InitMasterProcess_post; | |
55 | + } | |
56 | + | |
57 | + gi_maxarg = GetMaxArgSize(); | |
58 | + if( 0 == gi_maxarg ) { | |
59 | + i_err = -0x10; | |
60 | + goto goto_InitMasterProcess_post; | |
61 | + } | |
62 | + | |
63 | + i_err = CmdLine_Init( gi_maxarg ); | |
64 | + if( 0x00 != i_err ) { | |
65 | + i_err += -0x20; | |
66 | + goto goto_InitMasterProcess_post; | |
67 | + } | |
16 | 68 | |
69 | +goto_InitMasterProcess_post: | |
17 | 70 | return i_err; |
18 | 71 | } |
19 | 72 |
@@ -23,8 +76,6 @@ static void | ||
23 | 76 | ExitProcess( |
24 | 77 | int i_exit ) |
25 | 78 | { |
26 | - TermDependOS(); | |
27 | - | |
28 | 79 | if( gi_ttyflg ) |
29 | 80 | { (void)tcsetattr(STDIN_FILENO, TCSAFLUSH, >_term ); } |
30 | 81 |
@@ -33,6 +84,9 @@ static void | ||
33 | 84 | (void)fclose( fscript ); |
34 | 85 | (void)close( gi_fd_master ); |
35 | 86 | |
87 | + (void)CmdLine_Term(); | |
88 | + (void)TermDependOS(); | |
89 | + | |
36 | 90 | exit( i_exit ); |
37 | 91 | } |
38 | 92 |
@@ -41,7 +95,6 @@ PROCEDURE_MASTER_EXTERN | ||
41 | 95 | int |
42 | 96 | MasterProcess_Main( void ) |
43 | 97 | { |
44 | -// int i_readsz; | |
45 | 98 | int i_rdsz_inbuf; |
46 | 99 | int i_rdsz_outbuf; |
47 | 100 | int i_fds; |
@@ -53,7 +106,6 @@ int | ||
53 | 106 | struct termios t_stt; |
54 | 107 | struct timeval t_tmval; |
55 | 108 | struct timeval *pt_tmval; |
56 | - char *pstr_out; | |
57 | 109 | char *pstr_in; |
58 | 110 | char str_outbuf[BUFSIZ]; |
59 | 111 | char str_inbuf[BUFSIZ]; |
@@ -148,4 +200,5 @@ int | ||
148 | 200 | |
149 | 201 | |
150 | 202 | |
203 | +/* EOF ======================================================================*/ | |
151 | 204 |
@@ -1,3 +1,37 @@ | ||
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 | + * Based on FreeBSD "script" command by | |
32 | + * David E. O'Brien / The Regents of the University of California.(Thanks!!) | |
33 | + * | |
34 | +PrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcE*/ | |
1 | 35 | |
2 | 36 | #ifndef PROCEDURE_HEADER_MASTER |
3 | 37 | #define PROCEDURE_HEADER_MASTER |
@@ -22,3 +56,5 @@ PROCEDURE_MASTER_EXTERN int MasterProcess_Main( void ); | ||
22 | 56 | |
23 | 57 | #endif |
24 | 58 | |
59 | +/* EOF ======================================================================*/ | |
60 | + |
@@ -1,4 +1,7 @@ | ||
1 | -/* | |
1 | +/*PrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcE | |
2 | + * | |
3 | + * procedure - Command-Line Procedure Manual generater for FreeBSD/Linux | |
4 | + * | |
2 | 5 | * Copyrihgt (c) 2016 Koine Yuusuke (koinec). / All Rights Reserved. |
3 | 6 | * |
4 | 7 | * Redistribution and use in source and binary forms, with or without |
@@ -13,7 +16,7 @@ | ||
13 | 16 | * may be used to endorse or promote products derived from this software |
14 | 17 | * without specific prior written permission. |
15 | 18 | * |
16 | - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | |
19 | + * THIS SOFTWARE IS PROVIDED BY Koine Yuusuke(koinec) ``AS IS'' AND | |
17 | 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
18 | 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
19 | 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
@@ -26,8 +29,9 @@ | ||
26 | 29 | * SUCH DAMAGE. |
27 | 30 | * |
28 | 31 | * Based on FreeBSD "script" command by |
29 | - * David E. O'Brien / The Regents of the University of California. | |
30 | - */ | |
32 | + * David E. O'Brien / The Regents of the University of California.(Thanks!!) | |
33 | + * | |
34 | +PrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcE*/ | |
31 | 35 | |
32 | 36 | #define PROCEDURE_SRC_MAIN |
33 | 37 | #include "procedure.h" |
@@ -121,3 +125,5 @@ int | ||
121 | 125 | // Don't reach this line!! --- |
122 | 126 | } |
123 | 127 | |
128 | +/* EOF ======================================================================*/ | |
129 | + |
@@ -1,3 +1,37 @@ | ||
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 | + * Based on FreeBSD "script" command by | |
32 | + * David E. O'Brien / The Regents of the University of California.(Thanks!!) | |
33 | + * | |
34 | +PrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcEdUrEpRoCeDuRePrOcE*/ | |
1 | 35 | |
2 | 36 | #ifndef PROCEDURE_HEADER_SUPER |
3 | 37 | #define PROCEDURE_HEADER_SUPER |
@@ -19,7 +53,10 @@ | ||
19 | 53 | #include <unistd.h> |
20 | 54 | |
21 | 55 | #include "master.h" |
56 | +#include "cmdline.h" | |
22 | 57 | #include "depend_freebsd.h" |
23 | 58 | |
24 | 59 | #endif |
25 | 60 | |
61 | +/* EOF ======================================================================*/ | |
62 | + |