-/* lkrel.c */
+/* lkrel.c - .rel object file handling
+
+ Copyright (C) 1989-1995 Alan R. Baldwin
+ 721 Berkeley St., Kent, Ohio 44240
+ Copyright (C) 2008-2009 Borut Razem, borut dot razem at siol dot net
+
+This program is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/*
- * (C) Copyright 1989-1995
- * All Rights Reserved
- *
- * Alan R. Baldwin
- * 721 Berkeley St.
- * Kent, Ohio 44240
- *
* With contributions for the
* object libraries from
* Ken Hornstein
if (((c = getc (libfp)) == 'X' || c == 'D' || c == 'Q') && ((c = getc (libfp)) == 'H' || c == 'L'))
{
switch (getc (libfp))
- {
- case '\r':
- if (getc (libfp) == '\n')
- ret = 1;
- break;
-
- case '\n':
- ret = 1;
- }
+ {
+ case '\r':
+ if (getc (libfp) == '\n')
+ ret = 1;
+ break;
+
+ case '\n':
+ ret = 1;
+ }
}
else if (c == ';')
{
char buf[6];
if (fread (buf, 1, sizeof (buf), libfp) == sizeof (buf) && memcmp (buf, "!FILE ", 6) == 0)
- ret = 1;
+ ret = 1;
}
fseek (libfp, pos, SEEK_SET);
return ret;
end = (size >= 0) ? ftell (libfp) + size : -1;
while ((end < 0 || ftell (libfp) < end) && getline (str, sizeof (str), libfp) != NULL)
- {
- if (0 == strcmp (str, "</REL>"))
- return 1;
+ {
+ if (0 == strcmp (str, "</REL>"))
+ return 1;
- ip = str;
- link_main ();
- }
+ ip = str;
+ link_main ();
+ }
return 1;
}
* our object file and don't go into the next one.
*/
- while ((end <= 0 || ftell (fp) < end) && getline (buf, sizeof (buf), fp) != NULL)
+ while ((end < 0 || ftell (fp) < end) && getline (buf, sizeof (buf), fp) != NULL)
{
char symname[NINPUT];
char c;
* All 'S line's preceed 'T line's in .REL files.
*/
if (buf[0] == 'T')
- break;
+ break;
/*
* Skip everything that's not a symbol record.
*/
if (buf[0] != 'S')
- continue;
+ continue;
sscanf (buf, "S %s %c", symname, &c);
/* If it's an actual symbol, record it */
if (c == 'D')
- {
- if ((*func) (symname, param))
- return 1;
- }
+ {
+ if ((*func) (symname, param))
+ return 1;
+ }
}
return 0;