Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

Using ksh or perl to use a c API

Thread Tools
 
Search this Thread
 
Old 15 April 2005, 04:46 PM
  #1  
Dracoro
Scooby Regular
Thread Starter
 
Dracoro's Avatar
 
Join Date: Sep 2001
Location: A powerslide near you
Posts: 10,261
Likes: 0
Received 0 Likes on 0 Posts
Default Using ksh or perl to use a c API

Hi

Got a c api installed on unix box. Got a c program that runs some functions from the api. No problems so far. However, I wish to use the api through ksh or perl rather than c. Anyone know how? In c you just have the .h, .c files etc and 'make' them but how do I get the ksh or perl script to 'call' functions of the api?

Help.
Old 18 April 2005, 08:12 AM
  #2  
Dracoro
Scooby Regular
Thread Starter
 
Dracoro's Avatar
 
Join Date: Sep 2001
Location: A powerslide near you
Posts: 10,261
Likes: 0
Received 0 Likes on 0 Posts
Default

anyone?
Old 18 April 2005, 08:48 AM
  #3  
class_A
Scooby Regular
 
class_A's Avatar
 
Join Date: Apr 2002
Location: elsewhere
Posts: 1,212
Likes: 0
Received 0 Likes on 0 Posts
Default

The only way to do it would be to write a small C program to call the function you require from the API and have it accept command line parameters which you can then pass to it via the shell script.

You can't do it directly as the shell interpreter can't compile a C call as it doesn't understand either the C language or how to compile it.
Old 18 April 2005, 09:34 AM
  #4  
orbv
Scooby Regular
 
orbv's Avatar
 
Join Date: Apr 2001
Location: Hants
Posts: 1,103
Likes: 0
Received 0 Likes on 0 Posts
Default

explains it better then me
Old 24 April 2005, 12:50 PM
  #5  
Dracoro
Scooby Regular
Thread Starter
 
Dracoro's Avatar
 
Join Date: Sep 2001
Location: A powerslide near you
Posts: 10,261
Likes: 0
Received 0 Likes on 0 Posts
Default

Originally Posted by class_A
The only way to do it would be to write a small C program to call the function you require from the API and have it accept command line parameters which you can then pass to it via the shell script.

You can't do it directly as the shell interpreter can't compile a C call as it doesn't understand either the C language or how to compile it.
What I ended up doing. Wrote a little C prog to call the api and return whatever values depending on what was passed to it.

cheers.
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
GeeDee
Subaru
18
04 March 2020 07:10 PM
Ganz1983
Subaru
5
02 October 2015 09:22 AM
StueyBII
Engine Management and ECU Remapping
5
22 September 2015 02:13 PM
corno
ScoobyNet General
5
10 September 2015 06:46 AM
Dracoro
Computer & Technology Related
9
25 February 2003 03:08 PM



Quick Reply: Using ksh or perl to use a c API



All times are GMT +1. The time now is 08:33 AM.