Back to index

texmacs  1.0.7.15
Defines | Functions
multiline.cpp File Reference
#include <iostream>

Go to the source code of this file.

Defines

#define DATA_BEGIN   ((char) 2)
#define DATA_END   ((char) 5)
#define DATA_COMMAND   ((char) 16)
#define DATA_ESCAPE   ((char) 27)

Functions

int main ()

Define Documentation

#define DATA_BEGIN   ((char) 2)

Definition at line 16 of file multiline.cpp.

#define DATA_COMMAND   ((char) 16)

Definition at line 18 of file multiline.cpp.

#define DATA_END   ((char) 5)

Definition at line 17 of file multiline.cpp.

#define DATA_ESCAPE   ((char) 27)

Definition at line 19 of file multiline.cpp.


Function Documentation

int main ( )

Definition at line 22 of file multiline.cpp.

        {
  cout << DATA_BEGIN << "verbatim:";
  cout << "Terminate your input by ';'";
  cout << DATA_END;
  cout.flush ();

  while (true) {
    char buffer[100];
    cin.getline (buffer, 100, '\n');
    if (buffer[0] != DATA_COMMAND) {
      cout << DATA_BEGIN << "verbatim:";
      cout << buffer;
      cout << DATA_END;
    }
    else {
      int  n = strlen (buffer);
      cout << DATA_BEGIN << "scheme:";
      if (buffer[n-3] == ';') cout << "#t";
      else cout << "#f";
      cout << DATA_END;
    }
    cout.flush ();
  }
  return 0;
}

Here is the call graph for this function: