- /* Read the description length and text members. */
-
- if (bfd_read ((PTR) & nlm_variable_header (abfd)->descriptionLength,
- sizeof (nlm_variable_header (abfd)->descriptionLength),
- 1, abfd) !=
- sizeof (nlm_variable_header (abfd)->descriptionLength))
- return (false);
- if (bfd_read ((PTR) nlm_variable_header (abfd)->descriptionText,
- nlm_variable_header (abfd)->descriptionLength + 1,
- 1, abfd) !=
- nlm_variable_header (abfd)->descriptionLength + 1)
- return (false);
-
- /* Read and convert the stackSize field. */
-
- if (bfd_read ((PTR) temp, sizeof (temp), 1, abfd) != sizeof (temp))
- return (false);
- nlm_variable_header (abfd)->stackSize = get_word (abfd, (bfd_byte *) temp);
-
- /* Read and convert the reserved field. */
-
- if (bfd_read ((PTR) temp, sizeof (temp), 1, abfd) != sizeof (temp))
- return (false);
- nlm_variable_header (abfd)->reserved = get_word (abfd, (bfd_byte *) temp);
-
- /* Read the oldThreadName field. This field is a fixed length string. */
-
- if (bfd_read ((PTR) nlm_variable_header (abfd)->oldThreadName,
- sizeof (nlm_variable_header (abfd)->oldThreadName),
- 1, abfd) !=
- sizeof (nlm_variable_header (abfd)->oldThreadName))
- return (false);
-
- /* Read the screen name length and text members. */
-
- if (bfd_read ((PTR) & nlm_variable_header (abfd)->screenNameLength,
- sizeof (nlm_variable_header (abfd)->screenNameLength),
- 1, abfd) !=
- sizeof (nlm_variable_header (abfd)->screenNameLength))
- return (false);
- if (bfd_read ((PTR) nlm_variable_header (abfd)->screenName,
- nlm_variable_header (abfd)->screenNameLength + 1,
- 1, abfd) !=
- nlm_variable_header (abfd)->screenNameLength + 1)
- return (false);
-
- /* Read the thread name length and text members. */
-
- if (bfd_read ((PTR) & nlm_variable_header (abfd)->threadNameLength,
- sizeof (nlm_variable_header (abfd)->threadNameLength),
- 1, abfd) !=
- sizeof (nlm_variable_header (abfd)->threadNameLength))
- return (false);
- if (bfd_read ((PTR) nlm_variable_header (abfd)->threadName,
- nlm_variable_header (abfd)->threadNameLength + 1,
- 1, abfd) !=
- nlm_variable_header (abfd)->threadNameLength + 1)
- return (false);
- return (true);
-}
-
-/* Swap and write out the variable length header. All the fields must
- exist in the NLM, and must exist in this order. */
-
-static boolean
-nlm_swap_variable_header_out (abfd)
- bfd *abfd;
-{
- unsigned char temp[NLM_TARGET_LONG_SIZE];
-
- /* Write the description length and text members. */
-
- if (bfd_write ((PTR) & nlm_variable_header (abfd)->descriptionLength,
- sizeof (nlm_variable_header (abfd)->descriptionLength),
- 1, abfd) !=
- sizeof (nlm_variable_header (abfd)->descriptionLength))
- return (false);
- if (bfd_write ((PTR) nlm_variable_header (abfd)->descriptionText,
- nlm_variable_header (abfd)->descriptionLength + 1,
- 1, abfd) !=
- nlm_variable_header (abfd)->descriptionLength + 1)
- return (false);
-
- /* Convert and write the stackSize field. */
-
- put_word (abfd, (bfd_vma) nlm_variable_header (abfd)->stackSize,
- (bfd_byte *) temp);
- if (bfd_write ((PTR) temp, sizeof (temp), 1, abfd) != sizeof (temp))
- return (false);
-
- /* Convert and write the reserved field. */
-
- put_word (abfd, (bfd_vma) nlm_variable_header (abfd)->reserved,
- (bfd_byte *) temp);
- if (bfd_write ((PTR) temp, sizeof (temp), 1, abfd) != sizeof (temp))
- return (false);
-
- /* Write the oldThreadName field. This field is a fixed length string. */
-
- if (bfd_write ((PTR) nlm_variable_header (abfd)->oldThreadName,
- sizeof (nlm_variable_header (abfd)->oldThreadName),
- 1, abfd) !=
- sizeof (nlm_variable_header (abfd)->oldThreadName))
- return (false);
-
- /* Write the screen name length and text members. */
-
- if (bfd_write ((PTR) & nlm_variable_header (abfd)->screenNameLength,
- sizeof (nlm_variable_header (abfd)->screenNameLength),
- 1, abfd) !=
- sizeof (nlm_variable_header (abfd)->screenNameLength))
- return (false);
- if (bfd_write ((PTR) nlm_variable_header (abfd)->screenName,
- nlm_variable_header (abfd)->screenNameLength + 1,
- 1, abfd) !=
- nlm_variable_header (abfd)->screenNameLength + 1)
- return (false);
-
- /* Write the thread name length and text members. */
-
- if (bfd_write ((PTR) & nlm_variable_header (abfd)->threadNameLength,
- sizeof (nlm_variable_header (abfd)->threadNameLength),
- 1, abfd) !=
- sizeof (nlm_variable_header (abfd)->threadNameLength))
- return (false);
- if (bfd_write ((PTR) nlm_variable_header (abfd)->threadName,
- nlm_variable_header (abfd)->threadNameLength + 1,
- 1, abfd) !=
- nlm_variable_header (abfd)->threadNameLength + 1)
- return (false);
- return (true);