Changeset 609 for branches/GNU/src/binutils/bfd/cache.c
- Timestamp:
- Aug 16, 2003, 6:59:22 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/binutils/bfd/cache.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* 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 3 3 Free Software Foundation, Inc. 4 4 Hacked by Steve Chamberlain of Cygnus Support (steve@cygnus.com). … … 43 43 static void insert PARAMS ((bfd *)); 44 44 static void snip PARAMS ((bfd *)); 45 static b oolean close_one PARAMS ((void));46 static b oolean bfd_cache_delete PARAMS ((bfd *));45 static bfd_boolean close_one PARAMS ((void)); 46 static bfd_boolean bfd_cache_delete PARAMS ((bfd *)); 47 47 48 48 /* … … 134 134 recently used cacheable BFD and close it. */ 135 135 136 static b oolean136 static bfd_boolean 137 137 close_one () 138 138 { … … 158 158 { 159 159 /* There are no open cacheable BFD's. */ 160 return true;160 return TRUE; 161 161 } 162 162 … … 168 168 /* Close a BFD and remove it from the cache. */ 169 169 170 static b oolean170 static bfd_boolean 171 171 bfd_cache_delete (abfd) 172 172 bfd *abfd; 173 173 { 174 b oolean ret;174 bfd_boolean ret; 175 175 176 176 if (fclose ((FILE *) abfd->iostream) == 0) 177 ret = true;177 ret = TRUE; 178 178 else 179 179 { 180 ret = false;180 ret = FALSE; 181 181 bfd_set_error (bfd_error_system_call); 182 182 } … … 195 195 196 196 SYNOPSIS 197 b oolean bfd_cache_init (bfd *abfd);197 bfd_boolean bfd_cache_init (bfd *abfd); 198 198 199 199 DESCRIPTION … … 201 201 */ 202 202 203 b oolean203 bfd_boolean 204 204 bfd_cache_init (abfd) 205 205 bfd *abfd; … … 209 209 { 210 210 if (! close_one ()) 211 return false;211 return FALSE; 212 212 } 213 213 insert (abfd); 214 214 ++open_files; 215 return true;215 return TRUE; 216 216 } 217 217 … … 221 221 222 222 SYNOPSIS 223 b oolean bfd_cache_close (bfd *abfd);223 bfd_boolean bfd_cache_close (bfd *abfd); 224 224 225 225 DESCRIPTION … … 228 228 229 229 RETURNS 230 << false>> is returned if closing the file fails, <<true>> is230 <<FALSE>> is returned if closing the file fails, <<TRUE>> is 231 231 returned if all is well. 232 232 */ 233 233 234 b oolean234 bfd_boolean 235 235 bfd_cache_close (abfd) 236 236 bfd *abfd; … … 238 238 if (abfd->iostream == NULL 239 239 || (abfd->flags & BFD_IN_MEMORY) != 0) 240 return true;240 return TRUE; 241 241 242 242 return bfd_cache_delete (abfd); … … 262 262 bfd *abfd; 263 263 { 264 abfd->cacheable = true; /* Allow it to be closed later. */264 abfd->cacheable = TRUE; /* Allow it to be closed later. */ 265 265 266 266 if (open_files >= BFD_CACHE_MAX_OPEN) … … 278 278 case both_direction: 279 279 case write_direction: 280 if (abfd->opened_once == true)280 if (abfd->opened_once) 281 281 { 282 282 abfd->iostream = (PTR) fopen (abfd->filename, FOPEN_RUB); … … 313 313 #endif 314 314 abfd->iostream = (PTR) fopen (abfd->filename, FOPEN_WUB); 315 abfd->opened_once = true;315 abfd->opened_once = TRUE; 316 316 } 317 317 break; … … 365 365 if (bfd_open_file (abfd) == NULL) 366 366 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) 368 370 return NULL; 369 371 } -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.