xref: /freebsd/contrib/sendmail/libsm/get.c (revision b0d29bc47dba79f6f38e67eabadfb4b32ffd9390)
1 /*
2  * Copyright (c) 2000-2001 Proofpoint, Inc. and its suppliers.
3  *      All rights reserved.
4  * Copyright (c) 1990, 1993
5  *	The Regents of the University of California.  All rights reserved.
6  *
7  * This code is derived from software contributed to Berkeley by
8  * Chris Torek.
9  *
10  * By using this file, you agree to the terms and conditions set
11  * forth in the LICENSE file which can be found at the top level of
12  * the sendmail distribution.
13  */
14 
15 #include <sm/gen.h>
16 SM_RCSID("@(#)$Id: get.c,v 1.19 2013-11-22 20:51:43 ca Exp $")
17 #include <sm/io.h>
18 #include <sm/assert.h>
19 #include "local.h"
20 
21 /*
22 **  SM_IO_GETC -- get a character from a file
23 **
24 **	Parameters:
25 **		fp -- the file to get the character from
26 **		timeout -- time to complete getc
27 **
28 **	Returns:
29 **		Success: the value of the character read.
30 **		Failure: SM_IO_EOF
31 **
32 **	This is a function version of the macro (in <sm/io.h>).
33 **	It is guarded with locks (which are currently not functional)
34 **	for multi-threaded programs.
35 */
36 
37 #undef sm_io_getc
38 
39 int
40 sm_io_getc(fp, timeout)
41 	register SM_FILE_T *fp;
42 	int timeout;
43 {
44 	SM_REQUIRE_ISA(fp, SmFileMagic);
45 	return sm_getc(fp, timeout);
46 }
47