Universal (g)libc

R

Roger

I am writing non GUI software in C for use on Windows and Linux. while
libc packages are generally compatible, I am ending up with a lot of
conditional macros for OS and I/O related stuff such as sleep, sockets
fork etc.

What I would really loke is something that implements as much as
possible glibc on a windows platform. I have seen cygwins dll, but is
no good as I cannot reveal some source which is not mine. I have seen
the wxWidgets base, but it is C++ and I want pure C.

Any experience ideas?
 
F

Flash Gordon

Roger said:
I am writing non GUI software in C for use on Windows and Linux. while
libc packages are generally compatible, I am ending up with a lot of
conditional macros for OS and I/O related stuff such as sleep, sockets
fork etc.

What I would really loke is something that implements as much as
possible glibc on a windows platform. I have seen cygwins dll, but is
no good as I cannot reveal some source which is not mine. I have seen
the wxWidgets base, but it is C++ and I want pure C.

This group only deals with standard C so I'm afraid requesting a library
that implements things that cannot be done in standard C (or even things
that can) is not on topic.
Any experience ideas?

Yes, write an abstraction layer that contains all the system specific
stuff and call that from the main body of your code. Then all of the
system specific stuff and conditional macros will be isolated in one
place keeping the bulk of the code in one place.

<OT>
You may find MinGW and/or GNUWin32 useful, but I would still recommend
isolating your system specific code from the bulk of your code to ease
future posting issues.
</OT>
 
?

=?ISO-8859-1?Q?=22Nils_O=2E_Sel=E5sdal=22?=

Roger said:
I am writing non GUI software in C for use on Windows and Linux. while
libc packages are generally compatible, I am ending up with a lot of
conditional macros for OS and I/O related stuff such as sleep, sockets
fork etc.
What I would really loke is something that implements as much as
possible glibc on a windows platform. I have seen cygwins dll, but is
no good as I cannot reveal some source which is not mine. I have seen
the wxWidgets base, but it is C++ and I want pure C.

Any experience ideas?
Use apr.
http://apr.apache.org/
 
F

Flash Gordon

Roger said:
That was a good link, didn't know about that!
Thanks.

What was? Provide context. There is at least one post almost every day
about providing context and giving instructions (I know there was both
yesterday and today) so you have no excuse for not knowing to provide
context or how to do it through Google.
 
K

Kenny McCormack

What was? Provide context. There is at least one post almost every day
about providing context and giving instructions (I know there was both
yesterday and today) so you have no excuse for not knowing to provide
context or how to do it through Google.

You're (and others, such as Keith) wasting your breath. They'll never get
it. And I'll tell you why.

Imagine that there's a mouse - and the mouse is the Usenet. You and I can
see that it is a mouse and we behave accordingly. But now there is a class
of users (we'll call them "googlers") that are wearing these funny weird
glasses that make them see not a mouse, but an elephant. Seeing an
elephant (i.e., the Usenet as a web page), they also behave accordingly.
And no amount of verbiage from us is going to convince them that it's not
an elephant - that it is only a mouse.

To make this more clear, to a googler, it doesn't make any sense to "quote"
(whatever the heck that is...), in fact, to do would be absurd, when all
the rest of the articles in the thread are right there in front of their
faces (just as clear as the trunk on that mouse, er, elephant). And no
amount of verbiage from us is going to convince them not to believe what
they see.
 
F

Flash Gordon

Kenny said:
You're (and others, such as Keith) wasting your breath. They'll never get
it. And I'll tell you why.

<snip>

I understand what you are saying, but at least some of them are getting
it when it is explained. The problems as I see it are:
1) Google seems to ignore complaints about the interface
2) Their are always more people coming across Google groups

So I will continue to complain and/or advise depending on my mood
including asking Google users to complain to Google when I feel like
doing that.

I will also continue to do my best to avoid my responses duplicating
those of others.

If your news reader is capable of it you could always kill on posts from
Google and the immediate responses to them, with a white list for any
Google users you know you want to see. Personally I prefer not to use a
kill file and instead just skip over what I don't want to read or
comment on bad etiquette depending on my mood.

I suspect that we will not agree on this, but that's life and you are
fully entitled to your opinion.
 
J

John Bode

Kenny said:
You're (and others, such as Keith) wasting your breath. They'll never get
it. And I'll tell you why.

