Ignore:
Timestamp:
Aug 16, 2003, 6:59:22 PM (22 years ago)
Author:
bird
Message:

binutils v2.14 - offical sources.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/binutils/bfd/cache.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    11/* BFD library -- caching of file descriptors.
    2    Copyright 1990, 1991, 1992, 1993, 1994, 1996, 2000, 2001
     2   Copyright 1990, 1991, 1992, 1993, 1994, 1996, 2000, 2001, 2002
    33   Free Software Foundation, Inc.
    44   Hacked by Steve Chamberlain of Cygnus Support (steve@cygnus.com).
     
    4343static void insert PARAMS ((bfd *));
    4444static void snip PARAMS ((bfd *));
    45 static boolean close_one PARAMS ((void));
    46 static boolean bfd_cache_delete PARAMS ((bfd *));
     45static bfd_boolean close_one PARAMS ((void));
     46static bfd_boolean bfd_cache_delete PARAMS ((bfd *));
    4747
    4848/*
     
    134134   recently used cacheable BFD and close it.  */
    135135
    136 static boolean
     136static bfd_boolean
    137137close_one ()
    138138{
     
    158158    {
    159159      /* There are no open cacheable BFD's.  */
    160       return true;
     160      return TRUE;
    161161    }
    162162
     
    168168/* Close a BFD and remove it from the cache.  */
    169169
    170 static boolean
     170static bfd_boolean
    171171bfd_cache_delete (abfd)
    172172     bfd *abfd;
    173173{
    174   boolean ret;
     174  bfd_boolean ret;
    175175
    176176  if (fclose ((FILE *) abfd->iostream) == 0)
    177     ret = true;
     177    ret = TRUE;
    178178  else
    179179    {
    180       ret = false;
     180      ret = FALSE;
    181181      bfd_set_error (bfd_error_system_call);
    182182    }
     
    195195
    196196SYNOPSIS
    197         boolean bfd_cache_init (bfd *abfd);
     197        bfd_boolean bfd_cache_init (bfd *abfd);
    198198
    199199DESCRIPTION
     
    201201*/
    202202
    203 boolean
     203bfd_boolean
    204204bfd_cache_init (abfd)
    205205     bfd *abfd;
     
    209209    {
    210210      if (! close_one ())
    211         return false;
     211        return FALSE;
    212212    }
    213213  insert (abfd);
    214214  ++open_files;
    215   return true;
     215  return TRUE;
    216216}
    217217
     
    221221
    222222SYNOPSIS
    223         boolean bfd_cache_close (bfd *abfd);
     223        bfd_boolean bfd_cache_close (bfd *abfd);
    224224
    225225DESCRIPTION
     
    228228
    229229RETURNS
    230         <<false>> is returned if closing the file fails, <<true>> is
     230        <<FALSE>> is returned if closing the file fails, <<TRUE>> is
    231231        returned if all is well.
    232232*/
    233233
    234 boolean
     234bfd_boolean
    235235bfd_cache_close (abfd)
    236236     bfd *abfd;
     
    238238  if (abfd->iostream == NULL
    239239      || (abfd->flags & BFD_IN_MEMORY) != 0)
    240     return true;
     240    return TRUE;
    241241
    242242  return bfd_cache_delete (abfd);
     
    262262     bfd *abfd;
    263263{
    264   abfd->cacheable = true;       /* Allow it to be closed later.  */
     264  abfd->cacheable = TRUE;       /* Allow it to be closed later.  */
    265265
    266266  if (open_files >= BFD_CACHE_MAX_OPEN)
     
    278278    case both_direction:
    279279    case write_direction:
    280       if (abfd->opened_once == true)
     280      if (abfd->opened_once)
    281281        {
    282282          abfd->iostream = (PTR) fopen (abfd->filename, FOPEN_RUB);
     
    313313#endif
    314314          abfd->iostream = (PTR) fopen (abfd->filename, FOPEN_WUB);
    315           abfd->opened_once = true;
     315          abfd->opened_once = TRUE;
    316316        }
    317317      break;
     
    365365      if (bfd_open_file (abfd) == NULL)
    366366        return NULL;
    367       if (fseek ((FILE *) abfd->iostream, abfd->where, SEEK_SET) != 0)
     367      if (abfd->where != (unsigned long) abfd->where)
     368        return NULL;
     369      if (fseek ((FILE *) abfd->iostream, (long) abfd->where, SEEK_SET) != 0)
    368370        return NULL;
    369371    }
Note: See TracChangeset for help on using the changeset viewer.