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

Source reference: APPS/NET/BROWSER.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/BROWSER.CC
Lines 48
Bytes 762
SHA-256 bdd4c15076447564cc26c7725a1cd7297d0aa1b2dc8baed79d2f5428323d74e5
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 ip;
  int fd;
  char req[40];
  char buf[128];
  int n;
  int i;
  viewport(320, 160);
  text(8, 8, "browser", 0x00FFFFFF);
  ip = dns_lookup("example.com");
  fd = sock_connect(ip, 80);
  req[0] = 71;
  req[1] = 69;
  req[2] = 84;
  req[3] = 32;
  req[4] = 47;
  req[5] = 32;
  req[6] = 72;
  req[7] = 84;
  req[8] = 84;
  req[9] = 80;
  req[10] = 47;
  req[11] = 49;
  req[12] = 46;
  req[13] = 48;
  req[14] = 13;
  req[15] = 10;
  req[16] = 13;
  req[17] = 10;
  req[18] = 0;
  i = 0;
  while (i < 40) {
    n = sock_send(fd, req, 18);
    if (n > 0) {
      i = 40;
    }
    i = i + 1;
  }
  n = sock_recv(fd, buf, 120);
  if (n > 0) {
    storeb(buf + n, 0);
    text(8, 28, buf, 0x00E0E0E0);
  }
  sock_close(fd);
  while (1) {
  }
}

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-bdd4c15076447564 Reviewed source: da3df29cb397 Class: generated-source-reference