Imagine that there's a mouse - and the mouse is the Usenet. You and I can
see that it is a mouse and we behave accordingly. But now there is a class
of users (we'll call them "googlers") that are wearing these funny weird
glasses that make them see not a mouse, but an elephant. Seeing an
elephant (i.e., the Usenet as a web page), they also behave accordingly.
And no amount of verbiage from us is going to convince them that it's not
an elephant - that it is only a mouse.

To make this more clear, to a googler, it doesn't make any sense to "quote"
(whatever the heck that is...), in fact, to do would be absurd, when all
the rest of the articles in the thread are right there in front of their
faces (just as clear as the trunk on that mouse, er, elephant). And no
amount of verbiage from us is going to convince them not to believe what
they see.

I put the blame squarely on the Google interface. The Reply link at
the bottom of the article, which is the one 99% of the users are going
to click on (because, after all, they want to reply to the message)
doesn't quote the article being replied to.

Meanwhile, the *other* Reply link, the one I'm using to compose this
message, which is also the one that properly quotes the article, is
*hidden* behind the Show Options link (?!), which damn few people are
going to bother looking for when they already have a perfectly good
Reply link visible on the page.

The problem is the Google Groups interface (which blows goat chunks,
frankly), not the people using it. Google's web designers need to be
slapped repeatedly with large heavy binders of interface guidelines.
 
K

Kenny McCormack

To make this more clear, to a googler, it doesn't make any sense to "quote"
(whatever the heck that is...), in fact, to do would be absurd, when all
the rest of the articles in the thread are right there in front of their
faces (just as clear as the trunk on that mouse, er, elephant). And no
amount of verbiage from us is going to convince them not to believe what
they see.

I put the blame squarely on the Google interface. The Reply link at
the bottom of the article, which is the one 99% of the users are going
to click on (because, after all, they want to reply to the message)
doesn't quote the article being replied to.

Meanwhile, the *other* Reply link, the one I'm using to compose this
message, which is also the one that properly quotes the article, is
*hidden* behind the Show Options link (?!), which damn few people are
going to bother looking for when they already have a perfectly good
Reply link visible on the page.[/QUOTE]

I think it is more of a perception thing. They can't see what the heck
we're complaining about - because to them, it's all there just as plain as
day. What in tarnation do we mean when we say things like "Nobody knows
what you are responding to?" - when it is as clear as day (to them).
The problem is the Google Groups interface (which blows goat chunks,
frankly), not the people using it. Google's web designers need to be
slapped repeatedly with large heavy binders of interface guidelines.

Yes, but that's like complaining that Microsoft makes crappy software.
You know it, and I know it, but we're not their target audience.
 
M

mensanator

John said:
I put the blame squarely on the Google interface. The Reply link at
the bottom of the article, which is the one 99% of the users are going
to click on (because, after all, they want to reply to the message)
doesn't quote the article being replied to.

It will if you click the [preview] button and then subsequently
click the [edit message] button on the preview page. I find that
much more convenient than scrolling back to the top of the message
in order to get to the Reply link.
Meanwhile, the *other* Reply link, the one I'm using to compose this
message, which is also the one that properly quotes the article, is
*hidden* behind the Show Options link (?!), which damn few people are
going to bother looking for when they already have a perfectly good
Reply link visible on the page.

The problem is the Google Groups interface (which blows goat chunks,
frankly), not the people using it.

The problem is not that the interface doesn't work, but that no one
(other than me) knows how it works.
Google's web designers need to be
slapped repeatedly with large heavy binders of interface guidelines.

And the reson no one knows how it works is because it is non-intuitive.
No one (other than myself) would even think to preview what hasn't been
created. But's that's the difference between an design engineer and
a test engineer.

TE: What happens if I press this button?

DE: You haven't entered any text yet. Why would you press it now?

TE: But what happens if I press it anyway? Will a sign light up
saying "Please do not press this button again"?

TE: <presses button>

TE: Lo and behold, you get quoting!

DE: Uhh....yeah, that behaviour is by design.
 
J

James McIninch

This is not a C language question, per se.

Even so, you'd note that GNU libc is released under the LGPL license. You
are under no obligation to release source code to software that makes use
of it.
 
R

Roger

I understand what you are saying, but at least some of them are getting
it when it is explained. The problems as I see it are:
1) Google seems to ignore complaints about the interface
2) Their are always more people coming across Google groups

So I will continue to complain and/or advise depending on my mood
including asking Google users to complain to Google when I feel like
doing that.

