1251609Sdim/* 2251609Sdim * Copyright (c) 2000-2001 Proofpoint, Inc. and its suppliers. 3251609Sdim * All rights reserved. 4251609Sdim * Copyright (c) 1990, 1993 5251609Sdim * The Regents of the University of California. All rights reserved. 6251609Sdim * 7251609Sdim * This code is derived from software contributed to Berkeley by 8251609Sdim * Chris Torek. 9251609Sdim * 10251609Sdim * By using this file, you agree to the terms and conditions set 11251609Sdim * forth in the LICENSE file which can be found at the top level of 12251609Sdim * the sendmail distribution. 13251609Sdim */ 14251609Sdim 15251609Sdim#include <sm/gen.h> 16251609SdimSM_RCSID("@(#)$Id: get.c,v 1.19 2013-11-22 20:51:43 ca Exp $") 17251609Sdim#include <sm/io.h> 18251609Sdim#include <sm/assert.h> 19251609Sdim#include "local.h" 20251609Sdim 21251609Sdim/* 22251609Sdim** SM_IO_GETC -- get a character from a file 23251609Sdim** 24251609Sdim** Parameters: 25251609Sdim** fp -- the file to get the character from 26251609Sdim** timeout -- time to complete getc 27251609Sdim** 28251609Sdim** Returns: 29251609Sdim** Success: the value of the character read. 30251609Sdim** Failure: SM_IO_EOF 31263509Sdim** 32263509Sdim** This is a function version of the macro (in <sm/io.h>). 33263509Sdim** It is guarded with locks (which are currently not functional) 34263509Sdim** for multi-threaded programs. 35263509Sdim*/ 36263509Sdim 37263509Sdim#undef sm_io_getc 38251609Sdim 39251609Sdimint 40263509Sdimsm_io_getc(fp, timeout) 41263509Sdim register SM_FILE_T *fp; 42263509Sdim int timeout; 43251609Sdim{ 44263509Sdim SM_REQUIRE_ISA(fp, SmFileMagic); 45263509Sdim return sm_getc(fp, timeout); 46263509Sdim} 47251609Sdim