stio.3
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 3 代码 · 共 135 行
3
135 行
.TH stio 3 RISC.SH Namest_readbinary, st_readst, st_writebinary, st_writest \- routines that provide a binary read/write interface to the MIPS symbol table.SH Syntax.nf.B #include <syms.h>.PP.ft Blong st_readbinary (filename, how)char *filename;char how;.PP.ft Blong st_readst (fn, how, filebase, pchdr, flags)long fn;char how;long filebase;pCHDRR pchdr;long flags;.PP.ft Bvoid st_writebinary (filename, flags)char *filename;long flags;.PP.ft Bvoid st_writest (fn, flags)long fn;long flags;.PP.fi.ft R.br.SH Description.PPThe CHDRR structure (see .B cmplrs/stsupport.h and the .MS stcu 3 ).represents a symbol table in memory. A new CHDRR can be created by reading a symbol table in from disk. The.I st_readbinaryand.I st_readstroutines read a symbol table in from disk..PPThe routine.I st_readbinary\fRtakes the file name of the symbol table and assumes the symbol table header.I (HDRRin .B sym.hoccurs at the beginning of the file. The.I st_readstassumes that its file number references a file positioned at the beginning of the symbol table header and that the.I filebaseparameter specifies where the object or symbol table file is based (forexample,non-zero for archives)..PPThe second parameter to the read routines can be r for read only or a for appending to the symbol table. Existing local symbol, line,procedure, auxiliary, optimization, and local string tables cannot be appended. If theydidn't exist on disk, they can be created. This restriction stems from theallocation algorithm for those symbol table sections when read in from diskand follows the standard pattern for building the symbol table..PPThe symbol table can be read incrementally. If .I pchdr is zero, .I st_readst assumes that a symbol table has not been read yet; therefore,it reads in the symbol table header and file descriptors. The .I flagsargument is a bit mask that defines what other tables should be read. The.I t_p* constants for each table, defined in stsupport.h, can be ORed. If \fIflags\fR equals -1, all tables are read. If .I pchdr is set,the tables specified by .I flags are added to the tables that have already been read. The.I pchdr's value can be taken from .I st_current_pchdr. See .MS stcu 3..PPLine number entries are encoded on disk; the read routines expand themto longs. .PPIf the version stamp is out of date, a warning message is issued to stderr.If the magic number in the HDRR is incorrect, .I st_error is called. All other errors cause the read routines to read non-zero; otherwise, a zero is returned..PPThe routines.I st_writebinaryand.I st_writestare symmetric to the read routines, excluding the .I how and .I pchdrparameters. The .I flags parameter is a bit mask that defines what table should be written. The.I st_p* constants for each table, defined in.I stsupport.h,can be ORed. If .I flagsequals -1, all tables are written..PPThe write routines write sections of the table in the approvedorder, as specified in the link editor .MS ld 1 specification..PPLine numbers are compressed on disk. .PPThe write routines start all sections of the symboltable on four-byte boundaries..PPIf the write routines encounter an error, .I st_error is called. After writing the symbol table, further access to the table by other routines is undefined..SH See Alsostcu(3), stfe(3), stfd(3), sym.h(5), sterror(5)stsupport.h(5)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?