HDTenEightyP/NetNews huggingface dataset:
From: darcy@druid.uucp (D'Arcy J.M. Cain)
Subject: Re: How to use 'return' in c?
Date: Tue, 17 Nov 1992 03:35:41 GMT
Organization: D'Arcy Cain Consulting

hartman@ulogic.UUCP (Richard M. Hartman) writes:
>In article <1992Nov7.122126.24409@druid.uucp> darcy@druid.uucp (D'Arcy J.M. Cain) writes:
>>Whenever I see TRUE and FALSE in code I am maintaining I remove the
>>#defines.  If they are defined, they should never be anything but
>>TRUE = 1 and FALSE = 0.  Anything else is confusing and misleading.
>Wait a sec.... are you saying that if I have
>	setFlagValue(TRUE);
>somewhere you come along and change it to:
>	setFlagValue(1);

After I make sure that TRUE is defined as 1.  If it isn't I change the
name to something else.  I really don't feel like looking it up more
than once.  I certainly don't have any problem with a function name
like "setFlagValue()."  It's pretty obvious that a function with a
name like that is looking for a true or false value.


>You consider that this is easier to maintain?????

Yes.  Why so shocked?

>It removes the intent behind the value!  "TRUE" shows intent to
>use a boolean type (which does not exist in C), and that the
                     ^^^^^^^^^^^^^^^^^^^^^^^^^
Exactly.

>function is expecting a truth value of some sort.  Using "1"
>is misleading in that the next person to come along only knows
>that this function accepted some integer value without any
>clue that it was primarly a truth value.

If it matters they probably have to know more about the function
than that it takes some sort of integral value.  

>If I misunderstood your statement:
>    "Whenever I see TRUE and FALSE in code I am maintaining 
>    I remove the #defines"

Well that may be a bit strong I suppose.  I mean I don't make wholesale
changes to code that I am making one or two trivial changes to but if
it is something that I am doing a major rewrite to then yes that would
be one of the early candidates for cleanup.

>I apologize for this post.  But to me the statement is a bit
>unclear in it's intent. :)

But it is a TRUE statement.  :-)

-- 
D'Arcy J.M. Cain (darcy@druid.com)  |
D'Arcy Cain Consulting              |   There's no government
Toronto, Ontario, Canada            |   like no government!
+1 416 424 2871          DoD#0082   |
Newsgroups: comp.lang.c
From: Nico Tranquilli <ntranqu@caticsuf.cati.csufresno.edu>
Subject: external sorting
X-Xxmessage-Id: <A72E89E8A9050B1B@mac2.di.unipi.it>
X-Xxdate: Tue, 17 Nov 92 10: 37:12 GMT
Organization: Department of Computer Science, Pisa University
X-Useragent: Nuntius v1.1.1d9
Date: Tue, 17 Nov 1992 10:31:11 GMT

I'm writing an article on how to sort large files using Mergesort 
and I was wondering if anyone out there know of other good
sorting algorithms that can be used for external sorting too. 

--
Nico Tranquilli
v. Ruffini, 13
62012 Civitanova Marche (MC) - Italy
phone: +39 (50) 550-266
home phone: +39 (733) 770-332
net: ntranqu@caticsuf.cati.csufresno.edu
Newsgroups: comp.lang.c
From: sbtaves@icaen.uiowa.edu (Steven Bradley Taves)
Subject: How to malloc an array of pointers?
Organization: Iowa Computer Aided Engineering Network, University of Iowa
Distribution: usa
Date: Thu, 19 Nov 1992 00:49:50 GMT

Hi all,

    I'd appreciate it if someone could tell me how I can allocate memory
for an array of pointers and for the strings they will be pointing to.

I have  
       char *Var[];

Normally for
       char *Var;
you do
       Var=(char *)malloc(10*sizeof(char));
for a string of 10 characters.

I want to allocate memory for 10 strings of ten characters.  Also, how
do I allocate memory for the pointers themselves?

Thanks,
Steve


-- 
____________________________________________________________________
"A boy he was tangled in his fight forever, a girl was missing
 two fingers","How do they kill children, and why do I wanna die"
-Throwing Muses 
Got any news on The Breeders? Email me sbtaves@icaen.uiowa.edu
--------------------------------------------------------------------
From: rcoadh@kultarr.co.rmit.oz.AU (Alexander Doktorovich)
Newsgroups: comp.lang.c
Subject: vsscanf
Date: 21 Nov 1992 09:32:23 GMT
Organization: RMIT Computer Centre
NNTP-Posting-Host: kultarr.co.rmit.oz.au

Hi, 
  I am writing in the hope than someone out there has a public domain
  version of VSSCANF() source. 
  Can someone please save the rest of my hair (there ain't much to save!) and 
  send it to me. It's for non-commercial usage and I will be very grateful.
  It can use other ANSI C libraries ofcourse,
Alex Doktorovich.

PS.
  My project involves some simulation, so I wrote the program on PC's
  Turbo C2. My thinking went like this - C is a portable language, hence I 
  will write and prototype the program on the PC, and then downloaded it to our
  SUN2/Cray to make the simulation time reasonable.
  Unfortunately, Turbo C has a vsscanf() which is pretty handy, (thank you,
  Mr Borland, you scum-bag!) which I incorporated into all of my modules. 
  Why was I so stupid to incorporate non-ANSI C function into my to-be
  uploaded code? Well, Turbo C manual states that vsscanf() is available 
  on UNIX V, unfortunately, as I found out from MAN command, on our SUNs
  there ain't no vsscanf(). 
  Unfortunately, I am not a hot-shot programmer and am quite incapable of
  writing my own vsscanf() without spending tones of time.
  Why was vsscanf() not incorporated into ANSI C when its complementory
  function vsprintf() was, `beats me'!
From: kev@dsbc.icl.co.uk (Kevin Walsh)
Newsgroups: comp.lang.c
Subject: Re: C specification in YACC
Date: 20 Nov 92 11:49:03 GMT
Organization: Cursor Software Limited, London, England

In article <1992Nov19.040414.3111@seas.gwu.edu> marcel@seas.gwu.edu (marcel) writes:
>
> I am looking for the C language specification written in YACC. If you 
> have it please send it to me 
> 
> 		marcel@seas.gwu.edu 
> 
> I appreciate any assistance you can offer me.  Thank you 
>
Ooooo yes please, me too.

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/     K e v i n  W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/      kev@dsbc.icl.co.uk
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/
From: scotth@felix.filenet.com (Scott Hopson)
Newsgroups: comp.lang.c
Subject: Re: Questions on kill signal
Date: 21 Nov 92 17:35:06 GMT
Reply-To: scotth@fritz.filenet.com (Scott Hopson)
Organization: FileNet Corp., Costa Mesa, CA

In article <1992Nov19.093605.11370@nuscc.nus.sg> isc40038@nusunix1.nus.sg (LIM FANG HOW) writes:
>How to implement a process that when receives a kill signal from the
>shell, will write some characters into a text file ? 
> 
>P.S :
>     This process must be able to receive the kill signal at any point.....

Are you refering to a kill -9 PID ? If so then I think your out of luck,
this would require that your process be able to trap SIGKILL which is not
allowed. If your'e refering to other signals then you can use 'signal' to 
trap the signal and perform your required functions. For info on trapping
signals just read the man page, it should provide all you need.



-- 
Scott Hopson   (scotth@filenet.com)
From: alien@acheron.amigans.gen.nz (Ross Smith)
Newsgroups: comp.lang.c
Subject: Re: Questionnaire
Date: 19 Nov 92 17:40:54 GMT+12
Distribution: world
Organization: Wanganui Amigans, Wanganui, NZ

In article <Bxtzwt.BB6@cs.dal.ca> jarrous@ug.cs.dal.ca (GHASSAN GSJ JARROUS) writes:
>
> b) Would you buy an 80586 machine within a year of their
>    introduction ?  Yes _  No _
>    - If Yes, why would you buy an 80586 ? _________________

There's no such chip. Intel have officially named their new chip "Pentium",
to get around the court ruling that a number can't be a registered trademark.


--
...... Ross Smith (Wanganui, NZ) ...... alien@acheron.amigans.gen.nz ......
   Mine is the ship bound for Alpha Centauri
   We must be out of our minds
   For though we are shipmates bound for tomorrow
   Everyone here's flying blind                          (Crystal Gayle)
--
From: llew@bigwpi.WPI.EDU (Lok C. Lew Yan Voon)
Newsgroups: comp.lang.c
Subject: has anybody heard of 'onexit' ?
Date: 23 Nov 1992 01:55:08 GMT
Organization: Worcester Polytechnic Institute
Distribution: world
NNTP-Posting-Host: bigwpi.wpi.edu

i'm running a set of f77 codes on a dec3100 (ultrix),
together with a C interface for doing dynamic memory
allocation.

now i decided to convert all the prog into C by using f2c.
when i tried to compile everything, the linker complains:
	Undefined:
	onexit

i did a grep on all the .c files and there's no 'onexit'
string.
(btw, i had done the same on a different platform and
there's no problem.)

does anyone know what's going on?
(i've no knowledge of C beyond chp one of K&R!)

thanks,
lok
Newsgroups: comp.lang.c
From: craigh@cserver.plexus.com (Craig Heilman)
Subject: Re: Can you program in C?
Organization: Plexus Corp. -- Neenah Wisconsin
Date: Wed, 18 Nov 1992 21:58:27 GMT

tada@athena.mit.edu (Michael J Zehr) writes:

>In article <00963BF4.675CEA80@vms.csd.mu.edu> 2644danticoj@vms.csd.mu.edu writes:
>>My name is Cetera ... can you help me write  these programs, thereby
>>allowing me to graduate and go on to serve my country as an officer on a
>>nuclear submarine? 

>I for one would love to help someone skip a step required to qualify him
>or her to server on a nuclear submarine.  I will sleep better at night
>knowing that an officer of our nuclear submarine fleet has done
>something like this.

I agree wholeheartedly!  The thing that cracks me up about this post is
the fact that the author says "my country" which doesn't necessarily mean
the U.S.A....
--
*                           * "I just found out that the brain is like a   *
* Craig A. Heilman          * computer.  If that's true, then there really *
* craigh@cserver.plexus.com * aren't any stupid people.  Just people       *
*                           * running DOS." - VH1's Stand Up Spotlight     *
Newsgroups: comp.lang.c
From: rpeck@pure.com (Ray Peck)
Subject: Re: ld: Undefined symbol Problem.
Organization: Pure Software, Los Altos, CA
Date: Tue, 17 Nov 1992 23:44:39 GMT

In article <1992Nov10.211544.16332@teknetix.com> hiren@teknetix.com writes:
> 
>Hi:
> 
>I am trying to "make" a program and foll. are the errors that I get:
> 
>ld: Undefined symbol
>   _sin
>   _cos
>   _pow
>   _floor
>   _get_wmShellWidgetClass
>   _get_applicationShellWidgetClass
>   _dlopen
>   _dlclose
>   _dlsym
>*** Error code 2
>make: Fatal error: Command failed for target `xdbx'


sin, cos, pow, and floor are in libm.  You'll need a "-lm" at the end
of your link line.

dlopen, dlclose, and dlsym are in libdl.  You'll need a "-ldl".


_get_applicationShellWidgetClass and _get_wmShellWidgetClass are in
libXmu.  You'll need a "-lXmu".


How did I find these?  With nm.

pure% cd /usr/openwin/lib
pure% foreach i (lib*)
? echo $i
? nm $i | grep _get_applicationShellWidgetClass
? end
libX.sa.1.0
libX.so.1.0
libX11.sa
libX11.sa.4.3
libX11.so
libX11.so.4.3
libXaw.so
libXaw.so.4.0
libXmu.sa
00000000 T _get_applicationShellWidgetClass
libXmu.sa.4.0
00000000 T _get_applicationShellWidgetClass
libXmu.so
libXmu.so.4.0
libXol.so
libXol.so.3.1
libXt.sa
libXt.sa.4.1
libXt.so
libXt.so.4.1
libce.so.0.0
libcps.so
libcps.so.1.0
libdeskset.sa.0.1
libdeskset.so.0.1
pure% 
-- 
Ray Peck						rpeck@pure.com
Pure Software						415-903-5100
From: smr@pki-nbg.philips.de (Stephen Riehm)
Newsgroups: comp.lang.c
Subject: Re: Wait for child
Date: 17 Nov 92 08:30:49 GMT
Reply-To: smr@pki-nbg.philips.de

singg@alf.uib.no (Kurt George Gjerde) writes:

>On Unix, how can I have a process wait for it's child process to do something
>(not terminate).

>I've tried using sigpause (couldn't find pause) in the parent process, and 
>having the child to send SIGCONT, but that didn't work...

>Any ideas?

Using signals:
	set up a signal handler for SIGUSR1 or SIGUSR2, using either
	    signal(2), sigset(2), or sigpause(2).
	use wait(2) to sleep until a signal is received ( unless you
	    are using sigpause(2) )

	The signal handler will only be called if a SIGUSR1 or SIGUSR2
	is sent (from the child), any other signal will only terminate the
	wait call, so you can put some error trapping after the wait,
	eg: if your signal handler was called then the code can go ahead
	    as normal, otherwise, erase some disks, core dump,
	    send abusive mail to random users, and finally crash the
	    system.

>( Right now it works with the parent constantly checking the existence of a
>  file. When the child removes the temp-file, the parent continues... 
>  THIS SLOWS DOWN THE SYSTEM! )

Using a status file of some sort:
	in SYSV (at least) there is select(2), this is a very
	economical way of waiting for input from a variety of sources.
	In short, all you need to do is give it a bunch of file
	descriptors (not file pointers), and some details about what
	to do, and it will sleep until there is some input waiting on
	one of those file descriptors, it then returns information
	about which file descriptors have data waiting to be read. You
	could set up a pipe, or a file, and the child could simply
	send single character status reports when something happens.
	(Make sure everything is properly flushed!)
	In this way the parent could monitor many children
	simultaneously, and the information flow between the processes
	is somewhat more flexible. (signals don't tell you anything
	about WHICH child, or what the child is doing, unless you use
	many different signals), the parent could even send replies.

Hope this helps, this is all theoretical only, I have written some
stuff using this style of communications before, but that was years
ago ;-)

