APIENTRY counterpart in UNIX


 
Thread Tools Search this Thread
Top Forums Programming APIENTRY counterpart in UNIX
# 1  
Old 05-12-2005
Question APIENTRY counterpart in UNIX

I'm trying to call a C program from my COBOL module. I've found a sample code in the net that uses APIENTRY for every function in C that will be access by the COBOL module (i.e. int APIENTRY UpdateFields(char *, char *, int *) ). However, to use this function, windows.h must be included in the list of header files. Does anyone of you know the counterpart of this function in UNIX? Or is it ok if copy the windows.h header in UNIX?
# 2  
Old 05-12-2005
APIENTRY is pure windows only.

MicroFocus COBOL compiles COBOL into C, then uses the C run-time, for example.
You should be able to create an object file like this
Code:
cc -c myfile.c

and then add myfile.o to the command line for the COBOL compile. See your compiler doc set, it will explain linking in external object files. You may have to modify the calling parameters for the function(s) you create in C to tell the C compiler how to clean up the stack. Your COBOL doc set will cover all that.
# 3  
Old 05-12-2005
Thanks for the info Jim. However, when I tried to compile my C module without the APIENTRY (i.e. int bmodcheck (char *, char *, ...) ), I get the following errors ->

$ cc bmodcheck.c -o bmodcheck
Undefined first referenced
symbol in file
socket bmodcheck.o
gethostbyname bmodcheck.o
bind bmodcheck.o
sendto bmodcheck.o
inet_ntoa bmodcheck.o
main /opt/app/SUNWspro/WS6U2/lib/crt1.o
recvfrom bmodcheck.o
ld: fatal: Symbol referencing errors. No output written to bmodchek

I guess this has something to do with my C module wihch has no main() function inside. Would you know how I could fix this problem? If I tried to used the APIENTRY (i.e. int APIENTRY bmodcheck (char *, char *, ...) ), I get the following errors:

$ cc CMPCACVN.cbl bmodcheck.c
"./bmodcheck.h", line 11: syntax error before or at: BMODCHK
"./bmodcheck.h", line 31: warning: old-style declaration or incorrect type for:K
"bmodcheck.c", line 41: syntax error before or at: BMODCHK
cc: acomp failed for bmodcheck.c
# 4  
Old 05-12-2005
First off
Code:
 cc -c bmodcheck.c

not cc -o

Second I think you have a windows style .h file. Your errors are in the include file
bmodchk.h. APIENTRY DOES NOT WORK IN UNIX. Remove it. Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

File Transfer from Window server to UNIX and UNIX to UNIX

Dear All, Can someone help to command or program to transfer the file from windows to Unix server and from one unix server to another Unix server in secure way. I would request no samba client. (4 Replies)
Discussion started by: yadavricky
4 Replies

2. UNIX for Dummies Questions & Answers

How does unix system administration, unix programming, unix network programming differ?

How does unix system administration, unix programming, unix network programming differ? Please help. (0 Replies)
Discussion started by: thulasidharan2k
0 Replies

3. Shell Programming and Scripting

Batch job in unix server to move the pdf file from unix to windows.

Hi Experts, I have a requirement where i need to setup a batch job which runs everymonth and move the pdf files from unix server to windows servers. Could some body provide the inputs for this. and also please provide the inputs on how to map the network dirve in the unix like that... (1 Reply)
Discussion started by: ger199901
1 Replies

4. Solaris

Performance check without a counterpart

Hi, is it possible to check out the speed limits of a box without a remote peer for netio and stuff? I transferred 1 Terrabyte last night, which is not really much and need to find the bottleneck. The remote server is soon going to retire, yet I need to copy the 8T to the new machine. This... (9 Replies)
Discussion started by: PatrickBaer
9 Replies

5. Red Hat

frecover counterpart on linux

Hello All, The frecover command on HP UX gives information about the backed up file in the format- Magic Field: Machine Identification: System Identification:HP-UX Release Identification:B.11.11 Node Identification: User Identification: Record Size: Time: Media Use:0 Volume Number:1... (1 Reply)
Discussion started by: shamik
1 Replies

6. Solaris

Solaris counterpart of /etc/security/limits.conf

Hi, How can we set per user core file size, etc in solaris, i.e. I want solaris counterpart/equivalent of linux /etc/security/limits.conf. TIA (0 Replies)
Discussion started by: slash_blog
0 Replies

7. Shell Programming and Scripting

FTP script for sending a file from one unix directory to another unix server director

Hi, My local server is :/usr/abcd/ Remote server is :/Usr/host/test/ I want to send files from local unix directory(All files starting with O_999) to remote host unix directory. Can any body give me the Unix Shell script to do this. One more doubt: Shall we need to change the file... (1 Reply)
Discussion started by: raja_1234
1 Replies

8. UNIX for Advanced & Expert Users

missing Path(in UNIX) when i launch a job on to unix machine using windows SSh

hi i want run an unix application from a windows program/application.i am using SSH(command line version)to log on to a unix machine from windows. the application has to read a configuration file inorder to run. the configuration file .CFG is in bin in my home directory. but the application... (1 Reply)
Discussion started by: megastar
1 Replies

9. UNIX for Dummies Questions & Answers

UNIX problem? Unix programm runs windows 2000 CPU over 100%

Okee problems...!! What is happening: Unix server with some programms, workstations are windows 2000, the workstations work good but when you start a programm on the Unix server the CPU of the workstations go to 100% usage resulting that the system gets very slow. The programm well its running so... (2 Replies)
Discussion started by: zerocool
2 Replies
Login or Register to Ask a Question