source: git/dyn_modules/mega2003.mod @ 06c0b3

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