------------------------->  GNU Sather - sourcefile  <-------------------------
-- Copyright (C) 1995 by International Computer Science Institute            --
-- This file is part of the GNU Sather library. It is free software; you may --
-- redistribute  and/or modify it under the terms of the GNU Library General --
-- Public  License (LGPL)  as published  by the  Free  Software  Foundation; --
-- either version 2 of the license, or (at your option) any later version.   --
-- This  library  is distributed  in the  hope that it will  be  useful, but --
-- WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See Doc/LGPL for more details.       --
-- The license text is also available from:  Free Software Foundation, Inc., --
-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA                     --
-------------->  Please email comments to <bug-sather@gnu.org>  <--------------

-- this class is included in PO and POG. The reason that it is
-- in a separate file is to allow it to be included when using -debug
-- and -debug_graphical, whereas po.sa and pog.sa are never included together.
-- In both file we define the same class, but pog.sa has the additional
-- support for the graphical browser. This way you get a nice 
-- sather error when you don't use -debug or -debug_graphical and use one of
-- the functions in those classes.

class PO_HELP is
    print_depth:INT is i:INT;SYS::inlined_C("{ extern int print_depth;#i=print_depth; }");return i;end;
    print_lines:INT is i:INT;SYS::inlined_C("{ extern int print_lines;#i=print_lines; }");return i;end;
    print_func:INT is i:INT;SYS::inlined_C("{ extern int print_func;#i=print_func; }");return i;end;
    print_str_len:INT is i:INT;SYS::inlined_C("{ extern int print_str_len;#i=print_str_len; }");return i;end;
    print_index:INT is i:INT;SYS::inlined_C("{ extern int print_index;#i=print_index; }");return i;end;
    print_attr:INT is i:INT;SYS::inlined_C("{ extern int print_attr;#i=print_attr; }");return i;end;
    print_type:INT is i:INT;SYS::inlined_C("{ extern int print_type;#i=print_type; }");return i;end;
    print_real:INT is i:INT;SYS::inlined_C("{ extern int print_real;#i=print_real; }");return i;end;
    print_c_attr:INT is i:INT;SYS::inlined_C("{ extern int print_c_attr;#i=print_c_attr; }");return i;end;
    print_c_type:INT is i:INT;SYS::inlined_C("{ extern int print_c_type;#i=print_c_type; }");return i;end;
    print_c_real:INT is i:INT;SYS::inlined_C("{ extern int print_c_real;#i=print_c_real; }");return i;end;
    print_void:INT is i:INT;SYS::inlined_C("{ extern int print_void;#i=print_void; }");return i;end;
    print_id:INT is i:INT;SYS::inlined_C("{ extern int print_id;#i=print_id; }");return i;end;
    print_pointer:INT is i:INT;SYS::inlined_C("{ extern int print_pointer;#i=print_pointer; }");return i;end;
    print_gdb:INT is i:INT;SYS::inlined_C("{ extern int print_gdb;#i=print_gdb; }");return i;end;
    print_class_source:INT is i:INT;SYS::inlined_C("{ extern int print_class_source;#i=print_class_source; }");return i;end;
    print_declared_source:INT is i:INT;SYS::inlined_C("{ extern int print_declared_source;#i=print_declared_source; }");return i;end;
    print_short_source:INT is i:INT;SYS::inlined_C("{ extern int print_short_source;#i=print_short_source; }");return i;end;

    print_depth(i:INT) is SYS::inlined_C("{ extern int print_depth;print_depth=#i; }");end;
    print_lines(i:INT) is SYS::inlined_C("{ extern int print_lines;print_lines=#i; }");end;
    print_func(i:INT) is SYS::inlined_C("{ extern int print_func;print_func=#i; }");end;
    print_str_len(i:INT) is SYS::inlined_C("{ extern int print_str_len;print_str_len=#i; }");end;
    print_index(i:INT) is SYS::inlined_C("{ extern int print_index;print_index=#i; }");end;
    print_attr(i:INT) is SYS::inlined_C("{ extern int print_attr;print_attr=#i; }");end;
    print_type(i:INT) is SYS::inlined_C("{ extern int print_type;print_type=#i; }");end;
    print_real(i:INT) is SYS::inlined_C("{ extern int print_real;print_real=#i; }");end;
    print_c_attr(i:INT) is SYS::inlined_C("{ extern int print_c_attr;print_c_attr=#i; }");end;
    print_c_type(i:INT) is SYS::inlined_C("{ extern int print_c_type;print_c_type=#i; }");end;
    print_c_real(i:INT) is SYS::inlined_C("{ extern int print_c_real;print_c_real=#i; }");end;
    print_void(i:INT) is SYS::inlined_C("{ extern int print_void;print_void=#i; }");end;
    print_id(i:INT) is SYS::inlined_C("{ extern int print_id;print_id=#i; }");end;
    print_pointer(i:INT) is SYS::inlined_C("{ extern int print_pointer;print_pointer=#i; }");end;
    print_gdb(i:INT) is SYS::inlined_C("{ extern int print_gdb;print_gdb=#i; }");end;
    print_class_source(i:INT) is SYS::inlined_C("{ extern int print_class_source;print_class_source=#i; }");end;
    print_declared_source(i:INT) is SYS::inlined_C("{ extern int print_declared_source;print_declared_source=#i; }");end;
    print_short_source(i:INT) is SYS::inlined_C("{ extern int print_short_source;print_short_source=#i; }");end;

    PO(ob:$OB,d:INT)  
    		is SYS::inlined_C("{ extern int print_depth;int xxx=print_depth;print_depth=#d;PO(#ob);print_depth=xxx; }"); end;
    PO(ob:$OB)  is SYS::inlined_C("PO(#ob);"); end;
    PO(ob:$OB,d:INT):STR is
	a:STR;
	SYS::inlined_C("{ extern int print_depth;int xxx=print_depth;print_depth=#d;a=(STR)POSTR(#ob);print_depth=xxx; }");
	return a;
    end;
    PO(ob:$OB):STR is
	a:STR;
	SYS::inlined_C("#a=(STR)POSTR(#ob);"); 
	return a;
    end;
    PT  	is SYS::inlined_C("\n##ifdef PRINT_BACKTRACE\nPT(prev_func_frame);\n##endif\n"); end;
    PT:STR is 
        a:STR;
        SYS::inlined_C("\n##ifdef PRINT_BACKTRACE\n#a=(STR)PTSTR(prev_func_frame);\n##endif\n"); 
        return a;
    end;
    PF  	is SYS::inlined_C("\n##ifdef PRINT_BACKTRACE\n;PF(prev_func_frame);\n##endif\n"); end;
    PF:STR is 
        a:STR;
        SYS::inlined_C("\n##fidef PRINT_BACKTRACE\n#a=(STR)PFSTR(prev_func_frame);\n##endif\n"); 
        return a;
    end;
end;

