Solved

conio.h for unix?

Posted on 1997-08-10
4
863 Views
Last Modified: 2013-12-26
I was wondering, is there a library similar to the dos conio.h for unix?  I find myself needing some functions such as gotoxy, etc.
0
Comment
Question by:Kased
4 Comments
 
LVL 5

Expert Comment

by:julio011597
ID: 1294223
You should look at functionalities provided by Curses:

curses.h (look in /usr/include)

Also 'man courses' should help.

Rgds, julio
0
 

Author Comment

by:Kased
ID: 1294224
there is no man entry for "courses" or "curses"
0
 
LVL 4

Accepted Solution

by:
jos010697 earned 20 total points
ID: 1294225
Curses typically runs on top of 'termcap'. Have a look at that
instead; but IMHO there was no good reason to reject Julio's
answer, because curses is the way to go (if you want portability
and ease of use) ...

kind regards,

Jos aka jos@and.nl
0
 

Expert Comment

by:navi_ivan
ID: 1294226
MAY BE YOU CAN USE THIS... (mnemonics)

void gotoxy(int int_Col, int int_Ren)
  {
   int int_e = 0,
        int_i = 0,
        int_ee = 0,
        int_ii = 0;
   /*  LIKE itoa() */
   char str_b[4]="\0";
   char str_c[4]="\0";
   char str_Escape[] = "\033[";
   int_e = int_Col /100;
    int_Col = int_Col % 100;
 
   if(int_e != 0){
                    str_c[int_i++] = int_e +48;
                     }

   int_e = int_Col /10; int_Col = int_Col % 10;

   if(int_e != 0){
                      str_c[int_i++] = int_e +48;
                      }

   str_c[int_i] = int_Col + 48;
   int_i = 0;

   int_ee = int_Ren /100;
   int_Ren = int_Ren % 100;

   if(int_ee != 0){
                       str_b[int_ii++] = int_ee + 48;
                        }

   int_ee = int_Ren /10; int_Ren = int_Ren % 10;

   if (int_ee != 0){
                         str_b[int_ii++] = int_ee + 48;
                         }
   str_b[int_ii] = int_Ren + 48;
   int_ii = 0;
 
   strcat(str_Escape,str_b);
   strcat(str_Escape,";");
   strcat(str_Escape,str_c);
   strcat(str_Escape,"f");
   printf(str_Escape); /* "\033<col>;<row>r" */
   
   } /* end funcion gotoxy() */

/* CLEAR SCREEN */  
void clrscr() { printf("\033[2J"); }
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Host to IP 7 73
Detect CR LF to each line 12 137
bigDiff challenge 17 75
centeredAverage challenge 8 124
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now