-----------------------------------------------------------------
Stephen Riehm		Configuration Management	   _-_|\ 
smr@pki-nbg.philips.de	Philips Kommunikations Industrie  /     \
Work: +49 911 526 2975	Nu"rnberg, Germany		  \_.-.!/
Fax:  +49 911 526 3678	"I was there, now I am here!"	       v 
"My company speaks another language, I CAN'T speak on its' behalf"
Newsgroups: comp.lang.c,comp.software-eng
From: books@fsunuc.physics.fsu.edu (Roger Books)
Subject: Re: Will we keep ignoring this productivity issue?
Organization: FSU nuclear physics
Date: Tue, 17 Nov 92 17:16:57 GMT

In article <1992Nov17.091220.9284@iccgcc.decnet.ab.com> kambic@iccgcc.decnet.ab.com (Bonus, Iniquus, Celer - Delegitus Duo) writes:
>
>IMHO, there is probably no better background for SE than physics.  Why? 
>Problem solving.  Experimental techniques.  Basic understanding of the
>strangeness of the universe.  All useful.  

I don't know about that last one.  The Physicists are some of the most
intelligent people I know.  They can solve almost any problem you throw
at them, but, their programming is kludgey and atrocious to maintain.
From what I've seen they seem to be trained to get it done now.  If it
involves dropping a kludge in to make it work they do and then forget
about it.  This may be different with theorists but the experimentalists
I work for don't write maintainable code.