Hmm...valid and interesting comments. Of course I could also ask 'why
does your news reader not know how to arrange in threads'? The real
issue however is with the google interface. I have various reasons for
using a web interface, and I suspect many others do as well. I am also
well aware of the quoting issue, in fact I used to quote by hand and
did not do so in this case because it was such a short and obvious
reply. I have posted questions on ng's asking if anybody knew **how**
to quote automatically with google or if anybody knows a good
alternative site. But, until now, I had no satifactory answer.
I will also continue to do my best to avoid my responses duplicating
those of others.

If your news reader is capable of it you could always kill on posts from
Google and the immediate responses to them, with a white list for any
Google users you know you want to see. Personally I prefer not to use a
kill file and instead just skip over what I don't want to read or
comment on bad etiquette depending on my mood.

So just post a note telling users to preview/edit the mesage in google
;-)
 
R

Roger

Flash said:
This group only deals with standard C so I'm afraid requesting a library
that implements things that cannot be done in standard C (or even things
that can) is not on topic.

Sorry, I don't get it. I **want** to use standard C and **only**
standard C. My problem is finding a library that does the most
compatible implementation of C on windows. Perhaps I am incorrect in
regarding glibc as being a good reference standard? To me standard C is
Unix (POSIX) C.
 
R

Roger

James said:
This is not a C language question, per se.

Even so, you'd note that GNU libc is released under the LGPL license. You
are under no obligation to release source code to software that makes use
of it.

I am aware that glibc is LGPL'd, but cygwin links to a 'cygwin' dll
which cygwin claim is GPL'd and thus source must be released
http://cygwin.com/licensing.html

Briefly what I have found is that the minGW setup I had been using was
not fully supporting glibc, in fact it is designed for implementing
Windows apps using GCC.

cygwin does a good job of implementing a posix like environment, but
has this licesing issue.

However I have now found that thre is a GNUWin32 project on sourceforge
who do a good implementation of glibc. This is working for me.
 
F

Flash Gordon

Roger wrote:

Please leave the attributions in (e.g. things like the "Roger wrote:"
above) so that people know who wrote what. I happen to know I wrote the
quoted material below, but anyone who has not seen my post (for example
because it did not reach there server) won't know that.
Hmm...valid and interesting comments. Of course I could also ask 'why
does your news reader not know how to arrange in threads'?

It does. However if the previous article has expired (I am sometimes
away for longer than the retention period of the server) or has not
reached my server then this does not help. Also I choose to have my
reader configured to *not* show articles since that way I can see the
unread articles/thread easily and select which I want to read, with the
unread showing as well the list would be ridiculously long.
> The real
issue however is with the google interface. I have various reasons for
using a web interface, and I suspect many others do as well.

I'm fully aware that people have good reasons for using a web interface.
I'm fortunate that if I needed to access Usenet through port 80 I have a
web server I could set up to relay my NNTP connection to a private
authenticated (so no one else could use it) new server. Most people
don't have that option.
> I am also
well aware of the quoting issue, in fact I used to quote by hand and
did not do so in this case because it was such a short and obvious
reply. I have posted questions on ng's asking if anybody knew **how**
to quote automatically with google or if anybody knows a good
alternative site. But, until now, I had no satifactory answer.

Well, one set of instructions has been posted here many times.
So just post a note telling users to preview/edit the mesage in google
;-)

I do normally provide what I remember of one set of instructions, but my
memory is fallible (notoriously so amongst those who know me) and so I
don't guarantee to get the instructions 100% perfect or to remember
alternative solutions to the first one posted here not long after Google
broke the interface.
 
K

Keith Thompson

Roger said:
Hmm...valid and interesting comments. Of course I could also ask 'why
does your news reader not know how to arrange in threads'?

Some newsreaders do, but it's unwise to assume that they *all* do.
Furthermore, articles can arrive at individual servers out of order,
or not at all, and expiration times can vary considerably.
The real
issue however is with the google interface. I have various reasons for
using a web interface, and I suspect many others do as well. I am also
well aware of the quoting issue, in fact I used to quote by hand and
did not do so in this case because it was such a short and obvious
reply. I have posted questions on ng's asking if anybody knew **how**
to quote automatically with google or if anybody knows a good
alternative site. But, until now, I had no satifactory answer.

I take it you haven't been following comp.lang.c regularly; the
instructions have been posted here over 1000 times:

If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers.

Incidentally, I'm not sure what you did to quote the previous article
in your followup, but either it didn't include attributions or you
snipped them. (The text you quoted was written by Flash Gordon.) I
just tried the "preview/edit" trick, and it does appear to do
attributions properly.
 
K

Keith Thompson

