HDTenEightyP/NetNews huggingface dataset:
From: vary@fraser.sfu.ca (Jason Vary)
Subject: HELP: Mouse cursor redefinition
Followup-To: Poster (vary@sfu.ca)
Organization: Simon Fraser University, Burnaby, B.C., Canada
Date: Wed, 29 Jul 1992 23:34:56 GMT

Hello all,
     I have a question for those who have worked in C language
programming mouse applications for MS-DOS machines.
     I'm using Microsoft C 6.0 and Programmer's WorkBench 1.10.
     I would like to change the graphical mouse cursor (pointer)
to the shape of a hand, but it just doesn't seem to work.  The
following code (set_mouse_cursor_hand()) was taken almost
exclusively from "Microsoft Mouse Programmer's Reference" 2nd
edition, p. 143.
     In the procedure I use the global structures iReg, oReg, and
sReg which have been declared using <dos.h> as follows:
          union REGS iReg, oReg;
          struct SREGS sReg;
     Immediately before calling this procedure I reset the mouse
driver, and immediately after calling this procedure I display
the mouse cursor.
     The procedure compiles without error or warning (Warning
level 4).  When it executes, the mouse cursor is a 16*16 pixel
arrangement of garbage, not even resembling a hand.
     I have messed around with a number of things, but nothing
changes.

     Here's the code:
------------------------------------------------------------
void set_mouse_cursor_hand(void)
{
  static int maskshand[] =
  {

  /* screen mask */
  0xE1FF,
  0xE1FF,
  0xE1FF,
  0xE1FF,
  0xE1FF,
  0xE000,
  0xE000,
  0xE000,
  0x0000,
  0x0000,
  0x0000,
  0x0000,
  0x0000,
  0x0000,
  0x0000,
  0x0000,

  /* cursor mask */
  0x1E00,
  0x1200,
  0x1200,
  0x1200,
  0x1200,
  0x13FF,
  0x1249,
  0x1249,
  0xF249,
  0x9001,
  0x9001,
  0x9001,
  0x8001,
  0x8001,
  0x8001,
  0xFFFF
  };

  iReg.x.ax = 9;	    /* Set Graphics Cursor Block */
  iReg.x.bx = 5;	    /* Set horizontal hot spot */
  iReg.x.cx = 0;	    /* Set vertical hot spot */
  sReg.es = FP_SEG(maskshand);
  iReg.x.dx = FP_SEG(maskshand);
  int86x(0x33, &iReg, &oReg, &sReg);
}
------------------------------------------------------------

Any help would be greatly appreciated!!
seeya
jason
--
vary@sfu.ca
From: alpha@wyvern.twuug.com
Newsgroups: comp.lang.c
Date: 18 Jul 92 00:24 MDT
Subject: About the 'F' in RTFM
Nf-ID: #N:1992Jul17.202448.19848@wyvern.tw:-789306601:001:199
Nf-From: wyvern.twuug.com!alpha    Jul 18 00:24:00 1992


Proposed change to 'standard' practice.  'RTFM' is now 'RTM'.
The 'F' does not relate to any known adjective for Manual.
'Read The Manual' should suffice.

-- 
Joe Wright  alpha@wyvern.twuug.com
From: wirzeniu@klaava.Helsinki.FI (Lars Wirzenius)
Newsgroups: comp.lang.c
Subject: Re: array element swap help
Date: 30 Jul 92 20:30:49 GMT
Organization: University of Helsinki

amorgan@Xenon.Stanford.EDU (Crunchy Frog) writes:
>Oh, there is no real way to speed [swapping] up [...]

The best way to speed it up is to eliminate it altogether.  The problem
arose for a sorting application, so perhaps there is a better sorting
algorithm that could be used (use Quicksort instead of Bubble sort).

On the other hand, if the array elements are large (some kinds of
structures, say), you can probably speed things up by using an array of
pointers to said structures instead.  The purpose is to make the array
elements smaller and thereby reducing the amount of data that has to be
moved.

--
Lars.Wirzenius@helsinki.fi
From: sl8nl@cc.usu.edu
Newsgroups: comp.lang.c
Subject: Re: programming graphics mouse ?
Date: 24 Jul 92 11:37:24 MDT
Organization: Utah State University

