Using low-level C libraries in other environments?

C

Cut

My apologies if this post is in the wrong forum.

I'd like to use an SDK written in low-level C and asm. I'm not sure
how this SDK is implemented; I'd have to buy it. So this question is
theoretical.

Is it possible to use a high-level IDE used for another language, such
as Java or C#, to use a C/ASM API?

Thanks for your time,
Cut
 
D

Dave Vandervies

My apologies if this post is in the wrong forum.

'Tis, but I'll try to give enough information for you to decide where
the right place to ask is.

I'd like to use an SDK written in low-level C and asm. I'm not sure
how this SDK is implemented; I'd have to buy it. So this question is
theoretical.

If it's written in C and assembly, it most likely exports entry points
callable from C programs; if you can verify that, you don't have to
care how it's actually implemented - you can just act as if it were
implemented in C.

Is it possible to use a high-level IDE used for another language, such
as Java or C#, to use a C/ASM API?

Probably, but the C language doesn't specify how (which is what makes
comp.lang.c the wrong place to ask).
Since C has fairly simple calling conventions and nearly universal
support, many (most?) higher-level languages make it possible to call into
a library that is, or acts like it is, implemented in C. Some languages
provide this as part of the language; for languages that don't, many
(most?) implementations of the language provide it as an extension.

Look for "native code interface" or "foreign function interface" in your
documentation, and if that doesn't tell you what you need to know try
a newsgroup that discusses the language you're using and/or the tools
you're using.


dave
 
K

Keith Thompson

Probably, but the C language doesn't specify how (which is what makes
comp.lang.c the wrong place to ask).
Since C has fairly simple calling conventions and nearly universal
support, many (most?) higher-level languages make it possible to call into
a library that is, or acts like it is, implemented in C. Some languages
provide this as part of the language; for languages that don't, many
(most?) implementations of the language provide it as an extension.

<quibble>
C itself has no calling conventions. Most C *implementations* define
fairly simple calling conventions. And yes, it's common for other
languages to be able to call C functions, or functions in whatever
language that conform to the local C calling convention. How to use
such a feature is a question for a newsgroup that deals with the other
language, or with a particular implementation of it.
</quibble>
 
D

Dave Vandervies

<quibble>
C itself has no calling conventions. Most C *implementations* define
fairly simple calling conventions.

Hmmmyes. Something like "C imposes fairly simple constraints on an
implementation's calling conventions" would probably have been closer
to what I meant.

But then, I've been away for a while, and I don't have nearly enough
other ways of keeping in shape for the pedantic nitpickery^W^Wfanatical
devotion to accuracy that's expected around here.


dave

--
Dave Vandervies (e-mail address removed)
Personally, I think a few of you have too much time on your hands.
Obviously. usenet is filled with such people.
--Mark and Randy Howard in comp.lang.c
 
J

jaysome

My apologies if this post is in the wrong forum.

I'd like to use an SDK written in low-level C and asm. I'm not sure
how this SDK is implemented; I'd have to buy it. So this question is
theoretical.

Is it possible to use a high-level IDE used for another language, such
as Java or C#, to use a C/ASM API?

It is not only possible, it is a reality.

But the C Standard has nothing whatsoever to say about how other
languages such as Java or C#--let alone high-level IDE's--interface
with C. Consequently, your question is not really about C, but rather
about another language like Java that can "interface" with C. As such,
you would be better served asking your question in another, more
appropriate newsgroup.

Best regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,954
Messages
2,570,116
Members
46,704
Latest member
BernadineF

Latest Threads

Top