Last change
on this file since 822 was
363,
checked in by djay, 12 years ago
|
Remove uneeded header file and small fix to compile on win32 and use correct way to fill outputs parameters.
|
-
Property svn:eol-style set to
native
-
Property svn:mime-type set to
text/x-csrc
|
File size:
1.0 KB
|
Line | |
---|
1 | #include "service.h" |
---|
2 | |
---|
3 | extern "C" { |
---|
4 | |
---|
5 | #ifdef WIN32 |
---|
6 | __declspec(dllexport) |
---|
7 | #endif |
---|
8 | int Multiply(maps*& conf,maps*& inputs,maps*& outputs){ |
---|
9 | fprintf(stderr,"\nService internal print\n"); |
---|
10 | maps* cursor=inputs; |
---|
11 | int A,B,res; |
---|
12 | A=0;B=0; |
---|
13 | if(cursor!=NULL){ |
---|
14 | fprintf(stderr,"\nService internal print\n"); |
---|
15 | dumpMaps(cursor); |
---|
16 | maps* tmp=getMaps(inputs,"A"); |
---|
17 | if(tmp==NULL) |
---|
18 | return SERVICE_FAILED; |
---|
19 | fprintf(stderr,"\nService internal print\n"); |
---|
20 | dumpMap(tmp->content); |
---|
21 | map* tmpv=getMap(tmp->content,"value"); |
---|
22 | fprintf(stderr,"\nService internal print\n"); |
---|
23 | A=atoi(tmpv->value); |
---|
24 | fprintf(stderr,"\nService internal print (A value: %i)\n",A); |
---|
25 | cursor=cursor->next; |
---|
26 | } |
---|
27 | if(cursor!=NULL){ |
---|
28 | maps* tmp=getMaps(cursor,"B"); |
---|
29 | map* tmpv=getMap(tmp->content,"value"); |
---|
30 | if(tmpv==NULL) |
---|
31 | return SERVICE_FAILED; |
---|
32 | B=atoi(tmpv->value); |
---|
33 | fprintf(stderr,"\nService internal print (B value: %i)\n",B); |
---|
34 | } |
---|
35 | res=A*B; |
---|
36 | char tmp[256]; |
---|
37 | sprintf(tmp,"%i",res); |
---|
38 | setMapInMaps(outputs,"Result","value",tmp); |
---|
39 | return SERVICE_SUCCEEDED; |
---|
40 | } |
---|
41 | |
---|
42 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.