source: git/old_modgen/mega2003.mod @ c7d29b

spielwiese
Last change on this file since c7d29b was c36fda, checked in by Oleksandr Motsak <motsak@…>, 10 years ago
Moved all the outdated modgen related stuff to /old_modgen/ for now
  • Property mode set to 100644
File size: 1003 bytes
Line 
1%{
2/*
3 *
4 *  Test mod fuer modgen
5 */
6
7#include <stdio.h>
8#include <kernel/mod2.h>
9#include <tok.h>
10#include <polys.h>
11
12
13extern void piShowProcList();
14%}
15
16category="mega";
17package="mega_module";
18version = "$Id$";
19info    ="
20LIBRARY: mega.lib  PROCEDURES OF GENERAL TYPE WRITEN IN C
21
22  proclist();    Lists all procedures.
23";
24
25%%
26
27%procedures
28
29/*
30 */
31poly mysum(
32        poly i,
33        poly j
34        )
35"Return sum of i and j"
36{
37   poly h;
38  // generate internal variable declaration
39  //
40  %declaration;
41
42  // generate typecheck and typeconversation code
43  %typecheck;
44 
45  h = pCopy(i);
46  %return = (void *)pAdd(h , j);
47}
48int mysumint(
49        int i,
50        int j
51        )
52"Return sum of i and j"
53{
54  // generate internal variable declaration
55  //
56  %declaration;
57
58  // generate typecheck and typeconversation code
59  %typecheck;
60 
61  //%return = (void*)((int)i->Data() + (int)j->Data());
62  %return = (void *)(i + j);
63}
64example
65{ Demo::mysum(2,3);
66}
67
68
69%%
70%C
71
72void mytest()
73{
74  printf("Test\n");
75  printf("here commes some other C-text\n");
76}
Note: See TracBrowser for help on using the repository browser.