<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Calling C library functions from basic with string parameter in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/calling-c-library-functions-from-basic-with-string-parameter/m-p/6219133#M37231</link>
    <description>&lt;P&gt;Hello to everyone.&lt;/P&gt;&lt;P&gt;The question is:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there an simple way to form '\0' terminated c-string in basic to pass it as an argument in C library's function?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Library's function notification:&lt;/P&gt;&lt;P&gt;int login(char * login, char * password);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 27 Sep 2013 03:41:52 GMT</pubDate>
    <dc:creator>AlexanderM</dc:creator>
    <dc:date>2013-09-27T03:41:52Z</dc:date>
    <item>
      <title>Calling C library functions from basic with string parameter</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/calling-c-library-functions-from-basic-with-string-parameter/m-p/6219133#M37231</link>
      <description>&lt;P&gt;Hello to everyone.&lt;/P&gt;&lt;P&gt;The question is:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there an simple way to form '\0' terminated c-string in basic to pass it as an argument in C library's function?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Library's function notification:&lt;/P&gt;&lt;P&gt;int login(char * login, char * password);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2013 03:41:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/calling-c-library-functions-from-basic-with-string-parameter/m-p/6219133#M37231</guid>
      <dc:creator>AlexanderM</dc:creator>
      <dc:date>2013-09-27T03:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: Calling C library functions from basic with string parameter</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/calling-c-library-functions-from-basic-with-string-parameter/m-p/6219147#M37232</link>
      <description>&lt;P&gt;So, the simplest way for me is to create wrapping functions over my library function and transfer a pointer to &lt;A target="_blank" href="http://h71000.www7.hp.com/commercial/basic/basic_doc/bas_um_029.htm"&gt;string&lt;/A&gt; for a parsing in C.&lt;/P&gt;&lt;P&gt;But it is not neat-looking solution.&amp;nbsp; Furthermore I've not managed to find how to get a pointer in basic yet.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2013 04:04:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/calling-c-library-functions-from-basic-with-string-parameter/m-p/6219147#M37232</guid>
      <dc:creator>AlexanderM</dc:creator>
      <dc:date>2013-09-27T04:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calling C library functions from basic with string parameter</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/calling-c-library-functions-from-basic-with-string-parameter/m-p/6219173#M37233</link>
      <description />
      <pubDate>Fri, 27 Sep 2013 04:52:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/calling-c-library-functions-from-basic-with-string-parameter/m-p/6219173#M37233</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2013-09-27T04:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: Calling C library functions from basic with string parameter</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/calling-c-library-functions-from-basic-with-string-parameter/m-p/6219193#M37234</link>
      <description>Thanks. It is the exactly what I am looking for). There are only one task: to convince the library's users do not forget add 0 in the end of string.</description>
      <pubDate>Fri, 27 Sep 2013 05:35:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/calling-c-library-functions-from-basic-with-string-parameter/m-p/6219193#M37234</guid>
      <dc:creator>AlexanderM</dc:creator>
      <dc:date>2013-09-27T05:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: Calling C library functions from basic with string parameter</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/calling-c-library-functions-from-basic-with-string-parameter/m-p/6219579#M37235</link>
      <description />
      <pubDate>Fri, 27 Sep 2013 11:37:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/calling-c-library-functions-from-basic-with-string-parameter/m-p/6219579#M37235</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2013-09-27T11:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: Calling C library functions from basic with string parameter</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/calling-c-library-functions-from-basic-with-string-parameter/m-p/6220995#M37236</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For sake of completeness...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;Furthermore I've not managed to find how to get a pointer in basic yet.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basic has the LOC function to return the address of a variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: &amp;nbsp;"&lt;SPAN&gt;For&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;dynamic strings, the LOC function returns the address of the descriptor rather&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;than the address of the data."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For a dynamic string you can use&amp;nbsp;LIB$ANALYZE_SDESC &amp;nbsp;to get the actual address, but that gets tedious.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One option is to use a static / fixed string in a MAP, copy in the string , use (left side) &amp;nbsp;MID$ to put a NULL at the desired offset, pass the address of the (fixed) string using LOC.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hein.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Sep 2013 20:07:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/calling-c-library-functions-from-basic-with-string-parameter/m-p/6220995#M37236</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2013-09-29T20:07:14Z</dc:date>
    </item>
  </channel>
</rss>

