/[pgestraier]/trunk/pgest.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/pgest.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 48 by dpavlin, Thu Oct 20 16:24:26 2005 UTC revision 49 by dpavlin, Sat Oct 29 18:54:40 2005 UTC
# Line 359  char *attr2text(ESTDOC *doc, char *attr) Line 359  char *attr2text(ESTDOC *doc, char *attr)
359  #define _arg_node_uri 0  #define _arg_node_uri 0
360  #define _arg_login 1  #define _arg_login 1
361  #define _arg_passwd 2  #define _arg_passwd 2
362  #define _arg_query 3  #define _arg_depth 3
363  #define _arg_attr 4  #define _arg_query 4
364  #define _arg_order 5  #define _arg_attr 5
365  #define _arg_limit 6  #define _arg_order 6
366  #define _arg_offset 7  #define _arg_limit 7
367  #define _arg_attr_array 8  #define _arg_offset 8
368    #define _arg_attr_array 9
369  /* as (foo text, ... ); */  /* as (foo text, ... ); */
370    
371    
# Line 402  Datum pgest_node(PG_FUNCTION_ARGS) Line 403  Datum pgest_node(PG_FUNCTION_ARGS)
403          int resnum = 0;          int resnum = 0;
404          int limit = 0;          int limit = 0;
405          int offset = 0;          int offset = 0;
406            int depth = 0;
407    
408          char            *node_url;          char            *node_url;
409          char            *user, *passwd;          char            *user, *passwd;
# Line 479  Datum pgest_node(PG_FUNCTION_ARGS) Line 481  Datum pgest_node(PG_FUNCTION_ARGS)
481          user = _textout(PG_GETARG_TEXT_P(_arg_login));          user = _textout(PG_GETARG_TEXT_P(_arg_login));
482          passwd = _textout(PG_GETARG_TEXT_P(_arg_passwd));          passwd = _textout(PG_GETARG_TEXT_P(_arg_passwd));
483    
484            /* depth of search */
485            if (PG_ARGISNULL(_arg_depth)) {
486                    depth = 0;
487            } else {
488                    depth = PG_GETARG_INT32(_arg_depth);
489            }
490    
491          /* query string */          /* query string */
492          if (PG_ARGISNULL(_arg_query)) {          if (PG_ARGISNULL(_arg_query)) {
493                  query = "";                  query = "";
# Line 526  Datum pgest_node(PG_FUNCTION_ARGS) Line 535  Datum pgest_node(PG_FUNCTION_ARGS)
535          node = est_node_new(node_url);          node = est_node_new(node_url);
536          est_node_set_auth(node, user, passwd);          est_node_set_auth(node, user, passwd);
537    
538          elog(DEBUG1, "pgest_node: query[%s] attr[%s] limit %d offset %d", query, (PG_ARGISNULL(_arg_attr) ? "NULL" : attr), limit, offset);          elog(DEBUG1, "pgest_node: node: %s (d:%d) query[%s] attr[%s] limit %d offset %d", node_url, depth, query, (PG_ARGISNULL(_arg_attr) ? "NULL" : attr), limit, offset);
539                    
540          /* create a search condition object */          /* create a search condition object */
541          if (!(cond = est_cond_new())) {          if (!(cond = est_cond_new())) {
# Line 562  Datum pgest_node(PG_FUNCTION_ARGS) Line 571  Datum pgest_node(PG_FUNCTION_ARGS)
571          }          }
572    
573          /* get the result of search */          /* get the result of search */
574          /* FIXME: allow user to specify depath of search */          nres = est_node_search(node, cond, depth);
         nres = est_node_search(node, cond, 0);  
575    
576          if (! nres) {          if (! nres) {
577                  int status = est_node_status(node);                  int status = est_node_status(node);

Legend:
Removed from v.48  
changed lines
  Added in v.49

  ViewVC Help
Powered by ViewVC 1.1.26