need this C translated to pascal-family - please.

J

John Bode


[moar snip]
****


I replied:
***
it's an array of structs. Each struct seems to have a string (char*)
member, maybe two into and a char. If you want to know more about the
struct find the definition.
***

....which is more than likely in the usb_modeswitch.h file #included at
the beginning of the program.

The line

static struct option long_option[]

declares an array named "long_option" of type "struct option" with
storage class "static" (which among other things prevents the symbol
name from being exported to the linker, essentially making it
"private" to this source file, but not in the way most OO types would
think of "private") and initializes it with the values between the
brackets; the size is determined from the number of initializers.
Since each element of the array is of struct type, each initializer in
the list is also bracketed with { and }.

Again, probably in the usb_modeswitch.h file.
 
C

Chris Burrows

You're in for a world of pain, here. What is the driving need to
convert this code to Pascal or Oberon? Why is it not sufficient in
its current form?

There is no C or Pascal compiler on the Oberon operating system the OP is
using. However, Pascal would presumably be OK as there are tools to convert
95% of Standard Pascal to Oberon.
You would probably get better (and more
comprehensive) help if you posted a few representative lines of code
you didn't understand and ask about them specifically.

Agreed.

Chris Burrows
CFB Software
http://www.cfbsoftware.com
 
M

Marco van de Voort


Better first confirm that the code that implements usb.h and
usb-modeswitch.h are available on Oberon. Otherwise even a perfectly
translated header is useless.
 
N

Nick Keighley

On 20 Sep, 00:54, (e-mail address removed) wrote
you said:
! is this a RECORD containing an ARRAY OF <strings>?

I replied:
***
it's an array of structs. Each struct seems to have a string (char*)
member, maybe two [ints] and a char. If you want to know more about the
struct find the definition.
***

note correction

Each struct seems to have a string (char*)
member, maybe two [ints] and a char.

didn't you read this bit?

note correction

 <a pointer to a string> ?

nope. A pointer to a char. Because of C's loosness about pointers and
arrays. An array of [chars] can be passed as an argment (which then
gets converted to a pointer to the first element of the array). A
string in C is a nul (that is, zero) terminated array of chars.
Effectivly the argument is a string.
 What does the 'const' mean?

note correction
 

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,114
Members
46,702
Latest member
VernitaGow

Latest Threads

Top