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 | |
---|
14 | extern void piShowProcList(); |
---|
15 | %} |
---|
16 | |
---|
17 | category="mega"; |
---|
18 | package="mega_module"; |
---|
19 | version = "$Id: mega2003.mod,v 1.1 2003-06-11 10:21:51 anne Exp $"; |
---|
20 | info =" |
---|
21 | LIBRARY: mega.lib PROCEDURES OF GENERAL TYPE WRITEN IN C |
---|
22 | |
---|
23 | proclist(); Lists all procedures. |
---|
24 | "; |
---|
25 | |
---|
26 | %% |
---|
27 | |
---|
28 | %procedures |
---|
29 | |
---|
30 | /* |
---|
31 | */ |
---|
32 | poly 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 | } |
---|
49 | int 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 | } |
---|
65 | example |
---|
66 | { Demo::mysum(2,3); |
---|
67 | } |
---|
68 | |
---|
69 | |
---|
70 | %% |
---|
71 | %C |
---|
72 | |
---|
73 | void 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.