.\" $Id: addnum.3,v 1.1 2002/03/08 13:51:01 fred Exp $ .\" @(#)addnum.2 2.11 91/08/22 ; Labo masi cao-vlsi; Author : Frederic Petrot .if t \{\ .XS \n% .ti 0.2i addnum .XE .XS4 \n% .ti 0.2i addnum .XE4 \} .TH ADDNUM 3 "October 1, 1997" "ASIM/LIP6" "MBK UTILITY FUNCTIONS" .SH NAME addnum \- create a \fBnum\fP and add it to a list .so jessie/alliance/alc_origin.1.en.gz .SH SYNOPSYS .nf .if n \{\ .ft B \} .if t \{\ .ft CR \} #include "mut.h" num_list \(**addnum(ptnum, data) num_list \(**ptnum; long data; .ft R .fi .SH PARAMETERS .TP 20 \fIptnum\fP Pointer to a \fBnum_list\fP .TP \fIdata\fP Value of the data .SH DESCRIPTION \fBaddnum\fP creates a new \fBnum\fP element and adds it to the front of the list pointed to by \fIptnum\fP, and becomes itself the list head. .br The \fIdata\fP fills the \fIDATA\fP field of the \fBnum\fP strucutre. For details on the structure, see \fBnum\fR(3). .SH RETURN VALUE \fBaddnum\fP returns a pointer to the new head of list. .SH EXAMPLE .ta 3n 6n 9n 12n 15n 18n 21n .nf .if n \{\ .ft B \} .if t \{\ .ft CR \} #include "mut.h" #include "mlo.h" void count(pn) num_list \(**pn; { num_list \(**c = NULL; /\(** initialized for regularity \(**/ while (pt) { if (pt\->TYPE == EXTERNAL) c = addnum(c, (void \(**)pt) pt = pt\->NEXT; } return c; } .ft R .fi .SH SEE ALSO .BR mbk (1), .BR num (3), .BR freenum (3). .so jessie/alliance/alc_bug_report.1.en.gz