• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

*NIX用コマンドライン手順書自動作成ツール開発


Commit MetaInfo

Revisiónf0489859cd91b1a948484fbedec1774cc2564887 (tree)
Tiempo2016-09-04 14:19:11
AutorKoine Yuusuke(koinec) <koinec@user...>
CommiterKoine Yuusuke(koinec)

Log Message

* Implement: Output Only Command Line String (in ESC code)

Cambiar Resumen

Diferencia incremental

--- a/master.c
+++ b/master.c
@@ -100,6 +100,7 @@ int
100100 int i_err;
101101 int i_result;
102102 int i_pos;
103+ int i_pid_grandchild;
103104 struct termios t_stt;
104105 struct timeval t_tmval;
105106 struct timeval *pt_tmval;
@@ -115,7 +116,8 @@ int
115116 }
116117
117118 // Proc. Master-Process ---
118- i_readstdin = 1;
119+ i_readstdin = 1;
120+ i_pid_grandchild = -1;
119121 do {
120122 FD_ZERO( &t_rfd );
121123 FD_SET( gi_fd_master, &t_rfd );
@@ -154,14 +156,15 @@ int
154156 if( 0x0d == str_inbuf[i_pos] ) { break; }
155157 }
156158 if( 0 < i_pos ) {
159+ // Keyboard input for Terminal ---
160+ i_pid_grandchild
161+ = CheckGrandchildProcess( gi_pid_child, i_pid_grandchild );
162+
157163 (void)write( gi_fd_master, str_inbuf, i_pos );
158164 i_rdsz_inbuf -= i_pos;
159165 }
160166 pstr_in = (str_inbuf + i_pos);
161- //(void)write( gi_fd_master, str_inbuf, i_rdsz_inbuf );
162- //(void)fwrite(str_inbuf, 1, i_readsz, fscript);
163167 }
164-
165168 }
166169
167170 if(( 0 < i_fds ) && FD_ISSET( gi_fd_master, &t_rfd )) {
@@ -170,12 +173,20 @@ int
170173 if( 0 >= i_rdsz_outbuf ) { break; }
171174
172175 (void)write(STDOUT_FILENO, str_outbuf, i_rdsz_outbuf );
173- (void)fwrite( str_outbuf, 1, i_rdsz_outbuf, fscript);
176+
177+ if( 0 == i_pid_grandchild ) {
178+ (void)CmdLine_AddCmdLineString( str_outbuf, i_rdsz_outbuf );
179+ }
180+
181+ //(void)fwrite( str_outbuf, 1, i_rdsz_outbuf, fscript);
174182 }
175183 fflush(fscript);
176184
177185 if( 0 < i_rdsz_inbuf ) {
186+ i_pid_grandchild = -0xff;
178187 (void)write( gi_fd_master, pstr_in, i_rdsz_inbuf );
188+ (void)fprintf( fscript, "**Command: %s\n", CmdLine_GetCmdLineString( NULL ));
189+ CmdLine_ClearCmdLineString();
179190 }
180191
181192 } while(1);