1*3d8817e4Smiod /* gmon_io.h 2*3d8817e4Smiod 3*3d8817e4Smiod Copyright 2000, 2001, 2002, 2004 Free Software Foundation, Inc. 4*3d8817e4Smiod 5*3d8817e4Smiod This file is part of GNU Binutils. 6*3d8817e4Smiod 7*3d8817e4Smiod This program is free software; you can redistribute it and/or modify 8*3d8817e4Smiod it under the terms of the GNU General Public License as published by 9*3d8817e4Smiod the Free Software Foundation; either version 2 of the License, or 10*3d8817e4Smiod (at your option) any later version. 11*3d8817e4Smiod 12*3d8817e4Smiod This program is distributed in the hope that it will be useful, 13*3d8817e4Smiod but WITHOUT ANY WARRANTY; without even the implied warranty of 14*3d8817e4Smiod MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15*3d8817e4Smiod GNU General Public License for more details. 16*3d8817e4Smiod 17*3d8817e4Smiod You should have received a copy of the GNU General Public License 18*3d8817e4Smiod along with this program; if not, write to the Free Software 19*3d8817e4Smiod Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ 20*3d8817e4Smiod 21*3d8817e4Smiod #ifndef gmon_io_h 22*3d8817e4Smiod #define gmon_io_h 23*3d8817e4Smiod 24*3d8817e4Smiod /* Some platforms need to put stdin into binary mode, to read 25*3d8817e4Smiod binary files. */ 26*3d8817e4Smiod #include "sysdep.h" 27*3d8817e4Smiod #ifdef HAVE_SETMODE 28*3d8817e4Smiod #ifndef O_BINARY 29*3d8817e4Smiod #ifdef _O_BINARY 30*3d8817e4Smiod #define O_BINARY _O_BINARY 31*3d8817e4Smiod #define setmode _setmode 32*3d8817e4Smiod #else 33*3d8817e4Smiod #define O_BINARY 0 34*3d8817e4Smiod #endif 35*3d8817e4Smiod #endif 36*3d8817e4Smiod #if O_BINARY 37*3d8817e4Smiod #include <io.h> 38*3d8817e4Smiod #define SET_BINARY(f) do { if (!isatty(f)) setmode(f,O_BINARY); } while (0) 39*3d8817e4Smiod #endif 40*3d8817e4Smiod #endif 41*3d8817e4Smiod 42*3d8817e4Smiod #define INPUT_HISTOGRAM (1 << 0) 43*3d8817e4Smiod #define INPUT_CALL_GRAPH (1 << 1) 44*3d8817e4Smiod #define INPUT_BB_COUNTS (1 << 2) 45*3d8817e4Smiod 46*3d8817e4Smiod extern int gmon_input; /* What input did we see? */ 47*3d8817e4Smiod extern int gmon_file_version; /* File version are we dealing with. */ 48*3d8817e4Smiod 49*3d8817e4Smiod extern int gmon_io_read_vma (FILE *ifp, bfd_vma *valp); 50*3d8817e4Smiod extern int gmon_io_read_32 (FILE *ifp, unsigned int *valp); 51*3d8817e4Smiod extern int gmon_io_read (FILE *ifp, char *buf, size_t n); 52*3d8817e4Smiod extern int gmon_io_write_vma (FILE *ifp, bfd_vma val); 53*3d8817e4Smiod extern int gmon_io_write_32 (FILE *ifp, unsigned int val); 54*3d8817e4Smiod extern int gmon_io_write_8 (FILE *ifp, unsigned int val); 55*3d8817e4Smiod extern int gmon_io_write (FILE *ifp, char *buf, size_t n); 56*3d8817e4Smiod 57*3d8817e4Smiod extern void gmon_out_read (const char *); 58*3d8817e4Smiod extern void gmon_out_write (const char *); 59*3d8817e4Smiod 60*3d8817e4Smiod #endif /* gmon_io_h */ 61