michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /* michael@0: * File: stdio.c michael@0: * Description: testing the "special" fds michael@0: * Modification History: michael@0: * 20-May-1997 AGarcia - Replace Test succeeded status with PASS. This is used by the michael@0: * regress tool parsing code. michael@0: ** 04-June-97 AGarcia removed the Test_Result function. Regress tool has been updated to michael@0: ** recognize the return code from tha main program. michael@0: */ michael@0: michael@0: michael@0: #include "prlog.h" michael@0: #include "prinit.h" michael@0: #include "prio.h" michael@0: michael@0: #include michael@0: #include michael@0: michael@0: static PRIntn PR_CALLBACK stdio(PRIntn argc, char **argv) michael@0: { michael@0: PRInt32 rv; michael@0: michael@0: PRFileDesc *out = PR_GetSpecialFD(PR_StandardOutput); michael@0: PRFileDesc *err = PR_GetSpecialFD(PR_StandardError); michael@0: michael@0: rv = PR_Write( michael@0: out, "This to standard out\n", michael@0: strlen("This to standard out\n")); michael@0: PR_ASSERT((PRInt32)strlen("This to standard out\n") == rv); michael@0: rv = PR_Write( michael@0: err, "This to standard err\n", michael@0: strlen("This to standard err\n")); michael@0: PR_ASSERT((PRInt32)strlen("This to standard err\n") == rv); michael@0: michael@0: return 0; michael@0: michael@0: } /* stdio */ michael@0: michael@0: int main(int argc, char **argv) michael@0: { michael@0: PR_STDIO_INIT(); michael@0: return PR_Initialize(stdio, argc, argv, 0); michael@0: } /* main */ michael@0: michael@0: michael@0: /* stdio.c */