- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: Calling C library functions from basic with st...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-26-2013 08:41 PM
тАО09-26-2013 08:41 PM
Hello to everyone.
The question is:
Is there an simple way to form '\0' terminated c-string in basic to pass it as an argument in C library's function?
Library's function notification:
int login(char * login, char * password);
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-26-2013 09:04 PM
тАО09-26-2013 09:04 PM
Re: Calling C library functions from basic with string parameter
So, the simplest way for me is to create wrapping functions over my library function and transfer a pointer to string for a parsing in C.
But it is not neat-looking solution. Furthermore I've not managed to find how to get a pointer in basic yet.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-26-2013 09:52 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-26-2013 10:35 PM
тАО09-26-2013 10:35 PM
Re: Calling C library functions from basic with string parameter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-27-2013 04:37 AM
тАО09-27-2013 04:37 AM
Re: Calling C library functions from basic with string parameter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-29-2013 01:07 PM
тАО09-29-2013 01:07 PM
Re: Calling C library functions from basic with string parameter
For sake of completeness...
>> Furthermore I've not managed to find how to get a pointer in basic yet.
Basic has the LOC function to return the address of a variable.
Note: "For dynamic strings, the LOC function returns the address of the descriptor rather than the address of the data."
For a dynamic string you can use LIB$ANALYZE_SDESC to get the actual address, but that gets tedious.
One option is to use a static / fixed string in a MAP, copy in the string , use (left side) MID$ to put a NULL at the desired offset, pass the address of the (fixed) string using LOC.
This may sound like a lot of overhead, but please realize the operations like 'cstr+ "0"c' will also copy the strings around and allocate descriptors and stuff.
Hein.