new, improved debug printing macros

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2315 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 2000-05-14 22:07:33 +00:00
parent 074869425e
commit 3b9bd3d549
5 changed files with 34 additions and 37 deletions

View File

@ -362,7 +362,7 @@ xaccCommitDateCell (DateCell *cell)
char buff[30];
if (!cell) return;
ENTER ("xaccCommitDateCell(): value is %s \n", cell->cell.value);
ENTER ("value is %s \n", cell->cell.value);
xaccParseDate (&(cell->date), cell->cell.value);
printDate (buff, cell->date.tm_mday,
cell->date.tm_mon+1,
@ -370,7 +370,7 @@ xaccCommitDateCell (DateCell *cell)
if (cell->cell.value) free (cell->cell.value);
cell->cell.value = strdup (buff);
LEAVE ("xaccCommitDateCell(): value is %s \n", cell->cell.value);
LEAVE ("value is %s \n", cell->cell.value);
}
/* ================================================ */

View File

@ -613,7 +613,7 @@ configLayout (SplitRegister *reg)
/* --------------------------------------------------------- */
default:
PERR ("configLayout(): unknown register type %d \n", type);
PERR ("unknown register type %d \n", type);
break;
}
}

View File

@ -439,7 +439,7 @@ doMoveCursor (Table *table, int new_phys_row, int new_phys_col,
int new_virt_row, new_virt_col;
CellBlock *curs;
ENTER("doMoveCursor(): new_phys=(%d %d) do_move_gui=%d\n",
ENTER("new_phys=(%d %d) do_move_gui=%d\n",
new_phys_row, new_phys_col, do_move_gui);
/* Change the cell background colors to their "passive" values.
@ -504,7 +504,7 @@ doMoveCursor (Table *table, int new_phys_row, int new_phys_col,
}
}
}
LEAVE("doMoveCursor(): out of bounds\n");
LEAVE("out of bounds\n");
return;
}
@ -576,7 +576,7 @@ doMoveCursor (Table *table, int new_phys_row, int new_phys_col,
}
curs->user_data = table->user_data[new_virt_row][new_virt_col];
LEAVE("doMoveCursor(): did move\n");
LEAVE("did move\n");
}
/* ==================================================== */
@ -635,7 +635,7 @@ void xaccCommitCursor (Table *table)
if (cell) {
int iphys = i + phys_row_origin;
int jphys = j + phys_col_origin;
/*PINFO ("xaccCommitCursor(): rowcol (%d,%d) oldval=%s newval=%s\n",
/*PINFO ("rowcol (%d,%d) oldval=%s newval=%s\n",
iphys, jphys, table->entries[iphys][jphys], cell->value);*/
if (table->entries[iphys][jphys]) {
free (table->entries[iphys][jphys]);
@ -824,7 +824,7 @@ wrapVerifyCursorPosition (Table *table, int row, int col)
if (!table) return;
ENTER("wrapVerifyCursorPosition(): (%d %d) val=%s\n",
ENTER("(%d %d) val=%s\n",
row,col, table->entries[row][col]);
/* VerifyCursor will do all sorts of gui-independent machinations */
@ -838,7 +838,7 @@ wrapVerifyCursorPosition (Table *table, int row, int col)
save_phys_row, save_phys_col, GNC_F);
}
LEAVE ("wrapVerifyCursorPosition()\n");
LEAVE ("\n");
}
/* ==================================================== */
@ -937,8 +937,7 @@ gnc_table_enter_update(Table *table, int row, int col, int *cursor_position,
const char * (*enter) (BasicCell *, const char *, int *, int *, int *);
ENTER("gnc_table_enter_update(): "
"enter %d %d (relrow=%d relcol=%d) cell=%p val=%s\n",
ENTER("enter %d %d (relrow=%d relcol=%d) cell=%p val=%s\n",
row, col, rel_row, rel_col,
arr->cells[rel_row][rel_col], table->entries[row][col]);
@ -989,7 +988,7 @@ gnc_table_enter_update(Table *table, int row, int col, int *cursor_position,
table->prev_phys_traverse_row = row;
table->prev_phys_traverse_col = col;
LEAVE("gnc_table_enter_update(): return %s\n", retval);
LEAVE("return %s\n", retval);
return retval;
}
@ -1005,7 +1004,7 @@ gnc_table_leave_update(Table *table, int row, int col,
const char * (*leave) (BasicCell *, const char *);
const char *retval = NULL;
ENTER("gnc_table_leave_update(): proposed (%d %d) rel(%d %d) \"%s\"\n",
ENTER("proposed (%d %d) rel(%d %d) \"%s\"\n",
row, col, rel_row, rel_col, callback_text);
if (!callback_text) callback_text = "";
@ -1050,7 +1049,7 @@ gnc_table_leave_update(Table *table, int row, int col,
retval = NULL;
}
LEAVE("gnc_table_leave_update(): return %s\n", retval);
LEAVE("return %s\n", retval);
return retval;
}
@ -1082,7 +1081,7 @@ gnc_table_modify_update(Table *table,
const char *retval = NULL;
ENTER ("gnc_table_modify_update()\n");
ENTER ("\n");
/* OK, if there is a callback for this cell, call it */
mv = arr->cells[rel_row][rel_col]->modify_verify;
@ -1120,8 +1119,7 @@ gnc_table_modify_update(Table *table,
free(help_str);
}
LEAVE ("gnc_table_modify_update(): "
"change %d %d (relrow=%d relcol=%d) cell=%p val=%s\n",
LEAVE ("change %d %d (relrow=%d relcol=%d) cell=%p val=%s\n",
row, col, rel_row, rel_col,
arr->cells[rel_row][rel_col], table->entries[row][col]);
@ -1224,7 +1222,7 @@ gnc_table_traverse_update(Table *table, int row, int col,
{
CellBlock *arr = table->current_cursor;
ENTER("gnc_table_traverse_update(): proposed (%d %d) -> (%d %d)\n",
ENTER("proposed (%d %d) -> (%d %d)\n",
row, col, *dest_row, *dest_col);
/* first, make sure our destination cell is valid. If it is out of
@ -1232,7 +1230,7 @@ gnc_table_traverse_update(Table *table, int row, int col,
if ((*dest_row >= table->num_phys_rows) || (*dest_row < 0) ||
(*dest_col >= table->num_phys_cols) || (*dest_col < 0))
{
PERR("gnc_table_traverse_update: destination (%d, %d) out of bounds (%d, %d)\n",
PERR("destination (%d, %d) out of bounds (%d, %d)\n",
*dest_row, *dest_col, table->num_phys_rows, table->num_phys_cols);
return GNC_T;
}
@ -1243,7 +1241,7 @@ gnc_table_traverse_update(Table *table, int row, int col,
if ((row >= table->num_phys_rows) || (row < 0) ||
(col >= table->num_phys_cols) || (col < 0)) {
PINFO("gnc_table_traverse_update: source (%d, %d) out of bounds (%d, %d)\n",
PINFO("source (%d, %d) out of bounds (%d, %d)\n",
row, col, table->num_phys_rows, table->num_phys_cols);
table->prev_phys_traverse_row = *dest_row;
table->prev_phys_traverse_col = *dest_col;
@ -1338,7 +1336,7 @@ gnc_table_traverse_update(Table *table, int row, int col,
table->prev_phys_traverse_row = *dest_row;
table->prev_phys_traverse_col = *dest_col;
LEAVE("gnc_table_traverse_update(): dest_row = %d, dest_col = %d\n",
LEAVE("dest_row = %d, dest_col = %d\n",
*dest_row, *dest_col);
return GNC_F;

View File

@ -89,7 +89,7 @@ xaccTableDumpHTML (Table * table, int fd)
fh = fdopen (fd, "a");
if (!fh) {
int norr = errno;
PERR ("xaccTableDumpHTML(): can't open fd=%d \n"
PERR ("can't open fd=%d \n"
"\t(%d) %s \n", fd, norr, strerror (norr));
return 0;
}
@ -156,7 +156,7 @@ xaccTablePrintHTML (Table * table, char *filename)
fd = open (filename, O_CREAT | O_APPEND | O_WRONLY, S_IRUSR | S_IWUSR);
if (0 > fd) {
int norr = errno;
PERR ("xaccTablePrintHTML(): can't open file %s\n"
PERR ("can't open file %s\n"
"\t(%d) %s\n", filename, norr, strerror (norr));
return 0;
}
@ -172,7 +172,7 @@ xaccTablePrintHTML (Table * table, char *filename)
#define CHKERR(val, msg) { \
if (0 > val) { \
int norr = errno; \
PERR ("Error: xaccTableWebServeHTML(): " msg "\n" \
PERR ( msg "\n" \
"(%d) %s \n", norr, strerror (norr)); \
if (pid) return; \
exit (0); \

View File

@ -166,7 +166,7 @@ enterCB (Widget mw, XtPointer cd, XtPointer cb) {
const char *new_text;
int cursor_pos, start, end; /* currently not used */
ENTER ("enterCB()\n");
ENTER ("\n");
new_text = gnc_table_enter_update(table, row, col,
&cursor_pos, &start, &end);
@ -182,7 +182,7 @@ enterCB (Widget mw, XtPointer cd, XtPointer cb) {
cbs->doit = True;
cbs->map = True;
}
LEAVE ("enterCB()\n");
LEAVE ("\n");
}
/* ==================================================== */
@ -203,7 +203,7 @@ modifyCB (Widget mw, XtPointer cd, XtPointer cb)
const char *retval;
char *newval;
ENTER("modifyCB()\n");
ENTER("\n");
/* accept edits by default, unless the cell handler rejects them */
cbs->verify->doit = True;
@ -244,7 +244,7 @@ modifyCB (Widget mw, XtPointer cd, XtPointer cb)
cbs->verify->doit = False;
free(newval);
}
LEAVE("modifyCB()\n");
LEAVE("\n");
}
/* ==================================================== */
@ -258,7 +258,7 @@ leaveCB (Widget mw, XtPointer cd, XtPointer cb)
const int row = cbs->row;
const int col = cbs->column;
const char * new_text;
ENTER("leaveCB()\n");
ENTER("\n");
new_text = gnc_table_leave_update(table, row, col, cbs->value);
@ -269,7 +269,7 @@ leaveCB (Widget mw, XtPointer cd, XtPointer cb)
/* by default, accept whatever the final proposed edit is */
cbs->doit = True;
LEAVE("leaveCB()\n");
LEAVE("\n");
}
@ -286,7 +286,7 @@ traverseCB (Widget mw, XtPointer cd, XtPointer cb)
gncTableTraversalDir dir;
ENTER ("traverseCB()\n");
ENTER ("\n");
if(cbs->qparam == QRight) dir = GNC_TABLE_TRAVERSE_RIGHT;
else if(cbs->qparam == QLeft) dir = GNC_TABLE_TRAVERSE_LEFT;
else if(cbs->qparam == QUp) dir = GNC_TABLE_TRAVERSE_UP;
@ -321,8 +321,7 @@ traverseCB (Widget mw, XtPointer cd, XtPointer cb)
}
}
} else {
PERR("traverseCB(): Invalid traversal direction. (%s)\n",
__FUNCTION__);
PERR("Invalid traversal direction\n");
return;
}
@ -338,7 +337,7 @@ traverseCB (Widget mw, XtPointer cd, XtPointer cb)
}
}
}
LEAVE ("traverseCB()\n");
LEAVE ("\n");
}
/* ==================================================== */
@ -538,7 +537,7 @@ GetColormapIndex (Table *table, unsigned int argb)
}
/*
* printf ("Info: GetColormapIndex(): \n"
* PINFO ("\n"
* "\tRequested rgb=0x%x r=0x%x g=0x%x b=0x%x \n"
* "\tfound idx=%d 0x%x 0x%x 0x%x\n", argb, r, g, b, idx,
* colors[idx].red, colors[idx].green, colors[idx].blue);
@ -616,10 +615,10 @@ xaccRefreshTableGUI (Table * table)
if (!(table->table_widget)) return;
DEBUGCMD ({int i;
printf (" refresh numphysrows=%d numphyscols=%d =========================\n",
fprintf (stderr, " refresh numphysrows=%d numphyscols=%d =========================\n",
table->num_phys_rows,table->num_phys_cols);
for (i=0; i<table->num_phys_rows; i++) {
printf ("cell %d\tcolor: 0x%x\tact:%s\tdescr: %s\tpay: %s\n", i,
fprintf (stderr, "cell %d\tcolor: 0x%x\tact:%s\tdescr: %s\tpay: %s\n", i,
table->bg_colors[i][3],
table->entries[i][2],
table->entries[i][3],