>
>We are all  experiments in software engineering right now, because the field 
>doesn't have the stability in training or definition that it needs.   
>
>George Kambic
>sd
>

Roger
books@fsunuc.physics.fsu.edu
From: 2hujwant@kuhub.cc.ukans.edu
Newsgroups: comp.lang.c
Subject: DOWN
Date: 20 Nov 92 03:31:53 CST
Organization: University of Kansas Academic Computing Services


Hello, C programmers.

	Is there a FAQ for this group? I have some really stupid
questions, and I would rather feel silly reading a FAQ than look silly
posting them.

	Any help is appreciated. Later.

Sean White :::::::::::::> 2hujwant@kuhub.cc.ukans.edu

Newsgroups: comp.lang.c
From: msb@sq.sq.com (Mark Brader)
Subject: Re: Idle Questions about ANSI C
Organization: SoftQuad Inc., Toronto, Canada
Date: Tue, 17 Nov 92 20:56:52 GMT

I wrote:
> A side remark ... [On] this ... pre-ANSI implementation ... size_t
> is *int*.  And in fact sizeof appears to return int also; at least,
> "sizeof(char) < -1" is false, whereas in ANSI C it's true.

Whoops.  I should of course have said that in ANSI C that last statement
*would* be true if size_t was at least as big as unsigned int.  Thanks to
Jutta Degener for pointing this out in email.
-- 
Mark Brader, SoftQuad Inc., Toronto, utzoo!sq!msb, msb@sq.com
	"I'm a little worried about the bug-eater," she said.  "We're embedded
	in bugs, have you noticed?"		-- Niven, "The Integral Trees"

