/* * adifdeb.c * * (c) Copyright 1997-2001 DF7BE * Free Software under property of the * GNU General Public License * * Date : 02.03.2000 * * * Logbuchprogramm DF7BE * Amateur-Radio log by DF7BE * Zusatzmodul fuer ADIF-Import * deutsche Version * Clipper Sommer 87 oder 5.2 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the license, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA ( or visit * their web site at http://www.gnu.org/ ). * * * Modification documentation * * +------------+-------------------------+----------------------------------+ * + Date ! Name and Call ! Modification ! * +------------+-------------------------+----------------------------------+ * ! 02.03.2000 ! W.Brunken DF7BE ! first creation ! * +------------+-------------------------+----------------------------------+ * * Compiling: * * gcc adifdeb.c -o adifdeb.exe (DJGPP) * gcc adifdeb.c -o adifdeb (UNIX,LINUX) * cc adifdeb.c -o adifdeb (UNIX) * MICROSOFT QUICK C 2.5 : use Make Menu * set at Options model to "small" * */ #include #include FILE * f; void main(int argc , char * argv[]) { int ch; int e; long s; e = 80 ; /* Anzahl der auszugebenden Zeichen */ if( argc != 3 ) { printf("usage : adifdeb \n"); printf("\n"); printf("Copyright (c) 1997-2001 DF7BE\n"); printf("\n"); printf("This program is free software; you can redistribute it and/or modify\n"); printf("it under the terms of the GNU General Public License as published by\n"); printf("the Free Software Foundation; either version 2 of the license, or\n"); printf("(at your option) any later version.\n"); printf("\n"); printf("This program is distributed in the hope that it will be useful,\n"); printf("but WITHOUT ANY WARRANTY; without even the implied warranty of\n"); printf("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"); printf("GNU General Public License for more details.\n"); printf("You should have received a copy of the GNU General Public License\n"); printf("along with this program; if not, write to the Free Software\n"); printf("Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA ( or visit\n"); printf("their web site at http://www.gnu.org/ ).\n"); exit (1); } s = atol((char *) argv[2]); if (((f=fopen(argv[1],"rb")) == NULL)) { printf("Kann Datei %s nicht oeffnen\n", argv[1]); exit(1); } /* seek to position */ if ((fseek(f,s,SEEK_SET) != NULL)) { printf("fseek-Fehler\n"); fclose(f); exit(1); } while ( e != 0 ) { ch = fgetc(f); if ( ch == EOF ) { printf("\nEOF erreicht\n"); fclose(f); exit(1); } printf("%c",((unsigned char) ch)); e--; } /* while */ printf("\n"); fclose(f); exit (0); }