Home » CEEFAX disks » telesoftware14.adl » 24-02-89/QT\C

24-02-89/QT\C

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » CEEFAX disks » telesoftware14.adl
Filename: 24-02-89/QT\C
Read OK:
File size: 038D bytes
Load address: 0000
Exec address: FFFFFFFF
File contents
/******************************************
*                                         *
*        Quick Type by Robin Nixon        *
*                                         *
*       (c) Personal Computing with       *
*               the Amstrad               *
*                                         *
******************************************/

#include "stdio.h"

long atol();

main(argc,argv)
int argc;
char *argv[];
{
  FILE *fp;
  long filepos=0;
  char c;

  if (argc < 2)
  {
    printf("Filename required");
    exit(0);
  }
  if (argc > 2)
    filepos=atol(argv[2]);
  fp=fopen(argv[1],"rb");
  if (fp == NULL)
  {
    printf("File not found");
    exit(0);
  }
  fseek(fp,filepos,0);
  while (!feof(fp))
  {
    c=fgetc(fp);
	if (c == 13)
    {
      putchar(13);
      putchar(10);
    }
    if (c != 10)
      putchar(c);
  }
  fclose(fp);
}
00000000  2f 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |/***************|
00000010  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
00000020  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 0d 0a 2a 20 20  |***********..*  |
00000030  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00000050  20 20 20 20 20 20 20 2a  0d 0a 2a 20 20 20 20 20  |       *..*     |
00000060  20 20 20 51 75 69 63 6b  20 54 79 70 65 20 62 79  |   Quick Type by|
00000070  20 52 6f 62 69 6e 20 4e  69 78 6f 6e 20 20 20 20  | Robin Nixon    |
00000080  20 20 20 20 2a 0d 0a 2a  20 20 20 20 20 20 20 20  |    *..*        |
00000090  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
000000b0  20 2a 0d 0a 2a 20 20 20  20 20 20 20 28 63 29 20  | *..*       (c) |
000000c0  50 65 72 73 6f 6e 61 6c  20 43 6f 6d 70 75 74 69  |Personal Computi|
000000d0  6e 67 20 77 69 74 68 20  20 20 20 20 20 20 2a 0d  |ng with       *.|
000000e0  0a 2a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.*              |
000000f0  20 74 68 65 20 41 6d 73  74 72 61 64 20 20 20 20  | the Amstrad    |
00000100  20 20 20 20 20 20 20 20  20 20 20 2a 0d 0a 2a 20  |           *..* |
00000110  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00000130  20 20 20 20 20 20 20 20  2a 0d 0a 2a 2a 2a 2a 2a  |        *..*****|
00000140  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000160  2a 2a 2a 2a 2a 2f 0d 0a  0d 0a 23 69 6e 63 6c 75  |*****/....#inclu|
00000170  64 65 20 22 73 74 64 69  6f 2e 68 22 0d 0a 0d 0a  |de "stdio.h"....|
00000180  6c 6f 6e 67 20 61 74 6f  6c 28 29 3b 0d 0a 0d 0a  |long atol();....|
00000190  6d 61 69 6e 28 61 72 67  63 2c 61 72 67 76 29 0d  |main(argc,argv).|
000001a0  0a 69 6e 74 20 61 72 67  63 3b 0d 0a 63 68 61 72  |.int argc;..char|
000001b0  20 2a 61 72 67 76 5b 5d  3b 0d 0a 7b 0d 0a 20 20  | *argv[];..{..  |
000001c0  46 49 4c 45 20 2a 66 70  3b 0d 0a 20 20 6c 6f 6e  |FILE *fp;..  lon|
000001d0  67 20 66 69 6c 65 70 6f  73 3d 30 3b 0d 0a 20 20  |g filepos=0;..  |
000001e0  63 68 61 72 20 63 3b 0d  0a 0d 0a 20 20 69 66 20  |char c;....  if |
000001f0  28 61 72 67 63 20 3c 20  32 29 0d 0a 20 20 7b 0d  |(argc < 2)..  {.|
00000200  0a 20 20 20 20 70 72 69  6e 74 66 28 22 46 69 6c  |.    printf("Fil|
00000210  65 6e 61 6d 65 20 72 65  71 75 69 72 65 64 22 29  |ename required")|
00000220  3b 0d 0a 20 20 20 20 65  78 69 74 28 30 29 3b 0d  |;..    exit(0);.|
00000230  0a 20 20 7d 0d 0a 20 20  69 66 20 28 61 72 67 63  |.  }..  if (argc|
00000240  20 3e 20 32 29 0d 0a 20  20 20 20 66 69 6c 65 70  | > 2)..    filep|
00000250  6f 73 3d 61 74 6f 6c 28  61 72 67 76 5b 32 5d 29  |os=atol(argv[2])|
00000260  3b 0d 0a 20 20 66 70 3d  66 6f 70 65 6e 28 61 72  |;..  fp=fopen(ar|
00000270  67 76 5b 31 5d 2c 22 72  62 22 29 3b 0d 0a 20 20  |gv[1],"rb");..  |
00000280  69 66 20 28 66 70 20 3d  3d 20 4e 55 4c 4c 29 0d  |if (fp == NULL).|
00000290  0a 20 20 7b 0d 0a 20 20  20 20 70 72 69 6e 74 66  |.  {..    printf|
000002a0  28 22 46 69 6c 65 20 6e  6f 74 20 66 6f 75 6e 64  |("File not found|
000002b0  22 29 3b 0d 0a 20 20 20  20 65 78 69 74 28 30 29  |");..    exit(0)|
000002c0  3b 0d 0a 20 20 7d 0d 0a  20 20 66 73 65 65 6b 28  |;..  }..  fseek(|
000002d0  66 70 2c 66 69 6c 65 70  6f 73 2c 30 29 3b 0d 0a  |fp,filepos,0);..|
000002e0  20 20 77 68 69 6c 65 20  28 21 66 65 6f 66 28 66  |  while (!feof(f|
000002f0  70 29 29 0d 0a 20 20 7b  0d 0a 20 20 20 20 63 3d  |p))..  {..    c=|
00000300  66 67 65 74 63 28 66 70  29 3b 0d 0a 09 69 66 20  |fgetc(fp);...if |
00000310  28 63 20 3d 3d 20 31 33  29 0d 0a 20 20 20 20 7b  |(c == 13)..    {|
00000320  0d 0a 20 20 20 20 20 20  70 75 74 63 68 61 72 28  |..      putchar(|
00000330  31 33 29 3b 0d 0a 20 20  20 20 20 20 70 75 74 63  |13);..      putc|
00000340  68 61 72 28 31 30 29 3b  0d 0a 20 20 20 20 7d 0d  |har(10);..    }.|
00000350  0a 20 20 20 20 69 66 20  28 63 20 21 3d 20 31 30  |.    if (c != 10|
00000360  29 0d 0a 20 20 20 20 20  20 70 75 74 63 68 61 72  |)..      putchar|
00000370  28 63 29 3b 0d 0a 20 20  7d 0d 0a 20 20 66 63 6c  |(c);..  }..  fcl|
00000380  6f 73 65 28 66 70 29 3b  0d 0a 7d 0d 0a           |ose(fp);..}..|
0000038d
24-02-89/QT\C.m0
24-02-89/QT\C.m1
24-02-89/QT\C.m2
24-02-89/QT\C.m4
24-02-89/QT\C.m5