Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ isline(3C) — DG/UX 4.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought



                                                               isline(3C)



        _________________________________________________________________
        isline                                                      macro
        Determine if a character is a line terminator.
        _________________________________________________________________


        Calling Sequence

        #include <ctype.h>

        int c, result;
        result = isline(c);


        Description

        Use the isline macro to determine if a character is a line
        terminator.  Line terminators are New Line, form feed, Carriage
        Return, and vertical tab.

        You might get unexpected results if you try to redeclare this
        macro.


        Returns

        The isline macro returns a nonzero value if the character is a
        line terminator (New Line, Carriage Return, vertical tab, or form
        feed).  Otherwise, it returns 0.


        Related Functions

        See also the isascii macro.


        Example

        /* Program test for the isline() macro */

        #include <ctype.h>
        #include <stdio.h>

        FILE *fp, *fopen();

        int  result;

        main(argc, argv)
        int argc;
        char *argv[];
        {



        DG/UX 4.00                                                 Page 1
               Licensed material--property of copyright holder(s)





                                                               isline(3C)



            int c;

            fp = fopen(argv[1], "r");
            while ((c = fgetc(fp)) != EOF) {
                printf("Is %c a line terminator?  ", c);
                printf("%s.\n",
                   (result = isline(c)) == 0 ? "No" : "Yes");
            }
        }

        A call to the program test with the filename input, which
        contains

        Line

        followed by a New Line character generates the output

        Is L a line terminator?  No. Is i a line terminator?  No. Is n a
        line terminator?  No. Is e a line terminator?  No. Is a line
        terminator?  Yes.


































        DG/UX 4.00                                                 Page 2
               Licensed material--property of copyright holder(s)



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026