os/ossrv/genericopenlibs/cstdlib/LSTDIO/FPUTC.C
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/genericopenlibs/cstdlib/LSTDIO/FPUTC.C	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,63 @@
     1.4 +/*
     1.5 +* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description:
    1.18 +* FUNCTION
    1.19 +* <<fputc>>---write a character on a stream or file
    1.20 +* INDEX
    1.21 +* fputc
    1.22 +* ANSI_SYNOPSIS
    1.23 +* #include <stdio.h>
    1.24 +* int fputc(int <[ch]>, FILE *<[fp]>);
    1.25 +* TRAD_SYNOPSIS
    1.26 +* #include <stdio.h>
    1.27 +* int fputc(<[ch]>, <[fp]>)
    1.28 +* int <[ch]>;
    1.29 +* FILE *<[fp]>;
    1.30 +* <<fputc>> converts the argument <[ch]> from an <<int>> to an
    1.31 +* <<unsigned char>>, then writes it to the file or stream identified by
    1.32 +* <[fp]>.
    1.33 +* If the file was opened with append mode (or if the stream cannot
    1.34 +* support positioning), then the new character goes at the end of the
    1.35 +* file or stream.  Otherwise, the new character is written at the
    1.36 +* current value of the position indicator, and the position indicator
    1.37 +* advances by one.
    1.38 +* For a macro version of this function, see <<putc>>.
    1.39 +* RETURNS
    1.40 +* If successful, <<fputc>> returns its argument <[ch]>.  If an error
    1.41 +* intervenes, the result is <<EOF>>.  You can use `<<ferror(<[fp]>)>>' to
    1.42 +* query for errors.
    1.43 +* PORTABILITY
    1.44 +* <<fputc>> is required by ANSI C.
    1.45 +* Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
    1.46 +* <<lseek>>, <<read>>, <<sbrk>>, <<write>>.
    1.47 +* 
    1.48 +*
    1.49 +*/
    1.50 +
    1.51 +
    1.52 +
    1.53 +#include <stdio.h>
    1.54 +/**
    1.55 +Write character to stream.
    1.56 +@return If there are no errors the written character is returned.
    1.57 +If an error occurs, EOF is returned.
    1.58 +@param ch Character to be written. 
    1.59 +The function casts the int parameter to its unsigned char equivalent before writing it. 
    1.60 +@param file pointer to an open file.
    1.61 +*/
    1.62 +EXPORT_C int
    1.63 +fputc (int ch, FILE * file)
    1.64 +{
    1.65 +  return putc ((unsigned char)ch, file);
    1.66 +}