72 lines
1.7 KiB
Groff
72 lines
1.7 KiB
Groff
|
.\" $Id: JAM_PutSubfield.3,v 1.1 2002/11/09 00:37:16 raorn Exp $
|
||
|
.\"
|
||
|
.TH JAM_PutSubfield 3 2002-11-07 "" "JAM subroutine library"
|
||
|
.SH NAME
|
||
|
JAM_PutSubfield \- Put a subfield into a subfield packet
|
||
|
.SH SYNOPSIS
|
||
|
.nf
|
||
|
.B #include <jamlib/jam.h>
|
||
|
|
||
|
.BI "int JAM_PutSubfield(s_JamSubPacket* " SubPack_PS ","
|
||
|
.BI " s_JamSubfield* " Subfield_PS ");"
|
||
|
.RE
|
||
|
.fi
|
||
|
.SH DESCRIPTION
|
||
|
Puts a subfield into a subfield packet. The subfield is copied
|
||
|
before being put into the subfield packet.
|
||
|
.SS Arguments
|
||
|
.TP
|
||
|
.I SubPack_PS
|
||
|
The subfield packet to add to
|
||
|
.TP
|
||
|
.I Subfield_PS
|
||
|
The subfield to put in the packet
|
||
|
.SH "RETURN VALUE"
|
||
|
.TP
|
||
|
.B 0
|
||
|
if successful
|
||
|
.TP
|
||
|
.B JAM_NO_MEMORY
|
||
|
if a memory allocation failed
|
||
|
.SH EXAMPLES
|
||
|
.nf
|
||
|
s_JamSubPacket* SubPacket_PS;
|
||
|
s_JamSubfield Subfield_S;
|
||
|
uchar Field_AC[64];
|
||
|
|
||
|
SubPacket_PS = JAM_NewSubPacket();
|
||
|
if (!SubPacket_PS) {
|
||
|
printf("JAM_NewSubPacket returned NULL.\\n");
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
/* set up subfield 1 */
|
||
|
strcpy(Field_AC, "This is field #1");
|
||
|
Subfield_S.LoID = JAMSFLD_SENDERNAME;
|
||
|
Subfield_S.HiID = 0;
|
||
|
Subfield_S.DatLen = strlen(Field_AC);
|
||
|
Subfield_S.Buffer = Field_AC;
|
||
|
JAM_PutSubfield(SubPacket_PS, &Subfield_S);
|
||
|
|
||
|
/* set up subfield 2 */
|
||
|
strcpy(Field_AC, "This is field #2");
|
||
|
Subfield_S.LoID = JAMSFLD_RECVRNAME;
|
||
|
Subfield_S.HiID = 0;
|
||
|
Subfield_S.DatLen = strlen(Field_AC);
|
||
|
Subfield_S.Buffer = Field_AC;
|
||
|
JAM_PutSubfield(SubPacket_PS, &Subfield_S);
|
||
|
|
||
|
JAM_DelSubPacket(SubPacket_PS);
|
||
|
.fi
|
||
|
.SH AUTHOR
|
||
|
This manual page was created by Sir Raorn <raorn@altlinux.ru>,
|
||
|
based on original JAMlib documentation by Bjorn Stenberg
|
||
|
<bjorn@haxx.nu> and Johan Billing <billing@df.lth.se>.
|
||
|
.SH SEE ALSO
|
||
|
.BR jamlib (3),
|
||
|
.BR JAM_GetSubfield (3),
|
||
|
.BR JAM_GetSubfield_R (3),
|
||
|
.BR JAM_NewSubPacket (3),
|
||
|
.BR JAM_DelSubPacket (3)
|
||
|
.\" vim: ft=nroff
|