File: inputint.c

package info (click to toggle)
texlive-bin 2007.dfsg.2-4%2Blenny3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 245,472 kB
  • ctags: 135,653
  • sloc: ansic: 971,350; cpp: 307,149; sh: 53,218; perl: 39,201; makefile: 12,611; python: 6,078; xml: 5,342; asm: 4,245; yacc: 3,108; pascal: 2,483; ruby: 2,089; ada: 1,681; lex: 1,654; objc: 1,357; awk: 1,214; tcl: 973; cs: 879; lisp: 708; sed: 536; java: 172; csh: 47
file content (20 lines) | stat: -rw-r--r-- 465 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* inputint.c: read integers from text files.  These routines are only
   used for debugging and such, so perfect error checking isn't
   necessary.  Public domain. */

#include "config.h"


/* Read an integer from the file F, reading past the subsequent end of
   line.  */

integer
inputint P1C(FILE *, f)
{
  char buffer[MAX_INT_LENGTH]; /* Long enough for anything reasonable.  */

  return
    fgets (buffer, sizeof (buffer), f)
    ? atoi (buffer)
    : 0;
}