<br><br>
<div class="gmail_quote">Le 4 octobre 2011 13:40, Frédéric Delanoy <span dir="ltr"><<a href="mailto:frederic.delanoy@gmail.com">frederic.delanoy@gmail.com</a>></span> a écrit :<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">2011/10/4 Dan Kegel <<a href="mailto:dank@kegel.com">dank@kegel.com</a>>:<br>
<div class="im">> + * handle_type: type of hIn handle<br>> + *              0 if file, 1 if console, anything else if unknown (autodetect)<br>><br></div>> I suspect you want an enum for that.<br><br>Well I thought about that, but found it a bit overkill for such a<br>
limited set of possible values.<br>Also, if I used sthg like<br><br>enum CMD_HANDLE_TYPE {<br>  CMD_HT_FILE = 0,<br>  CMD_HT_CONSOLE = 1,<br>  CMD_HT_UNKNOWN = 2<br>}<br><br></blockquote>
<div>again, this is not needed (passing all thoses CMD_HT bits)</div>
<div> </div>
<div>static inline BOOL is_console_handle(HANDLE h) {return ((DWORD_PTR)h) & 3 == 3;}</div>
<div>will test every handle and tell whether it's a console or a regular (file, pipe...) handle</div>
<div> </div>
<div>A+</div>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">-- <br>-- <br>Eric Pouech<br></blockquote></div>