|
56 | 56 | #include <windows.h> |
57 | 57 | /* Prototype */ |
58 | 58 | static char * lt_dlerror (void); |
59 | | -void init_call_stack_list (void); |
60 | | -struct call_stack_list |
61 | | - cob_create_call_stack_list (const char *); |
62 | | -void cob_cancel_call_stack_list (struct call_stack_list *); |
63 | 59 |
|
64 | 60 | static HMODULE |
65 | 61 | lt_dlopen (const char *x) |
@@ -285,6 +281,48 @@ lookup (const char *name) |
285 | 281 | return NULL; |
286 | 282 | } |
287 | 283 |
|
| 284 | +static void |
| 285 | +init_call_stack_list (void) |
| 286 | +{ |
| 287 | + if (!call_stack_list_head) { |
| 288 | + call_stack_list_head = cob_malloc (sizeof (struct call_stack_list)); |
| 289 | + memset (call_stack_list_head, 0, sizeof (struct call_stack_list)); |
| 290 | + } |
| 291 | + current_call_stack_list = call_stack_list_head; |
| 292 | +} |
| 293 | + |
| 294 | +static struct call_stack_list * |
| 295 | +cob_create_call_stack_list (char *name) |
| 296 | +{ |
| 297 | + struct call_stack_list *new_list = cob_malloc (sizeof (struct call_stack_list)); |
| 298 | + memset (new_list, 0, sizeof (struct call_stack_list)); |
| 299 | + new_list->parent = current_call_stack_list; |
| 300 | + new_list->name = cob_malloc (strlen (name) + 1); |
| 301 | + strcpy (new_list->name, name); |
| 302 | + current_call_stack_list = new_list; |
| 303 | + return new_list; |
| 304 | +} |
| 305 | + |
| 306 | +static void |
| 307 | +cob_cancel_call_stack_list (struct call_stack_list *p) |
| 308 | +{ |
| 309 | + if (!p) { |
| 310 | + /*No program*/ |
| 311 | + return; |
| 312 | + } |
| 313 | + static cob_field_attr a_2 = {33, 0, 0, 0, NULL}; |
| 314 | + cob_field f = {strlen (p->name), (unsigned char *) p->name, &a_2}; |
| 315 | + cob_field_cancel (&f); |
| 316 | + if (p->children) { |
| 317 | + cob_cancel_call_stack_list (p->children); |
| 318 | + } |
| 319 | + struct call_stack_list *s = p->sister; |
| 320 | + while (s != NULL) { |
| 321 | + cob_cancel_call_stack_list (s); |
| 322 | + s = s->sister; |
| 323 | + } |
| 324 | +} |
| 325 | + |
288 | 326 | const char * |
289 | 327 | cob_resolve_error (void) |
290 | 328 | { |
@@ -697,28 +735,6 @@ coblongjmp (struct cobjmp_buf *jbuf) |
697 | 735 | longjmp (jbuf->cbj_jmp_buf, 1); |
698 | 736 | } |
699 | 737 |
|
700 | | -void |
701 | | -init_call_stack_list () |
702 | | -{ |
703 | | - if (!call_stack_list_head) { |
704 | | - call_stack_list_head = cob_malloc (sizeof (struct call_stack_list)); |
705 | | - memset (call_stack_list_head, 0, sizeof (struct call_stack_list)); |
706 | | - } |
707 | | - current_call_stack_list = call_stack_list_head; |
708 | | -} |
709 | | - |
710 | | -struct call_stack_list * |
711 | | -cob_create_call_stack_list (char *name) |
712 | | -{ |
713 | | - struct call_stack_list *new_list = cob_malloc (sizeof (struct call_stack_list)); |
714 | | - memset (new_list, 0, sizeof (struct call_stack_list)); |
715 | | - new_list->parent = current_call_stack_list; |
716 | | - new_list->name = cob_malloc (strlen (name) + 1); |
717 | | - strcpy (new_list->name, name); |
718 | | - current_call_stack_list = new_list; |
719 | | - return new_list; |
720 | | -} |
721 | | - |
722 | 738 | void |
723 | 739 | cob_push_call_stack_list (char *name) |
724 | 740 | { |
@@ -761,26 +777,6 @@ cob_pop_call_stack_list () |
761 | 777 | current_call_stack_list = current_call_stack_list->parent; |
762 | 778 | } |
763 | 779 |
|
764 | | -void |
765 | | -cob_cancel_call_stack_list (struct call_stack_list *p) |
766 | | -{ |
767 | | - if (!p) { |
768 | | - /*No program*/ |
769 | | - return; |
770 | | - } |
771 | | - static cob_field_attr a_2 = {33, 0, 0, 0, NULL}; |
772 | | - cob_field f = {strlen (p->name), (unsigned char *) p->name, &a_2}; |
773 | | - cob_field_cancel (&f); |
774 | | - if (p->children) { |
775 | | - cob_cancel_call_stack_list (p->children); |
776 | | - } |
777 | | - struct call_stack_list *s = p->sister; |
778 | | - while (s != NULL) { |
779 | | - cob_cancel_call_stack_list (s); |
780 | | - s = s->sister; |
781 | | - } |
782 | | -} |
783 | | - |
784 | 780 | void |
785 | 781 | cob_cancel_all () |
786 | 782 | { |
|
0 commit comments