source: git/modules/mega2003.mod @ 80e54c

spielwiese
Last change on this file since 80e54c was d2a9631, checked in by Anne Frühbis-Krüger <anne@…>, 21 years ago
*** empty log message *** git-svn-id: file:///usr/local/Singular/svn/trunk@6793 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.1 KB
Line 
1%{
2/*
3 *  $Id: mega2003.mod,v 1.1 2003-06-11 10:21:51 anne Exp $
4 *
5 *  Test mod fuer modgen
6 */
7
8#include <stdio.h>
9#include <mod2.h>
10#include <tok.h>
11#include <polys.h>
12
13
14extern void piShowProcList();
15%}
16
17category="mega";
18package="mega_module";
19version = "$Id: mega2003.mod,v 1.1 2003-06-11 10:21:51 anne Exp $";
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.