Loading ...
Sorry, an error occurred while loading the content.

RE: [eiffel_software] Re: Syntax Specification for 'external' declarations

Expand Messages
  • Raphaël Simon [ES]
    The server is online now and the URL you are looking for is
    Message 1 of 6 , Oct 1, 2004
    View Source
    • 0 Attachment
      The server is online now and the URL you are looking for is http://docs.eiffel.com/eiffelstudio/tools/eiffelstudio/reference/30_compiler/30_external_features/index.html (actually just searching for "external" in the documentation that comes with EiffelStudio will return all the results you need).

      --
      Raphaël.

      -----Original Message-----
      From: peter_gummer [mailto:peter_gummer@...]
      Sent: Thursday, September 30, 2004 11:50 PM
      To: eiffel_software@yahoogroups.com
      Subject: [eiffel_software] Re: Syntax Specification for 'external' declarations


      --- "gmc444" <gcompestine@a...> wrote:
      > Where is the documentation on the syntax specification for external'
      > declarations, or an explanation of how it is to be used?
      >
      > I tried searching for it within the online documentation and got a
      > server error.

      The server error would be because eiffel.com still seems to be down.

      - Peter



      ------------------------ Yahoo! Groups Sponsor --------------------~--> Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
      Now with Pop-Up Blocker. Get it for free!
      http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/nhFolB/TM
      --------------------------------------------------------------------~->


      Yahoo! Groups Links
    • Greg Compestine
      ... From: Raphaël Simon [ES] Subject: RE: Re: Syntax Specification for external declarations The server is online now and the URL you
      Message 2 of 6 , Oct 1, 2004
      View Source
      • 0 Attachment
        -----------
        From: Raphaël Simon [ES] <raphaels@...>
        Subject: RE: Re: Syntax Specification for 'external' declarations

        The server is online now and the URL you are looking for is http://docs.eiffel.com/eiffelstudio/tools/eiffelstudio/reference/30_compiler/30_external_features/index.html (actually just searching for "external" in the documentation that comes with EiffelStudio will return all the results you need).

        --
        Raphaël.
        ----


        [Greg C] Raphaël, this documentation, and the shipped documentation, just contains a small number of examples. Just keeping it to a C interface, this example doesn't answer many questions. What if I want to pass an integer by reference to a C function? Or of the function returns a struct (not a pointer to a struct, but the struct)? Or if it returns an enumeration? How would I wrap an enumeration?

        *Is* there a full syntax specification?
      • Raphaël Simon [ES]
        The documentation could definitely be improved (for example by giving the exact grammar for the different syntax) but all the possible scenario for calling a C
        Message 3 of 6 , Oct 1, 2004
        View Source
        • 0 Attachment
          The documentation could definitely be improved (for example by giving the exact grammar for the different syntax) but all the possible scenario for calling a C function are covered by the examples. To answer your specific questions:

          * You can pass an integer by reference using the "$" operator as in:

          call_c is
          local
          i: INTEGER
          do
          ...
          c_function ($i)
          end

          c_function (p: POINTER): INTEGER is
          --
          external
          "C (int *) | %"my_header.h%""
          end

          * You can't directly call a C function that returns a struct, you will need to wrap it.

          * An enum value would just get converted into an integer. If you need to list the possible values the enum can take then you can create a class that list all the values and add contracts to the routines using them (see the WEL classes in the "const" cluster for examples).

          WEL has some good examples of wrapping C calls, in particular you might want to take a look at WEL_STRUCTURE that can be reused to wrap C structures while making sure that the memory gets freed when the corresponding Eiffel object gets collected.

          --
          Raphaël.

          -----Original Message-----
          From: Greg Compestine [mailto:gcompestine@...]
          Sent: Friday, October 01, 2004 4:19 PM
          To: eiffel_software@yahoogroups.com
          Subject: [eiffel_software] RE: Syntax Specification for 'external' declarations



          -----------
          From: Raphaël Simon [ES] <raphaels@...>
          Subject: RE: Re: Syntax Specification for 'external' declarations

          The server is online now and the URL you are looking for is http://docs.eiffel.com/eiffelstudio/tools/eiffelstudio/reference/30_compiler/30_external_features/index.html (actually just searching for "external" in the documentation that comes with EiffelStudio will return all the results you need).

          --
          Raphaël.
          ----


          [Greg C] Raphaël, this documentation, and the shipped documentation, just contains a small number of examples. Just keeping it to a C interface, this example doesn't answer many questions. What if I want to pass an integer by reference to a C function? Or of the function returns a struct (not a pointer to a struct, but the struct)? Or if it returns an enumeration? How would I wrap an enumeration?

          *Is* there a full syntax specification?





          ------------------------ Yahoo! Groups Sponsor --------------------~--> Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
          Now with Pop-Up Blocker. Get it for free!
          http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/nhFolB/TM
          --------------------------------------------------------------------~->


          Yahoo! Groups Links
        • Emmanuel Stapf [ES]
          Take a look at: http://docs.eiffel.com/eiffelstudio/tools/eiffelstudio/reference/30_compiler/30_ex ternal_features/index.html Regards, Manu
          Message 4 of 6 , Oct 12, 2004
          View Source
          • 0 Attachment
            Take a look at:

            http://docs.eiffel.com/eiffelstudio/tools/eiffelstudio/reference/30_compiler/30_ex
            ternal_features/index.html

            Regards,
            Manu

            > -----Original Message-----
            > From: gmc444 [mailto:gcompestine@...]
            > Sent: Thursday, September 30, 2004 7:43 PM
            > To: eiffel_software@yahoogroups.com
            > Subject: [eiffel_software] Syntax Specification for
            > 'external' declarations
            >
            > Hello,
            >
            > Where is the documentation on the syntax specification for 'external'
            > declarations, or an explanation of how it is to be used?
            >
            > I tried searching for it within the online documentation and
            > got a server error.
            >
            > Greg C
            >
            >
            >
            > ------------------------ Yahoo! Groups Sponsor
            > --------------------~--> Make a clean sweep of pop-up ads.
            > Yahoo! Companion Toolbar.
            > Now with Pop-Up Blocker. Get it for free!
            > http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/nhFolB/TM
            > --------------------------------------------------------------
            > ------~->
            >
            >
            > Yahoo! Groups Links
            >
            >
            >
            >
            >
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.