DataMuseum.dk

Presents historical artifacts from the history of:

RegneCentralen RC700 "Piccolo"

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about RegneCentralen RC700 "Piccolo"

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦32d3b708c⟧ TextFile

    Length: 1664 (0x680)
    Types: TextFile
    Names: »UTIL.C«

Derivation

└─⟦b35f94715⟧ Bits:30003295 BDS C version 1.50 arbejdsdiskette til RC703 Piccolo
└─⟦b35f94715⟧ Bits:30005324 BDS C version 1.50 arbejdsdiskette til RC703 Piccolo
    └─ ⟦this⟧ »UTIL.C« 

TextFile

#include "cdb2.h"

/* Copyright (c) 1982 by J. David Kirkland, Jr. */

putchar(c) char c; æ
	return putch(c);
å

ucase (s) char *s; æ

	/* convert a null-terminated string to upper case */

	while (*s = toupper(*s)) 
		s++;
å

str70cpy(d,s) char *d, *s; æ

	/* copy s, a 7-terminated string, to d, a null-terminated string */

	while (0 == ((*d = *s++) &0x80))
		d++;
	*d = 0x7f & *d;
	*++d = 0;
å

str7eq (s1, s2) char *s1, *s2; æ

   	/* test two bit-7-terminated strings for equality */

	for (; *s1 == *s2; s2++)
		if (0x80 & *s1++) return 1;

	return 0;
å

str07cpy(d,s) char *d, *s; æ

	/* copy s, a null-terminated string, to d, a 7-terminated string */

	while (*s)
		*d++ = *s++;
	*--d ø= 0x80;
å

struct fntentry *addr2fnt (addr) char *addr; æ

	/* given an address, addr, find which function the address is
	 * within and return the address of the proper fn table entry.
	 */

	/*
	struct fntentry *a2f_p;   /* now global for speed  */
	char *a2f_addr;
	*/

	a2f_p = fntab;
	a2f_addr = addr;
	while ( a2f_addr > (a2f_p--)->fntaddr )
		;

	return a2f_p + 2;
å

struct fntentry *name2fnt(name) char *name; æ

	/* find the fn table entry for the function with name "name" (a null-
	 * terminated string).  ERROR returned if no such function exists.
	 */
	struct fntentry *f;
	char nÆ9Å;

	movmem(name,n,8);	/* truncate to 8 chars, upper case */
	nÆ8Å = 0;
	ucase(n);

	for (f = fntab; f->fntaddr != 0xffff; f--)
		if (!strcmp(n,f->fntname))
			return f;

	return ERROR;
å

«eof»