In article <1992Jul24.133735.24837@uxa.ecn.bgu.edu>, csblm@uxa.ecn.bgu.edu (Brian Murphy) writes:
> I had originally asked this question of comp.graphics (excuse the
> redundancy).  I am attempting to program my microsift compatible mouse
> in graphics mode (VGA 640x480).  I have initialized the mouse but am
> having trouble in generating a descent looking (something besides a
> multi-colored block) graphics cursor.  The inadequate documentation I
> have mentions a 16 x 16 bit array to be used for the screen and cursor
> images and these are ANDed and ORed with the screen to create the cursor
> image ?  I need help in preparing this graphics cursor.  If anyone has
> information just how to do this or a good source of information.
> Please let me know.
> 

You could make your own mouse cursor...for instance, we use a routine called
Keys that constantly polls the keyboard for input.  We added mouse support to
this that sensed if the mouse moved, the old background would be restored,
the new background would be saved, and the mouse image put down.  This way,
it can be an actual graphics image.

Josh
From: brendan.woithe@f820.n680.z3.fido.zeta.org.au (Brendan Woithe)
Newsgroups: comp.lang.c
Subject: Window librarys
Date: 11 Jul 92 20:35:04 GMT
Organization: Fidonet. Gate admin is fido@socs.uts.edu.au

Howdy. . .

Does anyone know of any shareware windowing librarys with mouse support
(both graphics or text) that I can integrate into my C programming? I would
love to here from U I you know of one. If no-one does, I'l have to write
my own!!!

Jhagon

Brendan


... What is the difference between C++ & cobal : Cobal is 2 sums behind!
--- Blue Wave/RA v2.10 [NR]
 * Origin: Coffee Au Go-Go. We don't know what it means either.
(3:680/820.0)
From: gurgle@netcom.com (Pete Gontier)
Newsgroups: comp.lang.c
Subject: Re: Variable length records
Date: 25 Jul 92 04:10:40 GMT
Organization: cellular

adam@castle.ed.ac.uk (Adam Hamilton) writes:

>	During my last spell at teaching C, I was asked what support C
>could give for variable length records.  (Not variant records which I can
>do with a union).  I was unable to answer the question, so promised to
>seek help (this means you).

Funny you ask; I just did some cursory research on this very topic. I had
written some Mac code using declarations thus:

typedef struct
{
	short   count;
   float   data[ ];
}
foo;

I refer to the second member as an "open array." Its behavior is this:
	o  it may appear only as the last member of a structure
	o  it does not contribute to the value returned by sizeof(foo)
   o  it may be addressed, of course, with an arbitrary index

I got worried about its portability so I paged through some manuals.
Both major C compilers for the Mac support it. Turbo C and Microsoft
C for the PC support it. According to Harbison and Steele, ANSI does
*not* support it. And from experience I know that AT&T cfront 2.1 (the
most common "standard" for C++) does not support it. I'm a little bit
suprised that it's not in the ANSI standard, but after my research I
felt it was common enough that I'd use it with impunity. And now I've
just checked with 'gcc' 1.39, and it doesn't like it. Perhaps 2.x does.

>P.S.  I already know that Unix will have a problem with variable length
>records since it doesn't know about records.  Nevertheless, if anyone knows
>of an attempt to solve this I will be grateful to hear about it.

Not knowing about records simply means you have to implement it yourself.
There are no problems, as long as your compiler cooperates, with UNIX.
-- 
 Pete Gontier // EC Technology // gurgle@netcom.com
Xref: sparky comp.lang.c:11564 comp.lang.c++:11479
From: dforan@pilot.njin.net (David Foran)
Newsgroups: comp.lang.c,comp.lang.c++
Subject: C/C++ tutor wanted...
Keywords: C,C++,tutor
Date: 24 Jul 92 16:17:12 GMT
Followup-To: comp.lang.c
Distribution: usa
Organization: Rutgers Univ., New Brunswick, N.J.


 Hello:

 I am interested in obtaining an on-line C and C++ tutor. Does anyone
 know where I might obtain a copy????

 Please respond to djf@mirage.umdnj.edu
 Thanks in advance.

		david
From: millera@infopls.chi.il.us (Alan Miller)
Newsgroups: comp.lang.c
Subject: disabling echoing...
Date: Wed, 29 Jul 92 14:34:00 CDT
Organization: INFOPLUS support, Wheeling, IL

I was wondering if there was a good, portable or usually portable way to
disable character echoing while getting input.  I've been poring over
H&S for the last day, wondering if it was mentioned someplace
unexpected.  I'm sure I've seen this before, but I can't remember
where....
Replies in Email, please, if others are interested mail me and I'll send
a summary of any replies to you.

Thanks,
ajm
millera@infopls.chi.il.us
From: Joe.Thibault@f408.n107.z1.ieee.org (Joe Thibault)
Newsgroups: comp.lang.c
Subject: Re: prompts
Date: 26 Jul 92 17:18:00 GMT
Organization: FidoNet node 1:107/408 - Starcom Syste, Eatontown NJ

RO>From: ross@zooid.guild.org (Ross Ridge)
RO>Date: 19 Jul 92 19:32:35 GMT
RO>Organization: ZOOiD BBS
RO>Message-ID: <1992Jul19.193235.20528@zooid.guild.org>
RO>Newsgroups: comp.lang.c

RO>sprice@eng.auburn.edu (Shannon W. Price) writes:
RO>>In a program that I've been working on, I'd like to be able to prompt a
RO>>user like this :
RO>>
RO>>       Press <ENTER> to continue
RO>>
RO>>First I thought that I could just do a scanf ("%c",&prompt) and that
RO>>would take care of it.
        How about the generic "gotoxy(24,25);
                               Cprintf("Press <ENTER> to continue"); (or
                               declare that string as a constant...)


RO>Try:

RO>        scanf("%*[^\n]");
RO>        getchar();

RO>>  How does one go about accepting menu commands sometimes
RO>>and just a carriage return at other times?

RO>In general scanf is a very poor function to use to read user input.
RO>It is the compliment of printf in only that it can be handy to use
RO>to read printf output.

RO>                                                        Ross Ridge

RO>--
RO>Ross Ridge - The Great HTMU                                          l/  //
RO>                                                                   
[OO][oo]
RO>ross@zooid.guild.org                                               
/()\/()/
RO>uunet.ca!zooid!ross                                                  db  //

RO>--- AMB v6.33
RO> * Origin: zeus.ieee.org (1:107/10)
     I assume you're using a switch statement to select menu choices...
     Use "Cgetch" (#include <conio.h>) to read the keyboard, and add the
     following case statement:
                        case 0x1c0d :      /* Return key pressed*/
                                DesiredFunction();
                                return;

                        Hope it helps...                Joe T.

 ~ SLMR 2.1a ~ Windows:  A colorful clown suit for DOS.



--  
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
 Joe Thibault - Internet: Joe.Thibault@f408.n107.z1.ieee.org
From: mikef@dcs.ed.ac.uk (Mike Fourman)
Newsgroups: comp.lang.c
Subject: Re: Elementary C Texts
Keywords: Books
Date: 30 Jul 92 09:31:40 GMT
Organization: Department of Computer Science, University of Edinburgh

Does anyone out there have experience of using (or reasons for not using)

"C how to program" 
Deitel and Deitel
Prentice Hall?

-- 
Prof. Michael P. Fourman                     email        mikef@dcs.ed.ac.uk
Dept. of Computer Science                    'PHONE (+44) (0)31-650 5198 (sec)
JCMB, King's Buildings, Mayfield Road,              (+44) (0)31-650 5197
Edinburgh EH9 3JZ, Scotland, UK                 FAX (+44) (0)31 667 7209
-------------------------------------------------------------------------------
Newsgroups: comp.lang.c
From: markh@csd4.csd.uwm.edu (Mark William Hopkins)
Subject: Re: How to do I/O on PC com port
Organization: Computing Services Division, University of Wisconsin - Milwaukee
Date: Mon, 27 Jul 1992 00:44:37 GMT

In article <92196.150953REASON@MAINE.MAINE.EDU> <REASON@MAINE.MAINE.EDU> writes:
>
>Does someone know of an easy way to access a com port (e.g., COM1) for both
>reading and writing in Turbo C (or C++)?  We would like input and output to
>be independent from each other (conceptually separate streams like stdin and
>stdout are).  We don't want to miss characters received while the program is
>off doing something else.  We think we have tried most of the obvious
>approaches.  Have we missed something?  Is there an easy approach using
>stdaux, fprintf, and fscanf or will we have to use bioscom and interrupts?

In the ftp site csd4.csd.uwm.edu under /pub/8051/client.

They are intended to be used with the 8051-related software located in the 8051
directory (and to a small degree: to be used with certain RS-422/RS-485
boards), but can easily be adapted to more general uses.

(IBM com ports are RS-232).

I've used the routines for 8051/PC links on RS-232, RS-422, RS-485 at rates up
to 57600 baud and data sizes up to 9 bits without any timing errors.
Newsgroups: comp.lang.c
From: newton@mercury.ncat.edu (Cynthia D. Newton)
Subject: gethostnamae(), novice question...
Organization: North Carolina A&T State University
Date: Sat, 25 Jul 1992 07:07:09 GMT


#include <stdio.h>

main()	{
	char *host[64];
	gethostname(host, sizeof host);
	printf("%s\n",host);
}

Hi:

This program gets the hostname as 'mercury.ncat.edu'. What's the decent
way/s to strip off the .ncat.edu part? I know how to do that by sed. The
solution should be general, I mean should be applicable to any hostname with
domain name in it.

Thanks.

--
C Newton
From: jfw@ksr.com (John F. Woods)
Newsgroups: comp.lang.c
Subject: Re: srand() rand() question
Date: 31 Jul 92 12:23:42 EDT
Distribution: usa

cheselka@cactus.org (Michael R. M. Cheselka) writes:
>  /* What is wrong with this program?  Is it the multiple calls to srand()?
>     rand() is not random at all, and soon duplicates it's self in a repeating
>     pattern.  Is it illegal to repeatedly call srand()? */

It is not illegal to repeatedly call srand(), but it also isn't advisable.
Not all seeds are as good as other seeds, so you're rather likely to fall
into one of the short-sequence traps the standard rand() function offers.

If you want better random numbers, use the Berkeley random number generator
(source available by ftp, or just grab a copy of Knuth and implement the
random number generator that has a table of 55 numbers and adds elements
separated by some spacing (I forget which algorithm number that is, since
my copy of Knuth isn't handy).
From: bsullivn@nixeidsc.sni.ie (Bryan O'Sullivan)
Newsgroups: comp.lang.c
Subject: Re: While problem
Date: 27 Jul 92 09:45:11 GMT
Reply-To: bryan@sc.sni.ie
Organization: Siemens-Nixdorf Software Development Centre, Dublin
X-Newsreader: Tin 1.1 PL3



GNR100@psuvm.psu.edu writes:
: 
:    I'm having trouble with a whil loop in function I am writing to
: read a line from a fileby puttingeach character into an array, accesed by
: pionters, until the '\n' character is reached of EOF is reached.
:   Trouble is, I keep getting an error message that the function needs an
: Lvalue (address) inside the while loop.  Any ideas as to the problem?
: The filename is a global variable, and that's why it isn't declared.

Well, first off, your call to getc will bomb if you ever get the rest of
the program running.  Getc(3) takes a FILE pointer, not a file name, as
argument.  Also, (no flame intended) you're making the classic new C
programmer mistake of trying to do too many "neat" things inside your
while loop, which is part of the reason why it isn't working.

: char readline(char *string[])
: {
:   int i=0;
: 
:   while(((*string+i++=(char)getc(fname))!=EOF)
:       &&((*string+i++=(char)getc(fname))!='\n'));
:   return (*string+(i-1));
: }

char readline(char string[])
{
	int i;

	for (i = 0; (string[i] = getc(fp)) != EOF; i++) {
		if (string[i] == '\n') {
			break;
		}
	}
	return &string[i-1];
}

That is probably what you really want to be doing.  You're making a
number of other errors in your own code; you're not dereferencing string
properly (you have it declared as a vector of strings, not as a single
string) -- this is the cause of your lvalue problem.  If you got this to
work, you would still have other griefs to contend with.  Your
comparisons in the while statement compare consecutive characters with
EOF and EOL, so you could miss an EOF when checking for an EOL with your
present code, and vice versa.  It's not necessary to have those casts
with getc() either; they just make your code unclear.  Furthermore, the
ugly pointer arithmetic you're doing is no longer really necessary;
there was a time when compilers were bad at optimising array arithmetic,
but most such compilers are (thankfully) no longer with us.

Finally, I prefer the use of a for statement for the kind of job you're
trying to do; it's just a stylistic issue, but it makles the code more
clear.  And finally finally, doing the return statement as I have done
is also somewhat more clear, and won't cost anything if you have a
half-decent compiler.

My advice to you: read the sections on pointers in your C manual *very*
carefully again.  Good luck.

	-- Bryan

-- 
Bryan O'Sullivan                                             +353-1-767551 x225
Siemens-Nixdorf Informationssysteme AG                          bryan@sc.sni.ie
Software Development Centre                    "Theory like mist on eyeglasses.
Dublin                                          Obscure facts." -- Charlie Chan
Newsgroups: comp.lang.c,comp.std.c
From: keithf@pacifier.rain.com (Keith Furrow)
Subject: Novice Question on a bad compilier (cc, SysV386)
Organization: Pacifier BBS
Distribution: na
Date: Mon, 27 Jul 1992 20:02:07 GMT


My sincerest aplogies if I posted in the wrong group or didn't look at the
FAQ long enough.  
 
I am running a SysV386 machine using cc. cc has consistently not compiled 
almost all (one or two) of the .c programs a have grabbed from various 
archives, I am beginning to rip my hair out as this is VERY frustrating!!!

Some of the programs I have tried to compile are:
 
crypt
ufc-crypt 
and assorted other progams which have been assured to me by their authours
that they works on THEIR machine and on other SysV386es... Grrrrr...
 
I have access to gcc, but we have a _SLOW_ ftp connection to the site where
it is stored, and I will only get it if it will help... Will it?
 
Af few error messages:

"test.c", line 22: warning: identifier redeclared: open
"test.c", line 41: undefined symbol: user
"test.c", line 42: warning: left operand of "." must be struct/union object
"test.c", line 42: cannot access member of non-struct/union object
"test.c", line 43: warning: left operand of "." must be struct/union object
"test.c", line 43: cannot access member of non-struct/union object
"test.c", line 45: warning: left operand of "." must be struct/union object
"test.c", line 45: cannot access member of non-struct/union object
"test.c", line 46: warning: left operand of "." must be struct/union object
"test.c", line 46: cannot access member of non-struct/union object
"test.c", line 48: undefined symbol: W_OK
 

Oh well...
 
Please mail any solutions as I don't read this newsgroup much.
 
Thanks in advance,
Keith
-- 
keithf@pacifier.rain.com
Newsgroups: comp.lang.c
From: pegasus@csd4.csd.uwm.edu (David R Hucke)
Subject: re: converting Borland peekb and pokeb to Microsoft
Originator: pegasus@csd4.csd.uwm.edu
Organization: Computing Services Division, University of Wisconsin - Milwaukee
Date: Thu, 30 Jul 1992 02:46:56 GMT

Hope this helps...

I don't know what pokeb and peekb do, but they sound like they put
a value to a memory address and check a memory address...

If this is the case you can do something like this:

char far *MemPtr
#include <stdio.h>

main()
{

	char far *MemPtr;      /* Ptr to a byte in memory */
	char data;

	MemPtr = (char far *) 0xB8000000L;
		/* this points to address in memory you want to work on.
		In the above  B800 is the segment and 0000 is the
		offset */
	data = *MemPtr;
	/*  This line should be equal to peekb(address) where the address
	 was set by the first line.  Your function could then return the
	 value of data. */

	*MemPtr = 112;
	/*  This is equivalent then to pokeb(address,112).
	You could in the pointer to the memory location instead
	of how I did it here.  */
}


This code was written for Microsoft Quick C v 2.5 and should work on any
Microsoft C compiler.  (Note:  turn pointer checks off)

Please let me know if this helps you out...

===
pegasus@csd4.csd.uwm.edu
-- 
pegasus@csd4.csd.uwm.edu                David R. Hucke
                                        UW-Milwaukee Film Major
--
Newsgroups: comp.lang.c
From: r3kls@vax1.cc.uakron.edu (Kevin L Sheller)
Subject: Finding date/time
Organization: The University of Akron, Akron, Ohio
Date: Wed, 22 Jul 1992 15:01:08 GMT

I'm using ANSI C on a UNIX Sun Station. I need to know how to access the
current date and time in my program.
 
 If you've gotta good idea, please e-mail me at: kevins@file02.ecgf.uakron.edu
 
 					Thanks guys!
					Kevmo
From: bsullivn@nixeidsc.sni.ie (Bryan O'Sullivan)
Newsgroups: comp.lang.c
Subject: Re: Finding date/time
Date: 27 Jul 92 10:05:01 GMT
Reply-To: bryan@sc.sni.ie
Organization: Siemens-Nixdorf Software Development Centre, Dublin
X-Newsreader: Tin 1.1 PL3



r3kls@vax1.cc.uakron.edu (Kevin L Sheller) writes:
:I'm using ANSI C on a UNIX Sun Station. I need to know how to access the
:current date and time in my program.

You want time(2) and, for an ASCII representation, ctime(3C).  For
example, this chunk of code prints the current date:

#include <time.h>

main()
{
	printf("Date: %s\n", ctime(time(NULL)));
}

There is a number of other functions defined in the ANSI standard for
manipulating time representations; see section 3C of the manual, or read
an ANSI C book.

	-- Bryan

-- 
Bryan O'Sullivan                                             +353-1-767551 x225
Siemens-Nixdorf Informationssysteme AG                          bryan@sc.sni.ie
Software Development Centre                    "Theory like mist on eyeglasses.
Dublin                                          Obscure facts." -- Charlie Chan
Xref: sparky comp.lang.c:11399 comp.lang.c++:11249
From: christ@cps.msu.edu.cps.msu.edu (Oliver Christ)
Newsgroups: comp.lang.c,comp.lang.c++
Subject: Re: tell me about Borland C 3.1....
Keywords: Borland C++
Date: 21 Jul 92 16:45:30 GMT
Reply-To: christ@cps.msu.edu.cps.msu.edu (Oliver Christ)
Organization: Dept. of Computer Science, Michigan State University
Originator: christ@whale.cps.msu.edu

In article <1992Jul18.003150.17689@usenet.ins.cwru.edu> au141@cleveland.Freenet.Edu (Amber M. Spillers) writes:
[...]
>   and finally: I am a student, and I can get all the proper forms signed (if
>neccasary) as well as having several valid student IDs.  Just how and where do
>I get borlands educational deal???

I called their 800-number and asked them for dealers in my area
that offer Borland products with educational discounts.  There are
two big advantages to getting it locally:
1) Borland requires one of your professors to order coupons from
   Borland which you'd have to send along with your BC++ order.  
   Imagine the turnaround times ...  If you get it from a dealer,
   they usually accept a student ID or certificate of enrollment.
2) You don't pay for shipping.

      - Oliver

P.S.:  I know some people have several credit cards, but several student ID's?

-------------------------------------------------------------------------------
 Oliver Christ                                  Department of Computer Science
 christ@cps.msu.edu                               Michigan State University
-------------------------------------------------------------------------------
From: jbc@hpcuhe.cup.hp.com (Jeff Caldwell)
Date: Thu, 23 Jul 1992 23:49:45 GMT
Subject: Re: How can I return two value to a procedure ???
Organization: Hewlett Packard, Cupertino
Newsgroups: comp.lang.c

Try returning  a pointer to a structure which consists of two 
integers.

		-Jeff Caldwell | HP Calif Lang Lab.