1*0a6a1f1dSLionel Sambuc.\" $NetBSD: elf_getarhdr.3,v 1.2 2014/03/09 16:58:04 christos Exp $ 2*0a6a1f1dSLionel Sambuc.\" 3*0a6a1f1dSLionel Sambuc.\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. 4*0a6a1f1dSLionel Sambuc.\" 5*0a6a1f1dSLionel Sambuc.\" Redistribution and use in source and binary forms, with or without 6*0a6a1f1dSLionel Sambuc.\" modification, are permitted provided that the following conditions 7*0a6a1f1dSLionel Sambuc.\" are met: 8*0a6a1f1dSLionel Sambuc.\" 1. Redistributions of source code must retain the above copyright 9*0a6a1f1dSLionel Sambuc.\" notice, this list of conditions and the following disclaimer. 10*0a6a1f1dSLionel Sambuc.\" 2. Redistributions in binary form must reproduce the above copyright 11*0a6a1f1dSLionel Sambuc.\" notice, this list of conditions and the following disclaimer in the 12*0a6a1f1dSLionel Sambuc.\" documentation and/or other materials provided with the distribution. 13*0a6a1f1dSLionel Sambuc.\" 14*0a6a1f1dSLionel Sambuc.\" This software is provided by Joseph Koshy ``as is'' and 15*0a6a1f1dSLionel Sambuc.\" any express or implied warranties, including, but not limited to, the 16*0a6a1f1dSLionel Sambuc.\" implied warranties of merchantability and fitness for a particular purpose 17*0a6a1f1dSLionel Sambuc.\" are disclaimed. in no event shall Joseph Koshy be liable 18*0a6a1f1dSLionel Sambuc.\" for any direct, indirect, incidental, special, exemplary, or consequential 19*0a6a1f1dSLionel Sambuc.\" damages (including, but not limited to, procurement of substitute goods 20*0a6a1f1dSLionel Sambuc.\" or services; loss of use, data, or profits; or business interruption) 21*0a6a1f1dSLionel Sambuc.\" however caused and on any theory of liability, whether in contract, strict 22*0a6a1f1dSLionel Sambuc.\" liability, or tort (including negligence or otherwise) arising in any way 23*0a6a1f1dSLionel Sambuc.\" out of the use of this software, even if advised of the possibility of 24*0a6a1f1dSLionel Sambuc.\" such damage. 25*0a6a1f1dSLionel Sambuc.\" 26*0a6a1f1dSLionel Sambuc.\" Id: elf_getarhdr.3 189 2008-07-20 10:38:08Z jkoshy 27*0a6a1f1dSLionel Sambuc.\" 28*0a6a1f1dSLionel Sambuc.Dd August 15, 2006 29*0a6a1f1dSLionel Sambuc.Os 30*0a6a1f1dSLionel Sambuc.Dt ELF_GETARHDR 3 31*0a6a1f1dSLionel Sambuc.Sh NAME 32*0a6a1f1dSLionel Sambuc.Nm elf_getarhdr 33*0a6a1f1dSLionel Sambuc.Nd retrieve ar(1) header for an archive member 34*0a6a1f1dSLionel Sambuc.Sh LIBRARY 35*0a6a1f1dSLionel Sambuc.Lb libelf 36*0a6a1f1dSLionel Sambuc.Sh SYNOPSIS 37*0a6a1f1dSLionel Sambuc.In libelf.h 38*0a6a1f1dSLionel Sambuc.Ft "Elf_Arhdr *" 39*0a6a1f1dSLionel Sambuc.Fn elf_getarhdr "Elf *elf" 40*0a6a1f1dSLionel Sambuc.Sh DESCRIPTION 41*0a6a1f1dSLionel SambucThe 42*0a6a1f1dSLionel Sambuc.Fn elf_getarhdr 43*0a6a1f1dSLionel Sambucfunction returns a pointer to an archive member header for 44*0a6a1f1dSLionel Sambuca descriptor 45*0a6a1f1dSLionel Sambuc.Ar elf . 46*0a6a1f1dSLionel SambucThis descriptor must have been returned by a prior call to 47*0a6a1f1dSLionel Sambuc.Xr elf_begin 3 , 48*0a6a1f1dSLionel Sambucand must be a descriptor for a member inside an 49*0a6a1f1dSLionel Sambuc.Xr ar 1 50*0a6a1f1dSLionel Sambucarchive. 51*0a6a1f1dSLionel Sambuc.Pp 52*0a6a1f1dSLionel SambucStructure 53*0a6a1f1dSLionel Sambuc.Vt Elf_Arhdr 54*0a6a1f1dSLionel Sambucincludes the following members: 55*0a6a1f1dSLionel Sambuc.Bl -tag -width indent 56*0a6a1f1dSLionel Sambuc.It Vt "char *" Va ar_name 57*0a6a1f1dSLionel SambucA pointer to a null terminated string containing the translated 58*0a6a1f1dSLionel Sambucname of the archive member. 59*0a6a1f1dSLionel Sambuc.It Vt "char *" Va ar_rawname 60*0a6a1f1dSLionel SambucA pointer to a null terminated string containing the untranslated 61*0a6a1f1dSLionel Sambucname for the archive member, including all 62*0a6a1f1dSLionel Sambuc.Xr ar 1 63*0a6a1f1dSLionel Sambucformatting characters and trailing white space. 64*0a6a1f1dSLionel Sambuc.It Vt time_t Va ar_date 65*0a6a1f1dSLionel SambucThe timestamp associated with the member. 66*0a6a1f1dSLionel Sambuc.It Vt uid_t Va ar_uid 67*0a6a1f1dSLionel SambucThe uid of the creator of the member. 68*0a6a1f1dSLionel Sambuc.It Vt gid_t Va ar_gid 69*0a6a1f1dSLionel SambucThe gid of the creator of the member. 70*0a6a1f1dSLionel Sambuc.It Vt mode_t Va ar_mode 71*0a6a1f1dSLionel SambucThe file mode of the member. 72*0a6a1f1dSLionel Sambuc.It Vt size_t Va ar_size 73*0a6a1f1dSLionel SambucThe size of the member in bytes. 74*0a6a1f1dSLionel Sambuc.El 75*0a6a1f1dSLionel Sambuc.Sh RETURN VALUES 76*0a6a1f1dSLionel SambucThis function returns a valid pointer to an 77*0a6a1f1dSLionel Sambuc.Vt Elf_Arhdr 78*0a6a1f1dSLionel Sambucstructure if successful, or NULL if an error is encountered. 79*0a6a1f1dSLionel Sambuc.Sh ERRORS 80*0a6a1f1dSLionel SambucFunction 81*0a6a1f1dSLionel Sambuc.Fn elf_getarhdr 82*0a6a1f1dSLionel Sambucmay fail with the following errors: 83*0a6a1f1dSLionel Sambuc.Bl -tag -width "[ELF_E_RESOURCE]" 84*0a6a1f1dSLionel Sambuc.It Bq Er ELF_E_ARGUMENT 85*0a6a1f1dSLionel SambucArgument 86*0a6a1f1dSLionel Sambuc.Ar elf 87*0a6a1f1dSLionel Sambucwas NULL. 88*0a6a1f1dSLionel Sambuc.It Bq Er ELF_E_ARGUMENT 89*0a6a1f1dSLionel SambucArgument 90*0a6a1f1dSLionel Sambuc.Ar elf 91*0a6a1f1dSLionel Sambucwas not a descriptor for a member of an 92*0a6a1f1dSLionel Sambuc.Xr ar 1 93*0a6a1f1dSLionel Sambucarchive. 94*0a6a1f1dSLionel Sambuc.El 95*0a6a1f1dSLionel Sambuc.Sh SEE ALSO 96*0a6a1f1dSLionel Sambuc.Xr elf 3 , 97*0a6a1f1dSLionel Sambuc.Xr elf_begin 3 , 98*0a6a1f1dSLionel Sambuc.Xr elf_getarsym 3 , 99*0a6a1f1dSLionel Sambuc.Xr elf_memory 3 100