This article is in the public domain.
Newsgroups: comp.lang.c
From: msb@sq.sq.com (Mark Brader)
Subject: Re: Idle Questions about ANSI C
Organization: SoftQuad Inc., Toronto, Canada
Date: Tue, 17 Nov 92 15:58:26 GMT

> > According to K+R 2nd ed, section A7.4.8, size_t is "an unsigned
> > integral constant; the particular type in implementation defined".
> 
> Well, the result of sizeof is the quoted thing, and it notes that
> <stddef.h> defines the type in question as size_t.
> 
> Now: is it required that size_t be the same as one of the four usual
> unsigned integral types?  (How about ptrdiff_t?)

The wording of section 3.1.2.5/6.1.2.5 of the standard clearly implies
that the 9 "usual" integral types are the only ones.  They consist of
4 signed integer types, 4 unsigned integer types, and char -- which
of course can be either signed or unsigned.  Since size_t and ptrdiff_t
are specified respectively as unsigned or signed *integral* types, not
*integer* types, then an implementation could actually use char for
one of them -- remember, it could be the same size as int or even long.
So there are 5 possibilities for each.

There *are* implementations that define extra integral types -- the
appendix even mentions this as a common extension.  However, I don't
see how an implementation could be conforming if it made size_t, say,
a type that was longer than long.

Threads that are purely about ANSI C, as this one is according to its
subject line, are better placed in comp.std.c.  If someone wants to
dispute the above conclusions in terms of the standard, I suggest they
crosspost to comp.std.c and direct followups there.

A side remark since I *am* writing in comp.lang.c.... the computer on
which I'm typing this has a pre-ANSI implementation in which size_t
is provided, not in one of the standard C headers, but in the UNIX
header <sys/types.h> ... and size_t is *int*.  And in fact sizeof
appears to return int also; at least, "sizeof(char) < -1" is false,
whereas in ANSI C it's true.
-- 
Mark Brader, SoftQuad Inc., Toronto, utzoo!sq!msb, msb@sq.com
#define	MSB(type)	(~(((unsigned type)-1)>>1))

This article is in the public domain.
Newsgroups: comp.lang.c
From: forb0004@student.tc.umn.edu (Eric Forbis)
Subject: Pascal as C prelude?
Organization: University of Minnesota
Date: Sat, 21 Nov 1992 03:10:25 GMT

The U of Mn suggests, but does not require, taking a quarter of Pascal 
before taking C. I have no experience with pascal, but have read that the 
two languages utilize similar concepts and structures couched in different 
terms. Is pascal really a useful introduction to C- should I be taking 
that class after all? It's not my intent to start a C vs pascal flame war 
here... It seems to me that, if pascal is that similar to C, you might as 
well forego pascal and hop right into C. 

Any thoughts?

Thanks much,

Eric Forbis
---------

Eric Forbis      forb0004@student.tc.umn.edu
Xref: sparky comp.lang.c:17019 comp.unix.questions:13820
From: rgasch@nl.oracle.com (Robert Gasch)
Newsgroups: comp.lang.c,comp.unix.questions
Subject: Interprocess Communication Source Wanted
Date: 23 Nov 92 07:54:18 GMT
Followup-To: comp.unix.questions
Organization: Oracle Europe

I have been attempting to figure out how interprocess
communication works under Unix. The problem is that
all the sample code i have to look at, is part of a
large application and cluttered up with all sorts of
other unreadable code which has nothing to do with 
the communication part that I'm actually interested
in.

If anybody out there has any simple programs which 
demonstrate interprocess communication I'd appreciate it
if I could take a look at them. 


Thank you very much
--> Robert


******************************************************************************
* Robert Gasch	       *         Ich will einmal nach Saarbruecken           * 
* Oracle Engineering   *           Ja Saarbruecken waere nett                * 
* De Meern, NL	       *          Ich will Haare auf dem Ruecken             *
* rgasch@nl.oracle.com *             Und ein rosa Gummibett     - Die Aerzte *
******************************************************************************
Newsgroups: comp.lang.c
From: goudreau@gotham.rtp.dg.com (Bob Goudreau)
Subject: Re: Questionnaire
Date: Mon, 23 Nov 92 05:25:51 GMT
Organization: Data General Corporation, RTP, NC

In article <alien.018x@acheron.amigans.gen.nz> alien@acheron.amigans.gen.nz (Ross Smith) writes:
>In article <Bxtzwt.BB6@cs.dal.ca> jarrous@ug.cs.dal.ca (GHASSAN GSJ JARROUS) writes:
>>
>> b) Would you buy an 80586 machine within a year of their
>>    introduction ?  Yes _  No _
>
> There's no such chip. Intel have officially named their new chip
> "Pentium", to get around the court ruling that a number can't be a
> registered trademark.

So who said "Intel 80586"?   I've seen some articles claiming that
at least one chip-clone maker (AMD) is considering using the "586"
moniker for its Pentium clone -- customers allegedly like the
implication of continuity from the company's current "386" and "486"
models.

----------------------------------------------------------------------
Bob Goudreau			Data General Corporation
goudreau@dg-rtp.dg.com		62 Alexander Drive	
+1 919 248 6231			Research Triangle Park, NC  27709, USA
Newsgroups: comp.lang.c
From: mccall@mksol.dseg.ti.com (fred j mccall 575-3539)
Subject: Re: Can you program in C?
Organization: Texas Instruments Inc
Date: Thu, 19 Nov 1992 19:22:42 GMT

In <craigh.722123907@cserver> craigh@cserver.plexus.com (Craig Heilman) writes:

>tada@athena.mit.edu (Michael J Zehr) writes:

>>In article <00963BF4.675CEA80@vms.csd.mu.edu> 2644danticoj@vms.csd.mu.edu writes:
>>>My name is Cetera ... can you help me write  these programs, thereby
>>>allowing me to graduate and go on to serve my country as an officer on a
>>>nuclear submarine? 

>>I for one would love to help someone skip a step required to qualify him
>>or her to server on a nuclear submarine.  I will sleep better at night
>>knowing that an officer of our nuclear submarine fleet has done
>>something like this.

>I agree wholeheartedly!  The thing that cracks me up about this post is
>the fact that the author says "my country" which doesn't necessarily mean
>the U.S.A....

Quite true.  I hadn't considered that.  I suppose he COULD be from
U.K. and studying over here.  However, given the relative odds, I
think the assumption that he's talking about the U.S. Navy are a good
bet.  Perhaps someone should get the address for the Navy ROTC
commander at his school?

Frankly, I would have to consider his 'request' to go beyond just bad
form; the UCMJ *does* include an article about conduct unbecoming an
officer. 

-- 
"Insisting on perfect safety is for people who don't have the balls to live
 in the real world."   -- Mary Shafer, NASA Ames Dryden
------------------------------------------------------------------------------
Fred.McCall@dseg.ti.com - I don't speak for others and they don't speak for me.
Newsgroups: comp.lang.c