ChrisOS Research ProjectOperating systems · language systems · graphics · machine emulation
DOCUMENTATION ARCHIVEMAIN BRANCH
ChrisOS/Source reference: LIB/STR.CC

Source reference: LIB/STR.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 LIB/STR.CC
Lines 21
Bytes 278
SHA-256 38d588c019a57d02e5e62e4c36e3c96a7bf0ed8b435193a4d7f4db78bc34f0ba
ChrisOS revision da3df29cb397932c43d32373871fb9380e688ade

Detected syntactic dependencies

Line Include
— No preprocessor include detected.

Detected symbols

Line Symbol
1 strlen
10 strcpy

Complete source

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

int strlen(int s) {
  int n;
  n = 0;
  while (loadb(s + n) != 0) {
    n = n + 1;
  }
  return n;
}

int strcpy(int dst, int src) {
  int i;
  i = 0;
  while (1) {
    storeb(dst + i, loadb(src + i));
    if (loadb(src + i) == 0) {
      return dst;
    }
    i = i + 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-38d588c019a57d02 Reviewed source: da3df29cb397 Class: generated-source-reference