sl@0: /* sl@0: * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * FUNCTION sl@0: * <>---write a character on a stream or file sl@0: * INDEX sl@0: * fputc sl@0: * ANSI_SYNOPSIS sl@0: * #include sl@0: * int fputc(int <[ch]>, FILE *<[fp]>); sl@0: * TRAD_SYNOPSIS sl@0: * #include sl@0: * int fputc(<[ch]>, <[fp]>) sl@0: * int <[ch]>; sl@0: * FILE *<[fp]>; sl@0: * <> converts the argument <[ch]> from an <> to an sl@0: * <>, then writes it to the file or stream identified by sl@0: * <[fp]>. sl@0: * If the file was opened with append mode (or if the stream cannot sl@0: * support positioning), then the new character goes at the end of the sl@0: * file or stream. Otherwise, the new character is written at the sl@0: * current value of the position indicator, and the position indicator sl@0: * advances by one. sl@0: * For a macro version of this function, see <>. sl@0: * RETURNS sl@0: * If successful, <> returns its argument <[ch]>. If an error sl@0: * intervenes, the result is <>. You can use `<)>>' to sl@0: * query for errors. sl@0: * PORTABILITY sl@0: * <> is required by ANSI C. sl@0: * Supporting OS subroutines required: <>, <>, <>, sl@0: * <>, <>, <>, <>. sl@0: * sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: #include sl@0: /** sl@0: Write character to stream. sl@0: @return If there are no errors the written character is returned. sl@0: If an error occurs, EOF is returned. sl@0: @param ch Character to be written. sl@0: The function casts the int parameter to its unsigned char equivalent before writing it. sl@0: @param file pointer to an open file. sl@0: */ sl@0: EXPORT_C int sl@0: fputc (int ch, FILE * file) sl@0: { sl@0: return putc ((unsigned char)ch, file); sl@0: }