HDTenEightyP/NetNews huggingface dataset:
From: rwh@moose.cccs.umn.edu (RICHARD HOFFBECK)
Newsgroups: comp.lang.c
Subject: Re: Curses eats the right bottom corner? (ISC SysV3.2)
Date: 13 Apr 92 14:42:00 GMT
Article-I.D.: moose.13APR199209421551
Reply-To: rwh@moose.cccs.umn.edu
Organization: Colon Cancer Control Study, University of Minnesota, Minneapolis
News-Software: VAX/VMS VNEWS 1.41

In article <1992Apr10.222151.5270@mits.mdata.fi>, jjj@mits.mdata.fi (Joni Jarvenkyla) writes:
>  
> When I draw a box around the screen somebody goes and eats the right
> bottom corner of the box? Why? How to fix it?
>  
> Doesn't matter whether I use box() or try to make for loops which print
> characters on the windowsides.

As I remember it, curses will not write to the lower right hand corner 
unless it is told that it is alright to do so.  I believe that you need 
to use the scrollok() function or some such thing to indicate that writing 
to the corner will not invoke a screen scroll.  If your terminal 
automatically scrolls after writing to the last screen position, you're
out of luck :-(  I usually use NLINES-1 screen lines for boxes and reserve
that last line for critical error messages to avoid the problem.

--rick

+-----------------------------------------------------------------+
| Richard Hoffbeck               INTERNET: rwh@moose.cccs.umn.edu |
| Colon Cancer Control Study     Packet  : n0lox@wb0gdb.mn.usa.na |
| University of Minnesota        CIS     : 72406,521              |
| Minneapolis, MN 55455          Genie   : rhoffbeck              |
| (612) 627-4151                                                  |
+-----------------------------------------------------------------+
Newsgroups: comp.lang.c
From: kdontas@gmuvax2.gmu.edu (Kejitan Dontas)
Subject: Help needed with Linking
Organization: George Mason University, Fairfax, Va.
Date: Wed, 8 Apr 1992 16:49:48 GMT

	Hi,
	    I'm currently trying to link CLIPS 5.0 with my own C source
code, and am having difficulties.  I am using Borland C++ 2.0, but
writing regular C. I have one C source file, and the CLIPS library which
consists of 68 C object files.  Everything compiles, but during linking,
I get 47 error messages of the form:

	'Linker Error : SEGMENT _TEXT exceeds 64K' 

	    This line appears for 47 of the 68 object files in the
library.  I don't believe this is a problem in the library as the files
in it were written by the government (hmm.....) not me.  Am I just
missing an option when linking or compiling ?  Any help will be much
appreciated.  Also, if this is the wrong group for this message, could
someone E-Mail me and suggest a better choice.

			Many thanks in advance,

					Chris
From: moconnor@pms704.pms.ford.com (Mike O'Connor)
Newsgroups: comp.lang.c
Subject: flock() to lockf() conversion routines?
Date: 13 Apr 92 20:18:06 GMT
Reply-To: Mike O'Connor <mjo@fmsrl7.srl.ford.com>
Organization: "Fordz"
X-Disclaimer: Not an official spokesperson for Ford Motor Co.

I have a machine with a lockf(), but no flock().  I am trying to port
code over that has numerous flock() calls in it.  Has anyone developed
C routines to handle this effectively?  I don't feel like re-inventing
the wheel, even though I do work at a car company.  :)

					...Mike

-- 
 Mike O'Connor                     |  Ford Motor Company, USA
 Applications Systems Analyst      |  CPD P&MS ECC Core Software
 Phone #:  +1 (313) 390-4008       |  P.O. Box 2053, ECC MD-7
 Fax #:    +1 (313) 845-0576       |  Dearborn, MI  48121-2053
From: alpha@wyvern.twuug.com (Joe Wright)
Newsgroups: comp.lang.c
Subject: Re: maximum malloc() allocation size?
Date: 10 Apr 92 04:16:43 GMT
Organization: Tidewater UNIX Users Group

jamesh@cs.umr.edu (James Hartley) writes:
: In fooling around with porting code to and from an Amiga to a Sun, I
: have run into some allocation quirks.  I also can't seem to locate where
: ANSI states this *if* they do, but is there a maximum size in which
: malloc(), calloc(), etc. can allocate?  Inquiring minds want to know...
: I sincerely appreciate any pointers (no pun intended) and anyone can
: give me.
: -- 
: James J. Hartley               _   /| Internet: jamesh@cs.umr.edu
: Department of Computer Science \'o.O'   Bitnet: jamesh@cs.umr.edu@umrvmb.bitnet
: University of Missouri - Rolla =(___)=    UUCP: ...!uunet!cs.umr.edu!jamesh
: "If at first you don't succeed,   U   compile, compile, again..."

Probably no more than 2 Giga bytes or so.  Less if you have 'small'
memory.  (Pun Intended).  Really though, it is the operating system,
not the language which will limit the memory available to a process.
There is no 'maximum' or 'minimum' memory available.  That's why you
should check the return from malloc() for error.  Always.

-- 
Joe Wright  alpha@wyvern.twuug.com    
Newsgroups: comp.lang.c
From: bateman@hamel.epm.ornl.gov (Ken Bateman)
Subject: Are 'polymorphic' structs portable?
Reply-To: bateman@msr.ornl.gov
Organization: Oak Ridge National Lab, EPM
Date: Wed, 15 Apr 1992 14:22:16 GMT

To all you portability gurus out there:

I want to have a linked list of structures of different types.  So:

	typedef enum { 
		typeA, typeB 
	} element_type;
	typedef struct _generic_elem {
		element_type type;
		struct _generic_elem *next;
	} generic_elem;
	typedef struct _typeA_elem {
		element_type type;
		generic_elem *next;
		char *typeA_string;
	} typeA_elem;
	typedef struct _typeB_elem {
		element_type type;
		generic_elem *next;
		struct bar this_bar;
		int any_old_int;
	} typeB_elem;

Can I safely assume that the offset of the 'type' and 'next' elements
is always constant for all compilers?  i.e.:
	union {
		generic_elem g;
		typeA_elem A;
		typeB_elem B;
	} foo;
	assert(&(foo.g.type) == &(foo.A.type));
	assert(&(foo.g.type) == &(foo.B.type));
	assert(&(foo.g.next) == &(foo.A.next));
	assert(&(foo.g.next) == &(foo.B.next));

Thanks in advance

-- 
Ken Bateman                       bateman@msr.ornl.gov 
Newsgroups: comp.lang.c
From: tomg@code3.com (Tom Green)
Subject: Re: goto statement
Organization: 3M Health Information Systems
Distribution: usa
Date: Mon, 13 Apr 1992 15:06:26 GMT

In article <eb9Hg?uo6@cs.psu.edu> yltang@bree.endor.cs.psu.edu (Yuan-Liang Tang) writes:
>
>Hi netters,
>
>    I know this may be trivial, but I simply couldn't find
>an answer in the FAQ list. So, here the question comes ...
>
>    Can I use "goto" statement to transfer control to other
>function or other module than the current function?
>
>    Thanks in advance.
>
>/Tang
>

Use longjump().

-- 
Tom Green
- Life's a pain, then you die.                            _/_ __ ____ __
  "I shall be merciful and quick" - the Gorn              /  /_// / //_/
tomg@code3.code3.com                                                 _/
Xref: sparky comp.lang.c:7539 comp.lang.pascal:2879 comp.programming:858 comp.sources.wanted:2508
From: cyu@ecl.psu.edu
Newsgroups: comp.lang.c,comp.lang.pascal,comp.programming,comp.sources.wanted
Subject: WANTED:PASCAL->C translator
Date: 13 Apr 92 13:30:02 EDT
Organization: Engineering Computer Lab, Pennsylvania State University

Hi,

I'm looking for a source translator that translates PASCAL source file to 
C source file.
Preferably the translator itself written in C, PASCAL or BASIC.

Thanks in advance,

Chansu Yu

P.S. Please respond by email to
	cyu@cmpe.psu.edu
because I don't usually follow this group.
From: eric@pencom.com
Newsgroups: comp.lang.c
Subject: Re: passing structure to a function
Date: 13 Apr 92 13:25:27 GMT
Organization: Pencom Software

In article <mcook.702998942@mrc.dev.cdx.mot.com> mcook@mrc.dev.cdx.mot.com  
(Michael Cook) writes:
> volpe@bart.crd.ge.com (Christopher R Volpe) writes:
> 
> >In article <mcook.702843388@mrc.dev.cdx.mot.com>,
> >mcook@mrc.dev.cdx.mot.com (Michael Cook) writes:
> >|>volpe@bart.crd.ge.com (Christopher R Volpe) writes:
> >|>
> >|>>C, whether it be ANSI or pre-ANSI, has always required that all  
parameters,
> >|>>structures or otherwise, be passed by value.
> >|>
> >|>Except arrays.  They're passed by reference.
> 
> >Wrong. Arrays aren't passed at all. Pointers are passed. And they're passed
> >by value.
> 
> What's the difference between call-by-reference and passing a pointer?

A slight semantical difference.  Pointers in C can EMULATE call-by-reference
but are more general than that.

i.e.  a function such as

foo(int *a)
{
    *a = 5 ;
}

might certainly be considered call-by-reference.
99.99999% of the time you will call it like :
     int a ;
     foo(&a) ;

but you could do something like :
     int *a = (int *)malloc(sizeof a) ;
     foo(a) ;

This is not really call by reference, but somehting a little more
general.  You are not passing a pointer to a variable, but are
passing a pointer to generic "memory".
Xref: sparky comp.lang.c:7677 comp.windows.ms.programmer:5492
Date: Wed,  8 Apr 92 21:05:52 +0200
From: Heinz_Ozwirk@spam.fido.de (Heinz Ozwirk)
Subject: Re: impossible in C ? -macro
Newsgroups: comp.lang.c
X-Comment-To: Victor_A._Holen@f1.n6000.z2.fidonet.org (Victor A. Holen)
Organization: Madness takes its toll 

 VA> Is it possible to have a macro that declares local variables
 VA> and returns a value.

I would say this is impossible. You can only define variables at the beginning 
of compound statement or block ( {...} ). However, only expressions have a 
(non-void) value. But compound statements are no expressions. So at least a 
macro which declares local variables cannot return a value based on local 
variables. I doubt that there is any way to put a compund statement anywhere in 
an expression, and i would even bet a beer or two on that, but i am not really 
certain, but almost.

   -heinz-


Xref: sparky comp.lang.c:7311 comp.compilers:744 comp.groupware:395 comp.software-eng:1747
From: kdj@tigger.sw.stratus.com (Ken Jordan)
Newsgroups: comp.lang.c,comp.compilers,comp.groupware,comp.software-eng
Subject: Code Coverage Tools (C0, C1, S1)
Keywords: C, testing
Date: 2 Apr 92 16:29:41 GMT
Reply-To: kdj@tigger.sw.stratus.com (Ken Jordan)
Followup-To: comp.lang.c
Organization: Stratus Computer, Software Engineering

I'm looking for C0 (statement level), C1 (decision level), and S1 (path)
ANSI C compatible code coverage tools for the Sun workstation.

If you know of any tools available, please e-mail me.  If you've used
them, i'd like your impressions (pros and cons -- if you're willing to
share them...)

I'll post the results.

Thanks in advance.

Ken
-- 
Ken Jordan              kdj@sw.stratus.com
Stratus Computer        
Marlboro, MA, USA      
-- 
Send compilers articles to compilers@iecc.cambridge.ma.us or
{ima | spdcc | world}!iecc!compilers.  Meta-mail to compilers-request.
Newsgroups: comp.lang.c,comp.lang.pascal,comp.programming,comp.sources.wanted
From: klassen@sol.UVic.CA (Melvin Klassen)
Subject: Re: WANTED:PASCAL->C translator
Organization: University of Victoria, Victoria, B.C. CANADA
Date: Mon, 13 Apr 92 23:39:30 GMT

In article <*> Chansu Yu <cyu@ecl.psu.edu> writes:
>
>I'm looking for a source translator that translates PASCAL source file to 
>C source file.
>
>P.S. Please respond by email, because I don't usually follow this group.
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
A short excerpt from the "Frequently-Asked Questions" file 
in the 'comp.lang.c' newsgroup:

Newsgroups: comp.lang.c,news.answers
From: scs@adam.mit.edu (Steve Summit)
Subject: comp.lang.c Answers to Frequently Asked Questions (FAQ List)
Date: Wed, 1 Apr 1992 05:28:03 GMT

Archive-name: C-faq/faq

Section 16. Miscellaneous

16.5:	Does anyone know of a program for converting Pascal (Fortran,
	lisp, "Old" C, ...) to C?

A:	Several public-domain programs are available:

	p2c	written by Dave Gillespie, and posted to
		comp.sources.unix in March, 1990 (Volume 21); also
		available by anonymous ftp from csvax.cs.caltech.edu,
		file pub/p2c-1.20.tar.Z .

	ptoc	another comp.sources.unix contribution, this one written
		in Pascal (comp.sources.unix, Volume 10, also patches in
		Volume 13?).

	A PL/M to C converter was posted to alt.sources in April, 1991.

	The following companies sell various translation tools and services:

		Cobalt Blue
		2940 Union Ave., Suite C
		San Jose, CA  95124  USA
		(+1) 408 723 0474

		Promula Development Corp.
		3620 N. High St., Suite 301
		Columbus, OH  43214  USA
		(+1) 614 263 5454

		Micro-Processor Services Inc.
		92 Stone Hurst Lane
		Dix Hills, NY  11746  USA
		(+1) 519 499 4461

Xref: sparky comp.lang.c:7715 comp.std.c:1840 comp.arch:5112
From: mash@mips.com (John Mashey)
Newsgroups: comp.lang.c,comp.std.c,comp.arch
Subject: Re: "long long" for 64 bits [really, nostalgia time]
Date: 17 Apr 1992 05:03:17 GMT
Organization: MIPS Computer Systems, Inc.
NNTP-Posting-Host: winchester.mips.com

In article <1TA02R9@cdis-1.compu.com> tanner@cdis-1.compu.com (Dr. T. Andrews) writes:
>There  are  two  things  about  the  compatibility  argument  for
>desiring  sizeof(int)  == sizeof(long) which never cease to amaze
>me.
>
>Of course the first is that, when ``long'' was introduced on  the
>pdp-11, its size wasn't the same as that of ``int''.  Why not, if
>this compatibility is important?

This is not to support the idea that sizeof(int) must equal sizeof(long),
but this is hardly amazing, as:

THEN WAS THEN, NOW IS NOW...

1) long was introduced during late 1975 / early 1976.  [My Sixth Edition
manual, May 1975, has no trace of long ... except for inserted manual
pages gotten off the research machine, labeled 4/25/76 that show long used
for tell(II), times(II), etc.  I don't remember exactly when Dennis put
long in, but 1Q76 seems about right.

2) Recall the world of that time: UNIX basically ran on PDP-11s, with up
to 248KB of memory ... sometimes supporting as many as 24 users.
We mostly had 11/45s; we got our first 11/70 in 2Q76.  BTL PY had one of
the *larger* collections of UNIX systems in one place - we had 2 11/45s
and 1 11/70  and at that time, it was one of the very few places where you
could get access to a UNIX machine unless you begged time on research,
or were working on a project to be delivered on a UNIX machine.

3) There was *no* 3rd-party software in any normal sense.
Very few people used code that did *not* come from:
	a) The research crew
	b) The PWB developers (if you were at Piscataway)
	c) The USG folks (if you were an operations systems developer)
	d) Your immediate colleagues.
An awful lot of code was developed by 2 people; a bunch more by <10;
I'd guess that *most* widely used code was developed by no more than
100 people...
A few universities had this.

4) When long came in, it clearly meant 32-bits on PDP-11s;
when you had 64KB of data+stack, and when you needed instruction
sequences to do thigns with longs, on .5mips machines supporting 20+ users,
you did not casually call things longs unless there was a reason...

***TIME PASSES***

5) now, we've lived for >10 years where lots of people have been using
32-bit machines, many for which thought sizeof(int) == sizeof(long).
(yes, there are very important cases where that's not true).
"worse", for the vast bulk of machines out there, sizeof(long) = 4,
regardless of whether or not sizeof(int) == sizeof(long) ...

The code is written by a few more than 100 people...
-- 
-john mashey	DISCLAIMER: <generic disclaimer, I speak for me only, etc>
UUCP: 	 mash@mips.com OR {ames,decwrl,prls,pyramid}!mips!mash 
DDD:  	408-524-7015, 524-8253 or (main number) 408-720-1700
USPS:	MIPS Computer Systems M/S 5-03, 950 DeGuigne, Sunnyvale, CA 94086-3650
Newsgroups: comp.lang.c
From: damurphy@wc.novell.com (Duane A Murphy)
Subject: Re: impossible in C ? -macro
Summary:  Yes! 
Keywords: macro declaration return
Organization: Novell, Inc. - Walnut Creek
Date: Thu, 9 Apr 1992 23:45:45 GMT

In article <1992Apr7.163859.11481@xilinx.com> holen@xilinx.com (Victor A. Holen ) writes:
>In article <> I write:
>>Is it possible to have a macro that declares local variables
>                      I ment LOCAL TO MACRO (SCOPE WITHIN MACRO ONLY)

Some of the examples given show using the do construct to perform this.  It 
is my understanding that you can apply {} anywhere any time.  The {} 
will introduce a new level of scope.  Within this you can define new
vars etc.  I do this often in an attempt to conserve not globally
need stack space.

For example:

#define myMacro \
   { \
      int i; \
      // other meaningful things to do with i  \
   }

The other comments made are correct.  A macro cannot "return" a value.
And aliasing is a problem.  Local varaible will be obscured by the use
of the more local variables with in the macro.  This is real and have had
bugs caused by this.

I hope this helps.
...Duane
Remeber; my oipinions are my opinions.
From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe)
Newsgroups: comp.lang.c
Subject: Re: Initialisation code in ANSI C.
Date: 14 Apr 92 03:56:37 GMT
Organization: Comp Sci, RMIT, Melbourne, Australia

In article <1992Apr14.134259.7409@waikato.ac.nz>, bwc@waikato.ac.nz (Ug!) writes:
> A quick question to some kindhearted soul out there, if I may...
> 
> Is it possible to have automatic start-up code for a module in C?  Termination
> code I can do by using atexit(), but what about where I have a module which
> needs to set up before anything else is done?

I don't know of any way to do this in ANSI C.  You _can_ do it in C++.
Using a tool like 'MAKE' and an appropriate coding convention, you can
do it in C within your own projects.

For each module that needs startup code, write a function

	void INIT_<module name>()
	    {
		....
	    }

and put it in the appropriate file.  Now you want to write a little
tool that extracts these function names, and for each function name
generates a line that looks like
	{ extern void INIT_<module name>(); INIT_<module name>(); }
Here's a sed script to do it (sed is a UNIX command; you might have
to write a C program for other systems):
	/^void INIT_/!d
	s/^void //
	s/^.*$/{ extern void &; &; }/

Your Makefile will have a definition
	SOURCES=foo.c bar.c ...
saying which are the source files.  You include a definition

	init.ic: $(SOURCES)
		sed -e init.sed $(SOURCES) >init.ic

Suppose the file that contains main() is called main.c.  Then you tell
MAKE that main.o needs an up to date init.ic:
	main.o: init.ic

And your main() function looks like

	int main(int argc, char **argv)
	    {
		/* some initialisation goes here */
	#include "init.ic"
		/* now everything is initialised */
	    }

I've even seen programs that do this by reading their object file to
find the functions to call!  (Very system-dependent, that is.)

It's probably simpler to switch to C++.
-- 
I am writing a book on debugging aimed at 1st & 2nd year CS students using
C/Modula/Pascal-like languages.  Please send suggestions (other than "you
_must_ cite "C Traps and Pitfalls") to ok@goanna.cs.rmit.oz.au
Newsgroups: comp.lang.c
From: kiran@touch.mit.edu (Kiran Dandekar)
Subject: Do you know of "switch" for "strings" ?
Organization: Massachusetts Institute of Technology
Distribution: comp.lang.c
Date: Fri, 10 Apr 1992 01:59:54 GMT


I am looking for macros/functions/tips that will enable me to use a
"switch" construct for strings. This is the kind of stuff I want to
do:

	switch ( TEST_STRING )
	{
	   case "foo" : call fun1();
		        break;

		.
		.
		.

	    default:  call fun_default();

 	}

	Any suggestions?

	Thanks in advance,
From: dhl@mrdog.msl.com (Donald H. Locker)
Newsgroups: comp.lang.c
Subject: Re: impossible in C ? -macro
Keywords: macro declaration return
Date: 14 Apr 92 02:43:59 GMT
Article-I.D.: mrdog.1992Apr14.024359.273
Organization: Chelsea MSL, Inc., Chelsea, MI

In article <1992Apr7.163859.11481@xilinx.com> holen@xilinx.com (Victor A. Holen ) writes:
>In article <> I write:
>>Is it possible to have a macro that declares local variables
>                      I ment LOCAL TO MACRO (SCOPE WITHIN MACRO ONLY)
>>and returns a value. Basically, so it can be called/used as
>>a function.
>>Something like
>># define macfunc(v) \
>>     int a  \
>>     /*use a to compute some function of v (e.g.  a=v; ) */ \
>>     /* return a */
>>I tried some combinations of (,,){} but not the right ones...
>>Supposedly one can do anyting in C, but of course I'd be interested only
>>if its legal ANSI C, which may be harder to determine than to find solution...
>
>
>
>-- 
> victor ....  ___  ._..  .  _.     holen@xilinx.com

I have used:

#define macfunc(v) \
    do { \
        int *a; \
        a = v; \
       /* do other things, using the local pointer */ \
    } while (1 == 0)

to use a local variable (f'r instance when I didn't want a pointer
dereferenced more than once); I have never tried nor desired to RETURN
a value from such a construct, though.  It's really only useful for
its side effects, or lack thereof.
-- 

Donald.
``Good. Fast. Cheap.  Pick any two.'' Erwin Frand, IR&D Editorial, Late '70s
#include <disclaimers.h>   //  Though I and my employer are indistinguishable
From: jc@cs.kun.nl (Jan Christiaan van Winkel)
Newsgroups: comp.lang.c
Subject: Re: Do you know of "switch" for "strings" ?
Date: 11 Apr 92 14:33:39 GMT
Distribution: comp.lang.c
Organization: University of Nijmegen, The Netherlands

In <9358@baird.cs.strath.ac.uk> gor@cs.strath.ac.uk (Gordon Russell) writes:


> Yes I do know of a switch system for strings.....
>  string_switch("yes way")
>  { 
>    string_case("yes way"):
>    string_case("no way") :
>              printf ("No way\n"); 

>    string_case("hello")  :
>              printf ("Hello\n");
>              printf ("Goodbye!\n");
>              break;

>    string_default:    printf ("Default\n");
>  } end_switch_string;
>/*     This collection of macros allows the user to set up string based       */

>#define string_switch(str) {char *sQpZtP;int sQpZtQ;sQpZtP=str;for(sQpZtQ=0;sQpZtQ!=1;sQpZtQ=1) {if (0) 
>#define string_case(str)   sQpZtQ=1;} if ((sQpZtQ==1)||(strcmp(sQpZtP,str)==0)) {0?0
>#define string_default     ;}if(sQpZtQ==0) {0?0
>#define end_switch_string  }}
>---------------------------- End of Macro File --------------------------------


That is just too bad! you should have made a program using the
technique, and then send it in as your entry for the Most Obfuscated C
Code Contest. I bet it had good chances, it's a jewel ;-)
JC
-- 
___  __  ____________________________________________________________________
   |/  \   Jan Christiaan van Winkel                     jc@phoibos.cs.kun.nl
   |       Alternative e-mail addresses: jc@oreo.atcmp.nl and jc@atcmp.nl
__/ \__/ ____________________________________________________________________
From: bhoughto@hopi.intel.com (Blair P. Houghton)
Newsgroups: comp.lang.c
Subject: Re: maximum malloc() allocation size?
Date: 13 Apr 92 18:33:51 GMT
Organization: Intel Corp, Chandler, AZ

In article <4788@umriscc.isc.umr.edu> jamesh@cs.umr.edu (James Hartley) writes:
>ANSI states this *if* they do, but is there a maximum size in which
>malloc(), calloc(), etc. can allocate?  Inquiring minds want to know...

It's limited by the standard only by the range of their
parameters (0 to maximum size_t) but the error-detecting
mechanism (`?alloc()' returns NULL) is provided to ensure
that your system can implement lesser limits (like if there
just ain't that much memory, man).

				--Blair
				  "Enhancement request:  `$alloc()':
				   returns the specified number of
				   dollars..."