OpenCOBOL 1.1pre-rel
Functions
termio.h File Reference
#include <libcob/common.h>
Include dependency graph for termio.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void cob_display (const int, const int, const int,...)
void cob_accept (cob_field *)

Function Documentation

void cob_accept ( cob_field )

Definition at line 234 of file termio.c.

{
/* RXW
        size_t          size;
*/
        cob_field_attr  attr;
        cob_field       temp;

        if (cob_screen_initialized) {
                cob_field_accept (f, NULL, NULL, NULL, NULL, NULL, 0);
                return;
        }
        temp.data = term_buff;
        temp.attr = &attr;
        COB_ATTR_INIT (COB_TYPE_ALPHANUMERIC, 0, 0, 0, NULL);
        /* read a line */
        if (fgets ((char *)term_buff, COB_MEDIUM_BUFF, stdin) == NULL) {
                temp.size = 1;
                term_buff[0] = ' ';
                term_buff[1] = 0;
        } else {
                temp.size = strlen ((char *)term_buff) - 1;
        }
        if (COB_FIELD_TYPE(f) == COB_TYPE_NUMERIC_DISPLAY) {
                if (temp.size > f->size) {
                        temp.size = f->size;
                }
        }
        cob_move (&temp, f);
/* RXW
        if (isatty (fileno (stdin))) {
                temp.size = strlen ((char *)term_buff) - 1;
                cob_move (&temp, f);
        } else {
                size = strlen ((char *)term_buff) - 1;
                if (size > f->size) {
                        size = f->size;
                }
                memcpy (f->data, term_buff, size);
                memset (f->data + size, ' ', f->size - size);
        }
*/
}

Here is the call graph for this function:

Here is the caller graph for this function:

void cob_display ( const int  ,
const int  ,
const int  ,
  ... 
)

Definition at line 205 of file termio.c.

{
        FILE            *fp;
        cob_field       *f;
        int             i;
        va_list         args;

        if (!outorerr && !cob_screen_initialized) {
                fp = stdout;
        } else {
                fp = stderr;
        }
        va_start (args, varcnt);
        for (i = 0; i < varcnt; ++i) {
                f = va_arg (args, cob_field *);
                display (f, fp);
        }
        va_end (args);
        if (newline) {
                putc ('\n', fp);
                fflush (fp);
        }
}

Here is the call graph for this function:

Here is the caller graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines