ref: 34f19570b92951e7f55df787d5dc457eb2c9de46
parent: 6a23ef917bfdb41415dc36be5cd8b8e8e64ddc23
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Jan 27 18:46:48 EST 2018
libndb: retire deprecated csgetval(), ndbgetval() and ndblookval() functions
--- a/sys/include/ndb.h
+++ b/sys/include/ndb.h
@@ -124,7 +124,6 @@
#define NDB_IPlen 16
-Ndbtuple* csgetval(char*, char*, char*, char*, char*);
char* csgetvalue(char*, char*, char*, char*, Ndbtuple**);
Ndbtuple* csipinfo(char*, char*, char*, char**, int);
Ndbtuple* dnsquery(char*, char*, char*);
@@ -136,12 +135,10 @@
Ndbtuple* ndbdiscard(Ndbtuple*, Ndbtuple*);
void ndbfree(Ndbtuple*);
Ndbtuple* ndbgetipaddr(Ndb*, char*);
-Ndbtuple* ndbgetval(Ndb*, Ndbs*, char*, char*, char*, char*);
char* ndbgetvalue(Ndb*, Ndbs*, char*, char*, char*, Ndbtuple**);
Ndbtuple* ndbfindattr(Ndbtuple*, Ndbtuple*, char*);
ulong ndbhash(char*, int);
Ndbtuple* ndbipinfo(Ndb*, char*, char*, char**, int);
-Ndbtuple* ndblookval(Ndbtuple*, Ndbtuple*, char*, char*);
Ndbtuple* ndbnew(char*, char*);
Ndb* ndbopen(char*);
Ndbtuple* ndbparse(Ndb*);
--- a/sys/man/2/ndb
+++ b/sys/man/2/ndb
@@ -1,6 +1,6 @@
.TH NDB 2
.SH NAME
-ndbopen, ndbcat, ndbchanged, ndbclose, ndbreopen, ndbsearch, ndbsnext, ndbgetvalue, ndbfree, ipattr, ndbgetipaddr, ndbipinfo, csipinfo, ndbhash, ndbparse, csgetvalue, ndbfindattr, dnsquery, ndbdiscard, ndbconcatenate, ndbreorder, ndbsubstitute, ndbgetval, csgetval, ndblookval \- network database
+ndbopen, ndbcat, ndbchanged, ndbclose, ndbreopen, ndbsearch, ndbsnext, ndbgetvalue, ndbfree, ipattr, ndbgetipaddr, ndbipinfo, csipinfo, ndbhash, ndbparse, csgetvalue, ndbfindattr, dnsquery, ndbdiscard, ndbconcatenate, ndbreorder, ndbsubstitute \- network database
.SH SYNOPSIS
.B #include <u.h>
.br
@@ -300,9 +300,9 @@
is to
.I ndbipinfo
as
-.I csgetval
+.I csgetvalue
is to
-.IR ndbgetval .
+.IR ndbgetvalue .
.PP
The next three routines are used by programs that create the
hash tables and database files.
@@ -493,28 +493,3 @@
.SH SEE ALSO
.IR ndb (6),
.IR ndb (8)
-.SH DIAGNOSTICS
-.IR Ndbgetvalue ,
-.IR csgetvalue ,
-and
-.I ndblookvalue
-set
-.I errstr
-to
-.L "buffer too short"
-if the buffer provided isn't long enough for the
-returned value.
-.SH BUGS
-.IR Ndbgetval ,
-.IR csgetval ,
-and
-.I ndblookval
-are deprecated versions of
-.IR ndbgetvalue ,
-.IR csgetvalue ,
-and
-.IR ndblookvalue .
-They expect a fixed 64 byte long result
-buffer and existed when the values of a
-.I Ndbtuple
-structure were fixed length.
--- a/sys/src/libndb/csgetval.c
+++ b/sys/src/libndb/csgetval.c
@@ -85,24 +85,3 @@
return rv;
}
-
-Ndbtuple*
-csgetval(char *netroot, char *attr, char *val, char *rattr, char *buf)
-{
- Ndbtuple *t;
- char *p;
-
- p = csgetvalue(netroot, attr, val, rattr, &t);
- if(p == nil){
- if(buf != nil)
- *buf = 0;
- } else {
- if(buf != nil){
- strncpy(buf, p, Ndbvlen-1);
- buf[Ndbvlen-1] = 0;
- }
- free(p);
- }
- ndbsetmalloctag(t, getcallerpc(&netroot));
- return t;
-}
--- a/sys/src/libndb/ndbgetval.c
+++ b/sys/src/libndb/ndbgetval.c
@@ -53,24 +53,3 @@
}
return nil;
}
-
-Ndbtuple*
-ndbgetval(Ndb *db, Ndbs *s, char *attr, char *val, char *rattr, char *buf)
-{
- Ndbtuple *t;
- char *p;
-
- p = ndbgetvalue(db, s, attr, val, rattr, &t);
- if(p == nil){
- if(buf != nil)
- *buf = 0;
- } else {
- if(buf != nil){
- strncpy(buf, p, Ndbvlen-1);
- buf[Ndbvlen-1] = 0;
- }
- free(p);
- }
- ndbsetmalloctag(t, getcallerpc(&db));
- return t;
-}
--- a/sys/src/libndb/ndblookval.c
+++ b/sys/src/libndb/ndblookval.c
@@ -29,16 +29,3 @@
return nil;
}
-
-Ndbtuple*
-ndblookval(Ndbtuple *entry, Ndbtuple *line, char *attr, char *to)
-{
- Ndbtuple *t;
-
- t = ndbfindattr(entry, line, attr);
- if(t != nil){
- strncpy(to, t->val, Ndbvlen-1);
- to[Ndbvlen-1] = 0;
- }
- return t;
-}