#include "gedcom.h"
char* null_str = "(null)";
+char* non_null_ptr = "0x<non-null>";
+char* null_ptr = "0x<null>";
char* chk(char* input)
{
return null_str;
}
+char* ptr_val(void* ptr)
+{
+ if (ptr)
+ return non_null_ptr;
+ else
+ return null_ptr;
+}
+
char* make_prefix(int depth)
{
char* prefix = (char*)calloc(depth+1, sizeof(char));
}
}
else {
- output(st, "%p\n", data);
+ output(st, "%s\n", ptr_val(data));
}
free(prefix);
}
dump_user_data(st, prefix_depth + 2, addr->extra);
}
else {
- output(st, "%p\n", addr);
+ output(st, "%s\n", ptr_val(addr));
}
free(prefix);
}
output(st, "%sphrase: %s\n", prefix, chk(dv->phrase));
}
else {
- output(st, "%p\n", dv);
+ output(st, "%s\n", ptr_val(dv));
}
free(prefix);
}
output(st, "%sphrase: %s\n", prefix, chk(age->phrase));
}
else {
- output(st, "%p\n", age);
+ output(st, "%s\n", ptr_val(age));
}
free(prefix);
}
output(st, "\n");
output(st, "%stype: %d\n", prefix, xr->type);
output(st, "%sxref: %s\n", prefix, chk(xr->string));
- output(st, "%sobject: %p\n", prefix, xr->object);
+ output(st, "%sobject: %s\n", prefix, ptr_val(xr->object));
}
else {
- output(st, "%p\n", xr);
+ output(st, "%s\n", ptr_val(xr));
}
free(prefix);
}
}
}
else {
- output(st, "%p\n", xr);
+ output(st, "%s\n", ptr_val(xr));
}
free(prefix);
}
}
}
else {
- output(st, "%p\n", t);
+ output(st, "%s\n", ptr_val(t));
}
free(prefix);
}
}
}
else {
- output(st, "%p\n", ref);
+ output(st, "%s\n", ptr_val(ref));
}
free(prefix);
}
}
}
else {
- output(st, "%p\n", note);
+ output(st, "%s\n", ptr_val(note));
}
free(prefix);
}
}
}
else {
- output(st, "%p\n", link);
+ output(st, "%s\n", ptr_val(link));
}
free(prefix);
}
}
}
else {
- output(st, "%p\n", cit);
+ output(st, "%s\n", ptr_val(cit));
}
free(prefix);
}
}
}
else {
- output(st, "%p\n", lds);
+ output(st, "%s\n", ptr_val(lds));
}
free(prefix);
}
dump_user_data(st, prefix_depth + 2, chan->extra);
}
else {
- output(st, "%p\n", chan);
+ output(st, "%s\n", ptr_val(chan));
}
free(prefix);
}
}
}
else {
- output(st, "%p\n", name);
+ output(st, "%s\n", ptr_val(name));
}
free(prefix);
}
}
}
else {
- output(st, "%p\n", p);
+ output(st, "%s\n", ptr_val(p));
}
free(prefix);
}
}
}
else {
- output(st, "%p\n", link);
+ output(st, "%s\n", ptr_val(link));
}
free(prefix);
}
}
}
else {
- output(st, "%p\n", assoc);
+ output(st, "%s\n", ptr_val(assoc));
}
free(prefix);
}
dump_user_data(st, prefix_depth + 2, place->extra);
}
else {
- output(st, "%p\n", place);
+ output(st, "%s\n", ptr_val(place));
}
free(prefix);
}
}
}
else {
- output(st, "%p\n", evt);
+ output(st, "%s\n", ptr_val(evt));
}
free(prefix);
}
}
}
else {
- output(st, "%p\n", desc);
+ output(st, "%s\n", ptr_val(desc));
}
free(prefix);
}
}
}
else {
- output(st, "%p\n", evt);
+ output(st, "%s\n", ptr_val(evt));
}
free(prefix);
}