Roger said:
Sorry, I don't get it. I **want** to use standard C and **only**
standard C. My problem is finding a library that does the most
compatible implementation of C on windows. Perhaps I am incorrect in
regarding glibc as being a good reference standard? To me standard C is
Unix (POSIX) C.

No, standard C is C as defined by the ISO C standard (either the 1990
or 1999 version). Unix is an operating system, one of many on which C
implementations exist, and POSIX is a secondary standard that defines
many things that the C standard doesn't.

If you have a copy of K&R2 (Kernighan & Ritchie, _The C Programming
Language_, 2nd Edition), standard C is basically what's covered in
appendices A and B. (If you don't have a copy, you should.)

Some quick examples: fopen(), fread(), fwrite(), and fclose() are
standard C; open(), read(), write(), close(), and fork() are not.

POSIX-specific issues are typically discussed in comp.unix.programmer.
 
R

Roger

Keith said:
Some newsreaders do, but it's unwise to assume that they *all* do.
Furthermore, articles can arrive at individual servers out of order,
or not at all, and expiration times can vary considerably.


I take it you haven't been following comp.lang.c regularly; the
instructions have been posted here over 1000 times:

Well no, I have not been in this ng, but interestingly the instructions
given below are actually different from the technique posted earlier in
this thread ;-)
 
D

Dik T. Winter

> Meanwhile, the *other* Reply link, the one I'm using to compose this
> message, which is also the one that properly quotes the article, is
> *hidden* behind the Show Options link (?!), which damn few people are
> going to bother looking for when they already have a perfectly good
> Reply link visible on the page.

Moreover, on older browsers, the Show Options link does not even work.
I know, I have two such browsers here at home. (Yes, I am still posting
with good old rn.)
 
R

Roger

Keith said:
No, standard C is C as defined by the ISO C standard (either the 1990
or 1999 version). Unix is an operating system, one of many on which C
implementations exist, and POSIX is a secondary standard that defines
many things that the C standard doesn't.

If you have a copy of K&R2 (Kernighan & Ritchie, _The C Programming
Language_, 2nd Edition), standard C is basically what's covered in
appendices A and B. (If you don't have a copy, you should.)

<quote K&R Second edition>
The computing world has undergone a revolution since the publication of
the C Programming language in 1978. Big computers are much bigger, and
personal computers have capabilities that rival the mainframes of a
decade ago. During this time, C has changed too, althougth only
modestly, and it has spread far beyond it's origins as the language of
the UNIX operating system.
</quote>



I had to blow the dust of the K&R. Allthougth I have it I never use it
as I know it by heart. I know that the lib c in K&R only includes
stdio.h wrt interfaces to the real world. So can I assume from that
this ng considers OT anything that cannot be directly implemented using
the libc of K&R. It would seem a bit narrow to me.

comp.unix.programmer would **not** seem to be an appropriate place to
ask about the best libc implementation

Some quick examples: fopen(), fread(), fwrite(), and fclose() are
standard C; open(), read(), write(), close(), and fork() are not.
The ones you listed as 'not' do appear in K&R in chapter 8 "The unix
system interface". Do you think that the C language per se should not
make any attempt to incorporate interfaces to the rest of the world,
other than a vauge acknowledement that there may be input and output
streams? As the introduction to chapter 8 points out: "Scince the ANSI
C library is in many cases modelled on UNIX facilities, this code may
help your understanding of the library as well", also, "Chapter 7 was
concerned with i/o that is uniform accross operating systems". IMHO
socket i/o is nowdays as fundamental as file i/o and should be included
in "chapter 7". Forks and threads are slightly different in the sense
that different approaches to thier use (and the pro's and cons) vary
from platform to platform, including different unices, so perhaps they
should not be in the standard C library.

I acknowledge however that they are currently **not** in the ANSI
standard and therefore you consider them OT in this ng. I did not
realise you were so pedantic here.
POSIX-specific issues are typically discussed in comp.unix.programmer.

Does not really seem an appropriate place to ask about a good libc
implementation for Win32. If they are as pedantic over there as you lot
over here are I would be flamed to ashes ;-)

My issues are with C portability. I have always felt that portability
has been very much in the spirit of the C language. According to the
K&R preface the ANSI goal was to produce an unambiguous and machine
independent definition of the language. My point is that you cannot
achieve that completely by simply ignoring essential functionality that
almost any modern program needs. Or perhaps C should be called "a
standard language for mono-threaded applications which only require
file and console i/o".
 

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

Forum statistics

Threads
473,774
Messages
2,569,600
Members
45,181
Latest member
RexGreenwa
Top