Update of /cvsroot/monetdb/pathfinder/runtime
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv9272
Modified Files:
xrpc_server.mx
Log Message:
forgot to remove unused functions
U xrpc_server.mx
Index: xrpc_server.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/xrpc_server.mx,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- xrpc_server.mx 7 Apr 2008 12:54:14 -0000 1.60
+++ xrpc_server.mx 7 Apr 2008 12:56:06 -0000 1.61
@@ -347,43 +347,6 @@
return 0;
}
-#if 0
-/**
- * Calculate the number of *nodes* which has the name "node_name" and
- * are within the range 'start_pre' and 'end_pre' (inclusive).
- *
- * @return the number of nodes found
- */
-static lng
-count_node(char *node_name,
- char *ns,
- oid start_pre,
- oid end_pre,
- oid *pre_prop,
- char *pre_kind,
- BAT *qn_loc,
- BAT *qn_uri)
-{
- lng nr = 0;
- oid i;
-
- for (i = start_pre; i <= end_pre; i++) {
- if (pre_kind[i] == ELEMENT) {
- BATiter qn_loci = bat_iterator(qn_loc);
- BATiter qn_urii = bat_iterator(qn_uri);
- char *qname = BUNtail(qn_loci,
- BUNfnd(qn_loc, &(pre_prop[i])));
- char *qname_uri = BUNtail(qn_urii,
- BUNfnd(qn_uri, &(pre_prop[i])));
- if(strcmp(qname, node_name) == 0 &&
- strcmp(qname_uri, ns)== 0)
- nr++;
- }
- }
- return nr;
-}
-#endif
-
/**
* Find the 'pre' value of the first node between 'start_pre' and
* 'end_pre' (inclusive), which kind is 'elem_kind'.
@@ -406,119 +369,6 @@
return 0;
}
-#if 0
-/**
- * Given a 'node_name', find the 'pre' value of the first node between
- * 'start_pre' and 'end_pre' (inclusive), which kind is 'elem_kind'.
- *
- * @return the 'pre' value of this node, or
- * 0 if such node can not be found.
- */
-static oid
-get_elem_pre_by_name(char *node_name,
- char *ns,
- oid start_pre,
- oid end_pre,
- char elem_kind,
- oid *pre_prop,
- char *pre_kind,
- BAT *qn_loc,
- BAT *qn_uri)
-{
- oid i;
-
- for (i = start_pre; i <= end_pre; i++) {
- if (pre_kind[i] == elem_kind) {
- BATiter qn_loci = bat_iterator(qn_loc);
- BATiter qn_urii = bat_iterator(qn_uri);
- char *qname = BUNtail(qn_loci,
- BUNfnd(qn_loc, &(pre_prop[i])));
- char *qname_uri = BUNtail(qn_urii,
- BUNfnd(qn_uri, &(pre_prop[i])));
- if(strcmp(qname, node_name) == 0 &&
- strcmp(qname_uri, ns)== 0)
- return i;
- }
- }
- return 0;
-}
-
-/**
- * Find the value of the attribute 'attr_name', which is owned by the
- * node with the given 'pre' value.
- *
- * NB: DO NOT free the string returned by this function, because it is
- * not copied!!!
- *
- * @return The value of the attribute 'attr_name', or
- * NULL if attribute with such name was not found.
- */
-static char *
-get_attr_val(stream *out,
- int optional,
- char *attr_name,
- char *ns,
- oid pre,
- size_t nattrs,
- oid *attr_own,
- oid *attr_qn,
- oid *attr_prop,
- BAT *qn_loc,
- BAT *qn_uri,
- BAT *prop_val)
-{
- oid qn = oid_nil ;
- size_t i = 0;
- int first = 0, len = 0;
- char *err = NULL;
-
- len = strlen(attr_name) + strlen(ns) + 128;
- err = alloca(len); assert(err);
-
- /* Get the 'qn' of 'attr_name'. For now, all XRPC attributes may
- * appear only once in the message, so the combination of ns+loc
- * should be unique. */
- BAT *qns = BATselect(qn_loc, attr_name, attr_name);
- BAT *nss = BATselect(qn_uri, ns, ns);
- BAT *match = BATkintersect(qns, nss);
-
- i = BATcount(match);
- if(i > 1){
- snprintf(err, len, "Invalid XRPC request message: multiple "
- "definitions of attribute %s:%s\n", ns, attr_name);
- send_err(out, ERR404, "env:Sender", err);
- BBPreclaim(qns);
- BBPreclaim(nss);
- BBPreclaim(match);
- return NULL;
- } else if (i == 1) {
- BATiter matchi = bat_iterator(match), prop_vali =
bat_iterator(prop_val);
- qn = *(oid*) BUNhead(matchi, BUNfirst(match));
-
- BBPreclaim(qns);
- BBPreclaim(nss);
- BBPreclaim(match);
-
- /* try to find the attribute value */
- for (i = 0; i < nattrs; i++) {
- if (attr_own[i] > pre) break;
- if (attr_own[i] == pre && attr_qn[i] == qn) {
- first = BUNfirst(prop_val) + attr_prop[i];
- return (char*) BUNtail(prop_vali, first);
- }
- }
- }
-
- if(!optional) {
- snprintf(err, len,
- "Could not find required attribute \"%s:%s\"",
- ns, attr_name);
- send_err(out, ERR404, "env:Sender", err);
- }
- return NULL;
-}
-#endif
-
/**
* Given the pre value of a type node, return the name of the type node
* as a string in the form 'ns_uri:loc'.
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Register now and save $200. Hurry, offer ends at 11:59 p.m.,
Monday, April 7! Use priority code J8TLD2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins