Branch: Tag:

1999-03-31

1999-03-31 19:27:19 by Mirar (Pontus Hagland) <pike@sort.mirar.org>

fixes & doc

Rev: src/modules/Math/Makefile.in:1.2
Rev: src/modules/Math/configure.in:1.2
Rev: src/modules/Math/math.c:1.3(DEAD)
Rev: src/modules/Math/math.h:1.2(DEAD)
Rev: src/modules/Math/math_matrix.c:1.1
Rev: src/modules/Math/math_module.c:1.1
Rev: src/modules/Math/math_module.h:1.1
Rev: src/modules/Math/matrix.c:1.3(DEAD)

1: + /* +  * $Id: math_module.c,v 1.1 1999/03/31 19:27:18 mirar Exp $ +  */    -  + #include "global.h" + #include "config.h" +  + #include "program.h" +  + #include "math_module.h" +  + /*** module init & exit & stuff *****************************************/ +  + /* add other parsers here */ +  + struct program *math_matrix_program; +  + static struct math_class + { +  char *name; +  void (*func)(void); +  struct program **pd; + } sub[] = { +  {"Matrix",init_math_matrix,&math_matrix_program}, + }; +  + void pike_module_exit(void) + { +  int i; +  for (i=0; i<(int)(sizeof(sub)/sizeof(sub[0])); i++) +  if (sub[i].pd && sub[i].pd[0]) +  free_program(sub[i].pd[0]); + } +  + void pike_module_init(void) + { +  int i; +  +  for (i=0; i<(int)(sizeof(sub)/sizeof(sub[0])); i++) +  { +  struct program *p; +  +  start_new_program(); +  sub[i].func(); +  p=end_program(); +  add_program_constant(sub[i].name,p,0); +  if (sub[i].pd) sub[i].pd[0]=p; +  else free_program(p); +  } + }   Newline at end of file added.