Back to index

texmacs  1.0.7.15
Defines | Functions | Variables
mycas.cpp File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream.h>

Go to the source code of this file.

Defines

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

Functions

void next_input ()
int main ()

Variables

static int counter = 0

Define Documentation

#define DATA_BEGIN   ((char) 2)

Definition at line 22 of file mycas.cpp.

#define DATA_END   ((char) 5)

Definition at line 23 of file mycas.cpp.

#define DATA_ESCAPE   ((char) 27)

Definition at line 24 of file mycas.cpp.


Function Documentation

int main ( )

Definition at line 36 of file mycas.cpp.

        {
  cout << DATA_BEGIN << "verbatim:";
  cout << "------------------------------------------------------\n";
  cout << "Welcome to my test computer algebra system for TeXmacs\n";
  cout << "This software comes with no warranty whatsoever\n";
  cout << "(c) 2001  by Joris van der Hoeven\n";
  cout << "------------------------------------------------------\n";
  next_input ();
  cout << DATA_END;
  fflush (stdout);

  while (1) {
    char buffer[100];
    cin.getline (buffer, 100, '\n');
    if (strcmp (buffer, "quit") == 0) break;
    cout << DATA_BEGIN << "verbatim:";
    cout << "You typed " << buffer << "\n";

    cout << "And now a LaTeX formula: ";
    cout << DATA_BEGIN << "latex:" << "$x^2+y^2=z^2$" << DATA_END;
    cout << "\n";

    cout << "And finally a fraction ";
    cout << DATA_BEGIN << "scheme:" << "(frac \"a\" \"b\")" << DATA_END;
    cout << ".\n";

    next_input ();
    cout << DATA_END;
    fflush (stdout);
  }
  return 0;
}

Here is the call graph for this function:

void next_input ( )

Definition at line 29 of file mycas.cpp.

              {
  counter++;
  cout << DATA_BEGIN << "channel:prompt" << DATA_END;
  cout << "Input " << counter << "] ";
}

Variable Documentation

int counter = 0 [static]

Definition at line 26 of file mycas.cpp.