Dear All! After I've cleared for me the questions about complex datatypes import from C units, I would like to clear the question about C system constants import. Details: I would like to use in my program Unix system log functionality. It uses some C constants in syslog call (for example, importance level - LOG_NOTICE, LOG_EMERG, LOG_ALERT, etc...). Pedantically speaking, they are not the constants but rather C preprocessor definitions. So I've wrote the wrapper for syslog function like:
void LogMessage (int Priority, char* MessagePtr) { openlog ("[LOG_PROGRAM]", 0, LOG_LOCAL0); syslog (Priority, MessagePtr); return; }
where Priority may be one of LOG_NOTICE, LOG_EMERG, LOG_ALERT, etc... (as it's defined in "man 3 syslog").
Then I've made an import in my Pascal unit like:
procedure LogMessage (Priority: integer; MessagePtr: PChar); asmname 'LogMessage';
But how can I get these values of C preprocessor definitions in my Pascal program? The only way I can invent, is to define variables in C unit, assign them appropriate values and import these variables in Pascal unit. Not pretty good, really. Regards, Igor Marnat mailto:marny@rambler.ru