/[pgswish]/trunk/pgswish.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/pgswish.c

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

revision 16 by dpavlin, Sun Feb 20 21:51:56 2005 UTC revision 17 by dpavlin, Sun Feb 20 21:54:39 2005 UTC
# Line 198  Datum pgswish(PG_FUNCTION_ARGS) { Line 198  Datum pgswish(PG_FUNCTION_ARGS) {
198                  pfree(values[3]);                  pfree(values[3]);
199                  pfree(values);                  pfree(values);
200                                    
201                  elog(INFO, "row: %s|%s|%s|%s",values[0],values[1],values[2],values[3]);                  elog(DEBUG1, "row: %s|%s|%s|%s",values[0],values[1],values[2],values[3]);
202                    
203                  SRF_RETURN_NEXT(funcctx, result);                  SRF_RETURN_NEXT(funcctx, result);
204          } else {          } else {
# Line 301  char *prop2text(SW_RESULT sw_res, char * Line 301  char *prop2text(SW_RESULT sw_res, char *
301          char *prop;          char *prop;
302          int len;          int len;
303    
304          elog(DEBUG1, "prop2text(%s)", propname);          elog(DEBUG2, "prop2text(%s)", propname);
305    
306          prop = SwishResultPropertyStr( sw_res, propname );          prop = SwishResultPropertyStr( sw_res, propname );
307          error_or_abort( swish_handle );          error_or_abort( swish_handle );
308    
309          len = strlen(prop);          len = strlen(prop);
310          elog(INFO, "prop2text(%s) = '%s' %d bytes", propname, prop, len);          elog(DEBUG1, "prop2text(%s) = '%s' %d bytes", propname, prop, len);
311    
312          len++;          len++;
313          len *= sizeof(char);          len *= sizeof(char);
314    
315          elog(DEBUG1, "palloc(%d)", len);          elog(DEBUG2, "palloc(%d)", len);
316    
317          val = palloc(len);          val = palloc(len);
318    
319          memset(val, 0, len);          memset(val, 0, len);
320          strncpy(val, prop, len);          strncpy(val, prop, len);
321    
322          elog(DEBUG1, "val=%s", val);          elog(DEBUG2, "val=%s", val);
323    
324          return val;          return val;
325  }  }
# Line 330  char *prop2int(SW_RESULT sw_res, char *p Line 330  char *prop2int(SW_RESULT sw_res, char *p
330          unsigned long prop;          unsigned long prop;
331          int len;          int len;
332    
333          elog(DEBUG1, "prop2int(%s)", propname);          elog(DEBUG2, "prop2int(%s)", propname);
334    
335          prop = SwishResultPropertyULong( sw_res, propname );          prop = SwishResultPropertyULong( sw_res, propname );
336          error_or_abort( swish_handle );          error_or_abort( swish_handle );
337    
338          elog(INFO, "prop2int(%s) = %lu", propname, prop);          elog(DEBUG1, "prop2int(%s) = %lu", propname, prop);
339    
340          len = 128 * sizeof(char);          len = 128 * sizeof(char);
341          elog(DEBUG1, "palloc(%d)", len);          elog(DEBUG2, "palloc(%d)", len);
342    
343          val = palloc(len);          val = palloc(len);
344          memset(val, 0, len);          memset(val, 0, len);
345    
346          snprintf(val, len, "%lu", prop);          snprintf(val, len, "%lu", prop);
347    
348          elog(DEBUG1, "val=%s", val);          elog(DEBUG2, "val=%s", val);
349    
350          return val;          return val;
351  }  }

Legend:
Removed from v.16  
changed lines
  Added in v.17

  ViewVC Help
Powered by ViewVC 1.1.26