elf_strptr man page on HP-UX

Man page or keyword search:  
man Server   10987 pages
apropos Keyword Search (all sections)
Output format
HP-UX logo
[printable version]

elf_strptr(3E)							elf_strptr(3E)

NAME
       elf_strptr - make a string pointer

SYNOPSIS
       [flag... ] file...  [library] ...

DESCRIPTION
       This  function  converts	 a  string section offset to a string pointer.
       elf identifies the file in which the string section resides,  and  sec‐
       tion gives the section table index for the strings.  normally returns a
       pointer to a string, but it returns a null pointer when	elf  is	 null,
       section	is invalid or is not a section of type the section data cannot
       be obtained, offset is invalid, or an error occurs.

EXAMPLES
       A prototype for retrieving  section  names  appears  below.   The  file
       header specifies the section name string table in the member.  The fol‐
       lowing code loops through the sections, printing their names.

	       if ((ehdr = elf32_getehdr(elf)) == 0)
	       {
		       /* handle the error */
		       return;
	       }
	       ndx = ehdr->e_shstrndx;
	       scn = 0;
	       while ((scn = elf_nextscn(elf, scn)) != 0)
	       {
		       char    *name = 0;
		       if ((shdr = elf32_getshdr(scn)) != 0)
			   name = elf_strptr(elf, ndx,
					     (size_t)shdr->sh_name);
		       printf("'%s'\n", name? name: "(null)");
	       }

   Note
       A program may call to retrieve an entire	 string	 table	section.   For
       some  applications,  that  would be both more efficient and more conve‐
       nient than using

SEE ALSO
       elf(3E), elf_getdata(3E), elf_getshdr(3E), elf_xlate(3E).

								elf_strptr(3E)
[top]

List of man pages available for HP-UX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net