source: golgotha/src/i4/time/li_profile.cc @ 80

Last change on this file since 80 was 80, checked in by Sam Hocevar, 11 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
File size: 1.4 KB
Line 
1/********************************************************************** <BR>
2  This file is part of Crack dot Com's free source code release of
3  Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
4  information about compiling & licensing issues visit this URL</a>
5  <PRE> If that doesn't help, contact Jonathan Clark at
6  golgotha_source@usa.net (Subject should have "GOLG" in it)
7***********************************************************************/
8
9#include "lisp/li_init.hh"
10#include "lisp/lisp.hh"
11#include "error/error.hh"
12#include "time/profile.hh"
13
14
15li_object *li_profile(li_object *o, li_environment *env)
16{
17  li_object *r=li_eval(li_car(o,env),env);
18  if (r->type()!=LI_STRING)
19    i4_warning("profile expects a string arg");
20  else
21  {
22    i4_profile_clear();
23    i4_profile_stack_top=0;
24
25    for (i4_profile_class *c=i4_profile_class::list; c; c=c->next)
26    {
27      if (strstr(c->name, li_get_string(r,env))!=0)
28        c->active=1;
29      else
30        c->active=0;
31    }
32  }
33
34 
35  return 0;
36}
37
38li_object *li_profile_report(li_object *o, li_environment *env)
39{
40  li_object *r=li_eval(li_car(o,env),env);
41  if (r->type()!=LI_STRING)
42    i4_warning("profile expects a string arg");
43  else
44    i4_profile_report(li_get_string(r,env));
45
46 
47  return 0;
48}
49
50
51li_automatic_add_function(li_profile,"profile");
52li_automatic_add_function(li_profile_report,"profile_report");
Note: See TracBrowser for help on using the repository browser.