source: git/dyn_modules/mega2003.mod @ 021751

fieker-DuValspielwiese
Last change on this file since 021751 was 3c473c, checked in by Kai Krüger <krueger@…>, 14 years ago
rename directory modules to dyn_modules anticipating "modules" directory for cmake. git-svn-id: file:///usr/local/Singular/svn/trunk@13033 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1005 bytes
Line 
1%{
2/*
3 *  $Id$
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$";
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.