ChrisOS Research ProjectOperating systems · language systems · graphics · machine emulation
DOCUMENTATION ARCHIVEMAIN BRANCH
ChrisOS/Source reference: APPS/NET/MAIL.CC

Source reference: APPS/NET/MAIL.CC

Deterministic source record. The complete textual file is reproduced below; this page does not replace architectural interpretation in the authored chapters.

File identity

Field Value
Path APPS/NET/MAIL.CC
Lines 39
Bytes 607
SHA-256 323a7b2ae1016508e55c0f613bc61e2115aca19841df856add50ae099d1fcc69
ChrisOS revision da3df29cb397932c43d32373871fb9380e688ade

Detected syntactic dependencies

Line Include
— No preprocessor include detected.

Detected symbols

Line Symbol
1 main

Complete source

The following block is the complete textual file at the recorded revision. No lines are elided, abbreviated or paraphrased.

void main() {
  int smtp;
  int pop;
  int c;
  char hi[12];
  char ok[8];
  viewport(200, 80);
  text(8, 8, "mail", 0x00FFFFFF);
  smtp = sock_listen(25);
  pop = sock_listen(110);
  hi[0] = 50;
  hi[1] = 50;
  hi[2] = 48;
  hi[3] = 32;
  hi[4] = 104;
  hi[5] = 105;
  hi[6] = 13;
  hi[7] = 10;
  hi[8] = 0;
  ok[0] = 43;
  ok[1] = 79;
  ok[2] = 75;
  ok[3] = 13;
  ok[4] = 10;
  ok[5] = 0;
  while (1) {
    c = sock_accept(smtp);
    if (c > 0) {
      sock_send(c, hi, 8);
      sock_close(c);
    }
    c = sock_accept(pop);
    if (c > 0) {
      sock_send(c, ok, 5);
      sock_close(c);
    }
  }
}

Role of this record

The atlas guarantees file-by-file traceability. Responsibility, invariants, ownership, concurrency, security, performance and subsystem interactions belong in authored chapters and must cite this file when applicable.

Document record ID: source-323a7b2ae1016508 Reviewed source: da3df29cb397 Class: generated-source-reference