File: new_Record.3

package info (click to toggle)
coldsync 2.2.5-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 2,824 kB
  • ctags: 1,660
  • sloc: ansic: 19,234; cpp: 1,854; perl: 1,377; yacc: 951; lex: 759; makefile: 445; sh: 176
file content (75 lines) | stat: -rw-r--r-- 1,783 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.\" new_Record.3
.\" 
.\" Copyright 2001, Andrew Arensburger.
.\" You may distribute this file under the terms of the Artistic
.\" License, as specified in the README file.
.\"
.\" $Id: new_Record.3,v 1.1 2001/11/20 14:35:17 arensb Exp $
.\"
.\" This man page uses the 'mdoc' formatting macros. If your 'man' uses
.\" the old 'man' package, you may run into problems.
.\"
.Dd Aug 16, 2001
.Dt new_Record 3
.Sh NAME
.Nm new_Record
.Nd short description
.Sh LIBRARY
.Pa libpdb
.Sh SYNOPSIS
.Fd #include <pdb.h>
.Ft struct pdb *
.Fn new_Record "const ubyte flags" "const ubyte category" "const udword id" "const uword len" "const ubyte *data"
.Ft void
.Fn pdb_FreeRecord "struct pdb_record *rec"
.Ft struct pdb_resource *
.Fn new_Resource "const udword type" "const uword id" "const uword len" "const ubyte *data"
.Ft void
.Fn pdb_FreeResource "struct pdb_resource *rsrc"
.Sh DESCRIPTION
.Nm new_Record
allocates space for a new
.Ft struct pdb_record
and initializes it from the given variables.
.Fa flags
is the bitwise-or of zero or more of the
.Dv PDB_REC_*
flags from
.Pa <pdb.h> .
.Fa category
is an index into the database's category table, if it has one.
.Fa id
is the record's ID.
.Fa len
is the length of the data pointed to by
.Fa data .
The record's data will be initialized from this. The data is copied.
.Pp
.Nm new_Resource
is similar to
.Nm new_Record ,
but allocates a new
.Ft struct pdb_resource .
.Pp
.Nm pdb_FreeRecord
frees a
.Ft struct pdb_record
allocated by
.Nm new_Record .
.Pp
.Nm pdb_FreeResource
frees a
.Ft struct pdb_resource
allocated by
.Nm new_Resource .
.Sh RETURN VALUE
.Nm new_Record
and
.Nm new_Resource
return a pointer to the new
.Ft struct pdb_record
or
.Ft struct pdb_resource
if successful, or NULL in case of error.
.Sh SEE ALSO
.Xr libpdb 3 .