⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ldopen.3x

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 3X
字号:
.TH ldopen 3x RISC.SH Nameldopen, ldaopen, ldreadst \- open a common object file for reading.SH Syntax.nf.ta \w'\s-1LDFILE\s+1\ \ \ 'u.B #include <stdio.h>.B #include <filehdr.h>.B #include <syms.h>.B #include <ldfcn.h> .PP.BR "\s-1LDFILE\s+1 \(**ldopen (" "filename, ldptr" ).BR "char \(**" filename ;.BR "\s-1LDFILE\s+1 \(**" ldptr ;.PP.BR "\s-1LDFILE\s+1 \(**ldaopen (" "filename, oldptr" ).BR "char \(**" filename ;.BR "\s-1LDFILE\s+1 \(**" oldptr ;.PP.BR "\s-1ldreadst\s+1 (" "ldptr, flags").BR "\s-1LDFILE\s+1 \(**" ldptr;.BR "\s-1int" flags;.fi.DT.SH DescriptionThe .PN ldopenand.PN ldclosefunctions provide uniform access to simple object files andto object files that are members of archive files.An archiveof common object files can be processed as if it is a series ofsimple common object files..PPIf .I ldptrhas the value null, .PN ldopenopens.IR filename ,allocates and initializes the.B \s-1LDFILE\s+1structure, and returns a pointer tothe structure to the calling program..PPIf.I ldptris valid and.BI \s-1TYPE\s+1( ldptr )is the archive magic number,.PN ldopenreinitializes the.BR \s-1LDFILE\s+1 " structure"for the next archive member of.IR filename ..PPThe .PN ldopenand.PN ldclosefunctions work in concert.  The.PN ldclosefunction returns failure only when only when.BI \s-1TYPE\s+1( ldptr )is the archive magic number and there is another file in the archiveto be processed.Only then should.PN ldopenbe called with the current value of.IR ldptr .In all other cases, but especially when a new.I filenameis opened,.PN ldopenshould be called with a null.I ldptrargument..PPThe following is a prototype for the use of .PN ldopenand.ldclose:.EX/* for each filename to be processed*/.PPldptr = \s-1NULL\s+1;do	if ( (ldptr = ldopen(filename, ldptr)) != \s-1NULL\s+1 )	{		/* check magic number */		/* process the file */	}} while (ldclose(ldptr) == \s-1FAILURE\s+1 );.EE.PPIf the value of.I oldptris not.BR \s-1NULL\s+1\*S ,.PN ldaopenopens.I filenameanew and allocates and initializes a new.B \s-1LDFILE\s+1structure, copying thefields from.IR oldptr .The .PN ldaopenfunction returns a pointer to the new.BR \s-1LDFILE\s+1 " structure."This new pointer is independent of the old pointer,.IR oldptr .The two pointers can be used concurrently to read separate parts ofthe object file.For example,one pointer can be used to step sequentially through the relocation information while the other is used to read indexed symbol table entries..PPThe.PN ldopenand.PN ldaopenfunctions open.I filenamefor reading.If.I filenamecannot be opened or if memory for the.B \s-1LDFILE\s+1structure cannot be allocated,both functions return.SM \fBNULL\fR.A successful open does not ensure that the given file is a common objectfile or an archived object file.\}.PPThe .PN ldopenfunction causes the symbol table header and file descriptor table to be read.Further access, using .I ldptr,causes other appropriate sections of the symbol table to be read (for example, if you call .PN ldtbread, the symbols or externals are read).  To force sections for each symbol table inmemory, call .PN ldreadst with \fIST_P*\fR constants or'ed together from \fIst_support.h\fR..SH See Alsofopen(3s), ldclose(3x), ldfcn(5)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -