freeheader.3
字号:
.\" Copyright (c) 1990 Entropic Research Laboratory, Inc. All rights reserved..\" @(#)freeheader.3 1.3 06 May 1997 ERL.TH FREE_HEADER 3\-ESPSu 06 May 1997.ds ]W "\fI\s+4\ze\h'0.05'e\s-4\v'-0.4m'\fP\(*p\v'0.4m'\ Entropic Research Laboratory, Inc..if t .ds - \(em\h'-0.2m'\(em.if n .ds - ---.SH NAMEfree_header \- free storage for an ESPS header.SH SYNOPSIS.ft Bvoid.brfree_header(hdr, flags, ptr).brstruct header *hdr;.brunsigned long flags;.brchar *ptr;.ft.SH DESCRIPTIONIf.I hdrpoints to an ESPS header,.I free_headerattempts to free storage for all parts of the header,including embedded headers.If.I hdris NULL,.I free_headersimply returns immediately.The arguments.I flagsand.I ptrare reserved for future elaboration of the functionand are ignored by the present version..PP.B "Use with CAUTION. This function is DANGEROUS."A header may share storage with other data structures in a C program,including other headers.Using.I free_headeron such a header will destroy part or all of the other data structures.Moreover, a header may contain pointers to storage that has not beenallocated by.IR malloc.Using.I free_headeron such a header will disrupt the memory-allocation mechanism by causing.I freeto be called with inappropriate arguments;``grave disorder'' will result, according to the.IR malloc (3)manual page..PPHere are some examples, by no means exhaustive, of problem situations.Afteradd_source_file(hdr_1, "name_2", hdr_2);freeing all of.I hdr_1will destroy.I hdr_2,and freeing all of.I hdr_2will destroy part of.I hdr_1.Afteradd_genhd_d("name", ptr, size, hdr);if the pointer argument.I ptris non-NULL, it is incorporated into the structure of.I hdr;if.I ptrpoints to a variable in the C program, rather than.IR malloc edstorage, freeing.I hdrwill bring disaster..PPWhen.I canyou use.IR free_header ?The safest rule is to use it only on headers that have been freshly read in by.IR read_header (3-ESPS)and have not been modified or included in other headers.With one exception, it is also safe to free a header that has been read by.IR eopen (3-ESPS)and has not been modified or included in another header.The exception is a header that.I eopenhas read from an old-style SD file and converted to FEA_SD (see the.IR eopen (3-ESPS)manual page).The resulting FEA_SD header should not be freed with.I free_header..SH EXAMPLE.SH DIAGNOSTICS.SH "FUTURE CHANGES"Allow use of the last two arguments to specify parts of the header that.I read_headershould not attempt to free..SH BUGSThis function can do great damage to a program's data structures if usedincautiously. Please read the advice in the ``Description'' section above..SH SEE ALSO.nfread_header(3-ESPSu), eopen(3-ESPSu),free_fea_rec(3-ESPSu), skip_header(3-ESPSu), add_source_file(3-ESPSu), add_genhd(3-ESPSu),malloc(3), free(3).fi.SH AUTHORRodney Johnson.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -