Re: [offtopic] Emacs vs vi
Hi Joel, It's hard to believe that I really got you, but I wonder what an OCR program would do with brail. Although my vision is almost 20/20, my PC reads to me with a program named "Openbook Unbound" and the Keynote Gold speech synthasizer. The progam does superbly when it sees san serrifed type, but it can't cope with anything handwritten. Before anyone complains, Glynn perhaps, that I'm going off our usual topic, I better relate this letter to Linux and C programming. Darn! I'm stumped. Sorry folks. Best wishes, Bill
Re: network programming
UNIX Network Programming: Networking APIs Richard Stevens I think cover price is $58.75 :) and it's worth every cent. On Mon, Jun 22, 1998 at 08:07:17PM -0400, shinobi wrote: can someone please point me to some good TCP/IP programming resources. some reference material, and a tutorial would be ideal. but anything you can recommend would be greatly appreciated. -- Edward Roper [EMAIL PROTECTED] 503.903.3729 WANfearhttp://www.WANfear.com/
Re: network programming
Hello all, At 08:07 PM 6/22/98 -0400, you wrote: some reference material, and a tutorial would be ideal. but anything you can recommend would be greatly appreciated. I have passed throught this page on the web http://www.ecst.csuchico.edu/~beej/guide/net and I think it may be useful as a startup guide. Regards, ~ibra
No Subject
To: linux-c-programmer @itis-com From: Aravinda Guzzar H.P 751/A, 15th 'B' Main Road, Gokula 1st stage,Mathikere, Bangalore-54 email - [EMAIL PROTECTED] sir, sub:clearing of few doubts I am final year CSE student studying in M.S.Ramaiah Institute of Tech. Bangalore.While doing C-programming in LINUX i encountered following difficulties. I am very happy that you replied back to my previous questions very soon and I expect the same from you this time. *** 1 I have used the "dialog" utility in linux , it worked fine. But I am not able to get the return value and use it in my program. The Manual says it prints the value on stderr. But I am not able to capture it. The program is as follows... #includestdio.h main() { char ch; /* Menu ***/ system("dialog --title \"Box\" --menu \"Select Options\" 20 40 5 \"1\" \"Ftp\" \"2\" \"Exit\""); /* Read Choice From stderr **/ read(2,ch,1); /** Print Choice */ printf("\nCh = %d\n",ch); } I want the return value that I have selected 2 The Dialog Utility Clears The Background and while it exits it does not Restore The Screen. So I thought to use "scr_dump()" and "scr_restore()" functions in the following way.. #includestdio.h #includencurses/ncurses.h main() { initscr(); fprintf(stderr,"\nTo demonstrate screen saving Restore"); fprintf(stderr,"\nStrike any key .. Screen is saved"); getch(); scr_dump("screen.scr"); clear(); printw("\n Press any key to Restore the screen"); refresh(); getch(); scr_restore("screen.scr"); getch(); endwin(); } But I got the error... /usr/include/ncurses/ncurses.h 19:unctrl.h No such file or directory while Compiling. ** 3 How do I set the cursors. I tried the following program #includestdio.h #includencurses/ncurses.h main() { initscr(); slk_init(); fprintf(stderr,"\nInvisible"); curs_set(0); getch(); fprintf(stderr,"\nvisible"); cur_set(1); getch(); } But I got the error... /usr/include/ncurses/ncurses.h 19:unctrl.h No such file or directory while Compiling. Expecting the reply as early as possible at my address [EMAIL PROTECTED] yours faithfully Aravinda Guzzar H.P
No Subject
grafit wrote: 1 I have used the "dialog" utility in linux , it worked fine. But I am not able to get the return value and use it in my program. The Manual says it prints the value on stderr. But I am not able to capture it. The program is as follows... #includestdio.h main() { char ch; /* Menu ***/ system("dialog --title \"Box\" --menu \"Select Options\" 20 40 5 \"1\" \"Ftp\" \"2\" \"Exit\""); /* Read Choice From stderr **/ read(2,ch,1); /** Print Choice */ printf("\nCh = %d\n",ch); } I want the return value that I have selected You can't read from the stderr stream which the `dialog' command uses; it is your process' stderr stream. You could add e.g. ` 2dialog.out' to the end of the string which is passed to system. This would write the result to the file `dialog.out', which you could then read. If you want to get the stderr output of a command, you would need to implement something similar to popen(), but which reads from stderr instead of stdout. 2 The Dialog Utility Clears The Background and while it exits it does not Restore The Screen. So I thought to use "scr_dump()" and "scr_restore()" functions in the following way.. #includestdio.h #includencurses/ncurses.h [snipped] But I got the error... /usr/include/ncurses/ncurses.h 19:unctrl.h No such file or directory while Compiling. Is unctrl.h in the /usr/include/ncurses directory? It should be in /usr/include, along with ncurses.h. 3 How do I set the cursors. I tried the following program [snipped] But I got the error... /usr/include/ncurses/ncurses.h 19:unctrl.h No such file or directory while Compiling. This is the same problem as before. -- Glynn Clements [EMAIL PROTECTED]
Weird keyboard i/o
ok, compile this code, then explain why it does what it does... /* Start Of Code */ #include stdio.h char c; int main () { printf ("Scanf Test\n"); printf ("enter a character "); scanf ("%c", c); printf ("Char was [%c]\n", c); printf ("Getc test\n"); printf ("Enter a character "); c = getc (stdin); printf ("Char was [%c]\n", c); return 0; } /* End of Code */ What does it do? It will let me input the first char, but never asks for the second. Why? and how can i make it ask for the second (or however many i ask it for). incidentally, i've seen EXACTLY the same 'feature' in Assembly, Pascal and Modula 2! -[[EMAIL PROTECTED]]- Http://x-map.home.ml.org Mailto : [EMAIL PROTECTED] ---[Quote Of The Day]-- Old programmers never die. They just branch to a new address. ---
Re: svga/vga
On Mon, 22 Jun 1998, Mike 'b0mbtraq' Kabata wrote: -On Sat, 20 Jun 1998, Glynn Clements wrote: - - Have you got any ideas why i can't get any - non-standard mode (640x480x256 even) ? - - The usual reason is that it doesn't include drivers for your - particular graphics chipset. - -Hmm... ok, but why i can put my X server to 1024x768x256, and I can't push -C to do this ? I tried to use driver for my chipset but it's "pre-alpha -version", so you understand it gives just seg. fault. because X uses totally different drivers to Svgalib. -[[EMAIL PROTECTED]]- Http://x-map.home.ml.org Mailto : [EMAIL PROTECTED] ---[Quote Of The Day]-- Old programmers never die. They just branch to a new address. ---
Re: [offtopic] Emacs vs vi
On Mon, 22 Jun 1998, John Gorman wrote: -I can open up an emacs window, write/modify my program, compile it, have -the cursor pointed to each error that may appear, bring up a man page if I -need to, and then test my program and never leave emacs. ever heard of Virtual Terminals? on a good day i can use up all 6 of them! plus, with gpm you can cut and copy text between them. True it doesn't display errors, but that's why the c compiler tells you the line number... Anyhow, you should use whatever editor you feel most comfortable with. Just NO Visual Programming Environments! -[[EMAIL PROTECTED]]- Http://x-map.home.ml.org Mailto : [EMAIL PROTECTED] ---[Quote Of The Day]-- Old programmers never die. They just branch to a new address. ---
RE: ptrs to functions and void*
There's really not much to either topic. The one hard part about pointers to functions is to remember to put parentesis around the * and the function name. void (*funcpoint)(); void func() { printf("Hello\n"); } funcpoint = func; /* Notice no parenthesis! */ (*funcpoint)(); /* "Hello\n" is displayed */ Function pointers must point to static functions. Any function which is standalone (not part of a class; freely defined with global scope) is static. (Others on the list verify this, please.) Member functions (C++) are only static if you give the static keyword. You cannot mix static with the virtual keyword. (Grrr...) void pointers (vastly different than the case of above. Above was a pointer to a function with void parameters and void return type. A void pointer can point to *anything*, but you must type cast it if it is on the right side of an equals sign. void *pointertoanything; char mychar; int myint; char *mycharptr; int *myintptr; pointertoanything = mychar; mycharptr = (char*)pointertoanything; pointertoanything = myint; myintptr = (int*)pointertoanything; I'm sorry if I confused you more than I helped. :-( I don't think I've ever found a book which gave more than 1/2 - 1 page of info on either of these topics. Not that they're easy, just that there's not much to them. ~Patrick -- From: [EMAIL PROTECTED] Hey all..is there a definitive book to learn how to use pointers to functions and void* variable types? I'd also like to tie it into reusability and OOP if at all possible (no I can't use C++ or any standard OO language) Thanks, Chris
Re: [offtopic] Emacs vs vi
On Sun, 21 Jun 1998, Kevin Sivits wrote: - - -Vi and emacs both suck. Text editors are for losers. The only real -editor is a line editor. Worship ed or its bastard cousin edlin. do you by any chance write your code in binary :) cool signature by the way... -[[EMAIL PROTECTED]]- Http://x-map.home.ml.org Mailto : [EMAIL PROTECTED] ---[Quote Of The Day]-- Old programmers never die. They just branch to a new address. ---
Re: [offtopic] Emacs vs vi
What is wrong with Ctrl-k x? On Sun, 21 Jun 1998, James wrote: On Sun, 21 Jun 1998, Moshe Zadka wrote: -Well, with vi's command mode saves one from the pianist syndrom. -(E.g. alt-shift-5). Of course, that way, your fingers will not -elongate. If you want to play the piano, EMACS is a great -excercise. (Escape-Meta-Alt-Control-Shift isn't just an -acronym). how about Control-3 Shift-z-z to save and quit or Esc Shift-z-z, Esc : wq, Esc :wq!.. Why's vi got SO many different ways! and more importantly, why did i have to learn the longest ones! (incidentally, this mail is written in PINE, using vim as the text editor.. i'm about to press Esc then ZZ...) -[[EMAIL PROTECTED]]- Http://x-map.home.ml.org Mailto : [EMAIL PROTECTED] ---[Quote Of The Day]-- Old programmers never die. They just branch to a new address. --- Best wishes - Karl F. Larsen, 3310 East Street, Las Cruces,NM (505) 524-3303 -
Re: Weird keyboard i/o
Hi James, I don't know what's going wrong, but it did what you said it would do. I ran it on a SparcServer 20. For fun, I wrote this program: #include stdio.h int main () { int c; puts ("Type a character."); c = getchar (stdin); putchar (c); } When I ran a.out, it displayed "c", the character I typed, and then it put the cursor about five columns to the right of the host name. So I backspaced, only to hear a beep. But the cursor would move again after I hit the "enter" key. In your program, "c = getc (stdin)" kept getting a "[". I'm stumped. Bill
Programming X window
Dear Listmembers, Is there a C++ programming framework for X window? I mean something analogus to MFC/OWL in MS windows. Is there an online resource where I can learn about the X window API? Many thanks in advance.