Author Topic: Ability to import C functions  (Read 4424 times)

Evan Carew

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Ability to import C functions
« on: November 16, 2008, 02:10:03 pm »
I noticed that EA can do C, sort of. The big downer is that there is no way to import functions, or indeed to represent them in the class view. It would be rather useful if EA could import existing C projects, getting all functions, structs, and globals so that said project could be refactored into C++

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Ability to import C functions
« Reply #1 on: November 17, 2008, 06:24:56 am »
Spend a bit of time searching the forum, and perhaps perusing the Resources page on the Sparx site. EA can do more with C than first meets the eye.

I cannot point you to the specifics of what you've asked though; I really don't use C, let alone model it in EA.
No, you can't have it!

Evan Carew

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Ability to import C functions
« Reply #2 on: November 20, 2008, 04:38:08 am »
I just finished searching the forums with the phrase 'C functions'. The only result on the search was this thread.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Ability to import C functions
« Reply #3 on: November 20, 2008, 07:01:21 am »
Sorry Evan,

I failed to mention that the YABB - that's the forum software used here - has a very literal search feature. Sometimes the 'obvious' phrase turns out to be unexpectedly limiting.

Perhaps instead of searching for the exact phrase you chould try something like the two (separate) keywords C and import. That might be a place to start.

As I mentioned earlier I don't use EA for C, so I have not had the need to search for this subject.
No, you can't have it!

Evan Carew

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Ability to import C functions
« Reply #4 on: November 21, 2008, 01:50:41 pm »
I did finally find a couple of references from a while back. Turns out that the developers of EA are not considering functions (in any language) not contained in a class. So, that means that C functions can only be imported if they are either OO C, or in the case where someone has written a special filter which converts C functions in a header file into a class. Incidentally, this also means that C++ friend functions aren't imported.

As one of my original purposes for purchasing EA was to use it as a way to move legacy code foreword, this restriction is a little disapointing.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Ability to import C functions
« Reply #5 on: November 21, 2008, 05:45:06 pm »
Quote
I did finally find a couple of references from a while back. Turns out that the developers of EA are not considering functions (in any language) not contained in a class. So, that means that C functions can only be imported if they are either OO C, or in the case where someone has written a special filter which converts C functions in a header file into a class.
I don't know where you got that impression from.  (And I'm sorry if it was me.)  The C importer creates a class from every file by default.  There is also an option for the C  to enable object oriented C support.  (Tools | Options | Source Code Engineering | C)

Certainly for any other language (ie. any supported language that actually has classes) functions are only imported from inside a class, but C is an exception.