Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com From: "Hannu E K Nevalainen" To: "ML CygWIN" Subject: exit status <-> portable code Date: Tue, 11 Nov 2003 17:01:16 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 #define "exit status" "return code" I dispise literal numbers in code - it lessens readabilty, portability and maybe one or two "-bility's" more. e.g: When using AmigaDOS headers for console mode program/command development I have this available: $ tail +230 /Amiga/NDU31/include/dos/dos.h | head -6 /* These are the return codes used by convention by AmigaDOS commands */ /* See FAILAT and IF for relvance to EXECUTE files */ #define RETURN_OK 0 /* No problems, success */ #define RETURN_WARN 5 /* A warning only */ #define RETURN_ERROR 10 /* Something wrong */ #define RETURN_FAIL 20 /* Complete or severe failure*/ Using these I can write programs that look like: $ cat hickup.c #include #include int main(...) { int success=RETURN_FAIL; if (all_OK) success=RETURN_OK; return success; } Q: Is there anything within Cygwin (or Linux, Net*, U*X, whatever... that can be transferred to Cygwin) that can be used for the same purpose? /Hannu E K Nevalainen, B.Sc. EE - 59+16.37'N, 17+12.60'E -- printf("LocalTime: UTC+%02d\n",(DST)? 2:1); -- --END OF MESSAGE-- -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/