10-28-2002
Quote:
Originally posted by Perderabo
The only solaris 8 system that I have access to has no compiler, so I can't test this. But looking at the include files, <time.h> will include <sys/time_impl.h> depending on what symbols you set. <sys/time_impl.h> defines timespec.
My guess is that you are defining symbols that are removing non-posix and/or non-ansi-c definitions from the namespace. And the header files are not handling your selected options in a robust manner. If you are getting a compile error and you picked an legal combination of symbols, then the header files may have a minor bug. As a work-around, maybe you can define timespec in a typedef to silence the compiler.
Thanks for the advice Perderabo - I think you're right. I'm going through most of my definitions ATM to make sure there are no conflicts.
What makes me think you're right is that compiling without the '-Xc' switch (ANSI C conformance in Sun CC) leads to no warnings. Certainly an interesting one.
10 More Discussions You Might Find Interesting
1. Programming
To anyone that can answer this:
Are the differences great between the ANSI and K&R standard? What are some of the major differences between them??
-REM (1 Reply)
Discussion started by: REM
1 Replies
2. Programming
Dear All,
I have to develope some C functions in Unix for a Magic program. The original MSE code which compiles the attached C program uses a +z option, but the cc compiler don't know this. The complete command in the compiler script is 'cc -c -Aa +z myfile.c'. The warning message is 'The -z... (4 Replies)
Discussion started by: Frankie
4 Replies
3. HP-UX
Hi! Can anyone help me with the problem i am having. Im new to hpux and i am trying to set up the programs i use. One such program is the irc client BitchX, ive ran it on several pc/sun boxes with no problems. On my c360 with an fx6 card and a eizo f56 17in monitor (1024x768 85hz vesa) the ansi... (0 Replies)
Discussion started by: Lewis
0 Replies
4. HP-UX
Good Day
I downloaded Server Evaluation copy of C/ANSI compiler, but when I try to compile a file with it, it gives me following error - (for HP-UX 11.11 v1 PA-RISC)
Internal Error: Codeword file /opt/ansic/newconfig/ansic.cwd missing or empty.
Detailed Errors are as follows
Internal... (3 Replies)
Discussion started by: shawnbishop
3 Replies
5. Shell Programming and Scripting
Hi,
I am creating a file in Unix using a shell script. The file is getting created in the Unix - ANSI format. My requirement is to convert it to the PC - ANSI format. Can anyone tell me how to do this?
Thanks,
Sunil (0 Replies)
Discussion started by: ssmallya
0 Replies
6. HP-UX
I want to convert a file from Unix-ANSI to PC-ANSI format. How can i achieve that? (0 Replies)
Discussion started by: ssmallya
0 Replies
7. UNIX for Dummies Questions & Answers
Can someone tell me how to do this?
Just a thought that entered my mind when learning about structs.
First thought was:
struct one
{
struct two;
}
struct two
{
three;
}
one->two->three
would this be how you would access "three"? (1 Reply)
Discussion started by: unbelievable21
1 Replies
8. Programming
I follow the description of wiki (Lamport's bakery algorithm - Wikipedia, the free encyclopedia), then implement that algorithm in C, but it doesn't work, Starving is still here, is the implementation worry?
Only print out:
Thread ID: 0 START!
Thread ID: 0 END!
Thread ID: 0 START!... (2 Replies)
Discussion started by: sehang
2 Replies
9. Programming
Hi,
I have received an application that stores some properties in a file. The existing struct looks like this:
struct TData
{
UINT uSizeIncludingStrings;
// copy of Telnet data struct
UINT uSize;
// basic properties:
TCHAR szHost; //defined in Sshconfig
UINT iPortNr;
TCHAR... (2 Replies)
Discussion started by: Powerponken
2 Replies
10. Programming
I have very little experience with gcc compilation under different environments, so please bear with me. I carried over 20 years old project into Ubuntu 18.04, it has old style K&R parameters, no function declarations to speak of, many functions without return are not declared void, and on and... (8 Replies)
Discussion started by: migurus
8 Replies
LEARN ABOUT DEBIAN
ctypeslib
ctypeslib(1) User Commands ctypeslib(1)
NAME
h2xml - convert header files to XML intermediates
xml2py - convert XML intermediates to Python ctypes interface
SYNOPSIS
h2xml includefile ... [options] -o outputxmlfile
xml2py xmlfile ... [options] -o outputpyfile
DESCRIPTION
ctypeslib is a Python code generator capable of converting C header files into xml files (using gccxml), and then converting the xmlfiles
into Python modules which define a ctypes interface to the corresponding C library.
Ctypeslib is not ctypes. Ctypes is included in Python 2.5+ and as an add-on for lower versions, while ctypeslib is a lesser known add-on
written by the ctypes author. If you use ctypes a lot and are tired of setting argtypes and restype of the called functions, you should
look into ctypeslib. Ctypeslib can also set up data types and structures from C header files automatically.
h2xml and xml2py are the user interface scripts to ctypeslib. h2xml converts C header files into xml intermediates (using gccxml) and
xml2py converts these intermediates to Python files. At the minimum, you can get automatic construction of the C types (structures, etc)
in ctypes definitions. With extra options, macro definitions can be expanded and the output Python file can be automatically linked (using
ctypes) to the corresponding C library.
The briefest example is:
h2xml header.h -o out_c.xml
xml2py out_c.xml -o out_c.py
To obtain preprocessor symbols, you must use the -c flag to h2xml. To automatically link to C libraries via ctypes, you muss pass the rel-
evant libraries to xml2py with -l library.so.
OPTIONS
h2xml options:
-h, --help
show brief help message
-q, --quiet
-D NAME[=VALUE]
macros to define
-U NAME
macros to undefine
-I DIRECTORY
additional include directories
-o XMLFILE
XML output filename
-c, --cpp-symbols
try to find #define symbols - this may give compiler errors, so it's off by default.
-k don't delete the temporary files created (useful for finding problems)
xml2py options:
-h, --help
show this help message and exit
-c include source file location in comments
-d include docstrings containing C prototype and source file location
-k TYPEKIND
kind of type descriptions to include: d = #defines, e = enumerations, f = functions, s = structures, t = typedefs
-l DLLS
libraries to search for exported functions
-o OUTPUT
output filename (if not specified, standard output will be used)
-r EXPRESSION
regular expression for symbols to include (if neither symbols nor expressions are specified,everything will be included)
-s SYMBOL
symbol to include (if neither symbols nor expressions are specified,everything will be included)
-v verbose output
-w add all standard windows dlls to the searched dlls list
-m module
Python module(s) containing symbols which will be imported instead of generated
--preload=DLL
dlls to be loaded before all others (to resolve symbols)
EXAMPLES
Please see /usr/share/doc/python-ctypeslib/examples.Debian for examples and explanation.
SEE ALSO
/usr/share/doc/python-ctypeslib/examples.Debian contains a brief tutorial on some key features
Python docstrings (pydoc ctypeslib)
Ctypeslib upstream is http://python.net/crew/theller/ctypes/ (see "Related Projects").
For ctypes information, see http://docs.python.org/library/ctypes.html
AUTHOR
ctypeslib was written by Thomas Heller <theller@ctypes.org>.
This manual page was written by Richard Darst <rkd@zgib.net>, for the Debian project (and may be used by others).
ctypeslib March 2010 ctypeslib(1)