C Library Functions  - attr_mode (3)

!>

NAME

attr_mode(3f) - [M_attr] select processing mode for output from attr(3f) (LICENSE:MIT)

CONTENTS

Synopsis
Description
Options
Example
Author
License

SYNOPSIS

subroutine attr_mode(manner)

       character(len=*),intent(in) :: manner

DESCRIPTION

Turn off the generation of strings associated with the HTML keywords in the string generated by the attr(3f) function, or display the text in raw mode as it was passed to attr(3f) or return to ANSI escape control sequence generation.

OPTIONS

MANNER The current manners or modes supported via the attr_mode(3f) procedure are
plain suppress the output associated with keywords color(default) commonly supported escape sequences
raw echo the input to attr(3f) as its output
reload restore original keyword meanings deleted or replaced by calls to attr_update(3f).

EXAMPLE

Sample program

    program demo_attr_mode
    use M_attr, only : attr, attr_mode
    implicit none
    character(len=:),allocatable :: lines(:)
    character(len=:),allocatable :: outlines(:)
    integer :: i
       lines=[character(len=110):: &
       &’<M><y>’,&
       &’<M><y>  Suffice it to say that black and white are also colors’,&
       &’<M><y>  for their simultaneous contrast is as striking as that ’,&
       &’<M><y>  of green and red, for instance. &
       & --- <y><bo>Vincent van Gogh</bo></y>’,&
       &’ ’]

outlines=attr(lines,chars=57) write(*,’(a)’)(trim(outlines(i)),i=1,size(outlines))

call attr_mode(manner=’plain’) ! write as plain text write(*,’(a)’)attr(lines)

call attr_mode(manner=’raw’) ! write as-is write(*,’(a)’)attr(lines)

call attr_mode(manner=’ansi’) ! return to default mode

end program demo_attr_mode

AUTHOR

John S. Urban, 2021

LICENSE

    MIT


Nemo Release 3.1 attr_mode (3) July 22, 2023
Generated by manServer 1.08 from d0765864-23a1-4d03-9e2d-f08259b067c6 using man macros.