home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-12-18 | 46.7 KB | 1,761 lines |
- head 0.25;
- access;
- symbols;
- locks
- simons:0.25; strict;
- comment @ * @;
-
-
- 0.25
- date 93.12.18.21.43.11; author simons; state Exp;
- branches;
- next 0.24;
-
- 0.24
- date 93.12.14.22.04.24; author simons; state Exp;
- branches;
- next 0.23;
-
- 0.23
- date 93.12.14.21.52.37; author simons; state Exp;
- branches;
- next 0.22;
-
- 0.22
- date 93.12.14.21.25.45; author simons; state Exp;
- branches;
- next 0.21;
-
- 0.21
- date 93.12.14.17.59.16; author simons; state Exp;
- branches;
- next 0.20;
-
- 0.20
- date 93.12.14.16.42.41; author simons; state Exp;
- branches;
- next 0.19;
-
- 0.19
- date 93.12.14.15.21.36; author simons; state Exp;
- branches;
- next 0.18;
-
- 0.18
- date 93.12.14.15.05.36; author simons; state Exp;
- branches;
- next 0.17;
-
- 0.17
- date 93.12.11.14.31.46; author simons; state Exp;
- branches;
- next 0.16;
-
- 0.16
- date 93.12.10.22.26.14; author simons; state Exp;
- branches;
- next 0.15;
-
- 0.15
- date 93.12.08.17.11.03; author simons; state Exp;
- branches;
- next 0.14;
-
- 0.14
- date 93.12.07.02.22.48; author simons; state Exp;
- branches;
- next 0.13;
-
- 0.13
- date 93.12.07.02.15.50; author simons; state Exp;
- branches;
- next 0.12;
-
- 0.12
- date 93.12.05.16.11.39; author simons; state Exp;
- branches;
- next 0.11;
-
- 0.11
- date 93.12.05.15.46.13; author simons; state Exp;
- branches;
- next 0.10;
-
- 0.10
- date 93.12.05.13.32.37; author simons; state Exp;
- branches;
- next 0.9;
-
- 0.9
- date 93.12.05.13.19.28; author simons; state Exp;
- branches;
- next 0.8;
-
- 0.8
- date 93.12.05.00.35.28; author simons; state Exp;
- branches;
- next 0.7;
-
- 0.7
- date 93.12.05.00.29.29; author simons; state Exp;
- branches;
- next 0.6;
-
- 0.6
- date 93.12.04.22.34.33; author simons; state Exp;
- branches;
- next 0.5;
-
- 0.5
- date 93.12.04.22.30.44; author simons; state Exp;
- branches;
- next 0.4;
-
- 0.4
- date 93.12.04.20.44.35; author simons; state Exp;
- branches;
- next 0.3;
-
- 0.3
- date 93.12.04.18.05.00; author simons; state Exp;
- branches;
- next 0.2;
-
- 0.2
- date 93.12.04.17.13.04; author simons; state Exp;
- branches;
- next 0.1;
-
- 0.1
- date 93.12.04.13.45.54; author simons; state Exp;
- branches;
- next ;
-
-
- desc
- @This program converts all queued UUCP jobs in the format required by
- the receiver and archives them into one archive file, using lharc or
- a similar archiver.
- Then it generates the appropiate C.* file to make UUCico transfer the
- archive.
- Additionally, a modified UUXqt which understands the 'rlharc' type is
- required--but that patch is trivial.
- @
-
-
- 0.25
- log
- @Added the myGetConfigEntry() routine to make accessing configuration
- easier.
- Added config-keywords allowing to specify a batchonlygrade per system.
- The name of the keyword is "BatchOnlyGrade_<systemname>". If this
- entry can't be found or is invalid, the global default is used.
- @
- text
- @/*
- * $Filename: LharcUUCP.c $
- * $Revision: 0.24 $
- * $Date: 1993/12/14 22:04:24 $
- *
- * Copyright (C) 1993 by Peter Simons <simons@@peti.GUN.de>
- *
- * 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.
- *
- * $Id: LharcUUCP.c,v 0.24 1993/12/14 22:04:24 simons Exp simons $
- *
- * ------------------------------ log history ----------------------------
- * $Log: LharcUUCP.c,v $
- * Revision 0.24 1993/12/14 22:04:24 simons
- * Added check, wether the specified grade is a valid alpha-numeric
- * character or not.
- *
- * Revision 0.23 1993/12/14 21:52:37 simons
- * Added a comment describing IsPath().
- *
- * Revision 0.22 1993/12/14 21:25:45 simons
- * Changed the main loop in LharcJob() to free the C.* file as soon as
- * possible, right after the renames, so that an eventually waiting uucico
- * doesn't get blocked.
- *
- * Revision 0.21 1993/12/14 17:59:16 simons
- * Remved the tests in the routines handling with grades. Now we just need
- * one central test in LharcUUCPJob(), right after the configfile is read.
- * Changed the arraysize for the filenames in jobs to 256 byte.
- * Changed GoNextLine() to work with a following feof().
- * Added IsPath() to determine the validity of the requests.
- * Changed the way, IsValidJob() recognizes 'unbatchable' UUCP requests. The
- * last version just counted the number of lines (If that's no hack, what
- * else? :->), while this version recognizes the paths.
- * Added a missing comment in the history (for 0.18).
- * Added a few comments.
- *
- * Revision 0.20 1993/12/14 16:42:41 simons
- * Adedd a DOS version string using C='s bumprev tool.
- * Changes usage-output.
- *
- * Revision 0.19 1993/12/14 15:21:36 simons
- * Added a variable 'LharcBatchGrade' determining the batch-grade of our
- * own job. This defaults to 'A'. Currently, this is only global for the
- * whole system.
- *
- * Revision 0.18 1993/12/14 15:05:36 simons
- * Added a grade-check into IsValidJob(). This required two more parameters:
- * systemname and grade. Currently, the grade is only global, but I'll add
- * some local way.
- * Changed the order of checks in IsValidJob(). Now, the check requiring
- * fileaccess is the last one.
- *
- * Revision 0.17 1993/12/11 14:31:46 simons
- * LharcUUCP is now able to parse the UUCP main config file and determine
- * the sitename from the appropiate entry there. However, HOSTNAME is tested
- * before parsing the file and still has priority. Local vars aren't
- * supported.
- *
- * Revision 0.16 1993/12/10 22:26:14 simons
- * Added the command ("m") in the LHARC-define.
- * LharcUUCP() now terminates, when the current C.* file is already locked,
- * because this usually means, that uucico is currently working on this job
- * and our batch would fail anyway, so we better process the next job.
- * Then LharcUUCP() used to unlock the C.* file before deleting it. This
- * has been fixed.
- * Now, we're locking the full archive name (<system>.LHARCPOSTFIX), to
- * avoid problems with uucico, trying to transfer our archive while we're
- * working on it.
- *
- * Revision 0.15 1993/12/08 17:11:03 simons
- * Changed the call to InitDirScan() to match the new routines.
- *
- * Revision 0.14 1993/12/07 02:22:48 simons
- * Changed the spool directory finding routine again.
- *
- * Revision 0.13 1993/12/07 02:15:50 simons
- * Now checking for a spooldirectory with a truncated systemname, too.
- *
- * Revision 0.12 1993/12/05 16:11:39 simons
- * IsValidJob() didn't free the locked files.
- *
- * Revision 0.11 1993/12/05 15:46:13 simons
- * Added IsValidJob() which determines if we should process this job.
- * Currently, only mail and news are processed--UUCP commands and our
- * own archive-copy is skipped. Since this check is now in a seperate
- * routine, LharcJob() has become a little bit easier and more straight.
- *
- * Revision 0.10 1993/12/05 13:32:37 simons
- * PostArchive() is now called only, when actually a job has been processed.
- * Additionally, it's called after the process is finished, not every time
- * the archive changed. I'm not completely sure if this is the better
- * way--will need some thought.
- *
- * Revision 0.9 1993/12/05 13:19:28 simons
- * HOMESYSTEM is not determined at startup from the related enviroment
- * variable, maybe I'll add configfile parsing some day.
- * Change the order of the tests in main(): Now the commandline is checked
- * first.
- * Added TruncName(), which makes the handling of the 7-char-maximum
- * systemnames easier.
- * Changed commentblock style.
- *
- * Revision 0.8 1993/12/05 00:35:28 simons
- * The history in the sourcefile was broken.
- * Also I didn't mention the seq-routines, I took from Dillon UUCP.
- * Known bug: LharcUUCP packs it's self-generated Archive job. :-) It
- * doesn't really matter, but I'll find a way around this.
- *
- * Revision 0.7 1993/12/05 00:29:29 simons
- * Added PostArchive(), a small and neat routine to create the X.* and
- * the C.* file for the archive.
- *
- * Revision 0.6 1993/12/04 22:34:33 simons
- * The outgoing-archive is now locked while the archiver runs. Actually,
- * only the systemname is used to lock the archive, not the complete name,
- * like "peti.lha" or something similar. So, the mechanism will work with
- * different archivers than LhA on the Amiga platform.
- *
- * Revision 0.5 1993/12/04 22:30:44 simons
- * Now actually starting the archiver, creating a file names <system>.lha,
- * located in the appropiate outgoing directory.
- *
- * Revision 0.4 1993/12/04 20:44:35 simons
- * Moved the directory scanning routine into an extra module, since this
- * is the only routine that is really system-dependant.
- *
- * Revision 0.3 1993/12/04 18:05:00 simons
- * LharcJob() now reads the C.* files and renames the D.* and X.* file to
- * the names they shall have on the remote system, so they can be easily
- * packed.
- * Non-send-jobs are recognized.
- * UUCP jobs (which are send-jobs in fact) are merely recognized, although
- * the current method (UUCP-jobs have only one line!) is a hack. I'll
- * change that soon.
- * Also some problems with the directory scanning routine occur. I will
- * have to re-write GetFileName() soon, too.
- *
- * Revision 0.2 1993/12/04 17:13:04 simons
- * Added commandline parsing, calling PackSpoolJobs() for every provided
- * system.
- * Added GetFileName() which is able to scan a directory for files,
- * matching a certain pattern.
- * Added a basic LharcJob() call, which just locks and opens the file
- * until now.
- *
- * Revision 0.1 1993/12/04 13:45:54 simons
- * This program is released under the GNU General Public License.
- */
-
-
- /************************************* includes ***********/
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <ctype.h>
- #include <dos.h>
- #include <proto/dos.h>
-
- #include "LharcUUCP_rev.h"
-
- /************************************* defines ************/
- #define BUFFERSIZE 128
- #define UUSPOOL "UUSpool:"
- #define SEQ "UULib:Seq"
- #define LHARC "LhA m" /* archiver command, moving enabled */
- #define LHARCPOSTFIX ".lha"
-
- #define USAGE VERS " -- written by Peter Simons <simons@@peti.GUN.de>\n" \
- "Usage: LharcUUCP system [[system] [...]]\n"
-
- /************************************* prototypes *********/
- void PackSpoolJobs(char *systemname);
- char *GetFileName(char *pattern, int reset);
- void LharcJob(char *systemname, char *cfile, char grade);
- void PostArchive(char *systemname, char *postfix, char grade);
- char *TruncName(char *string);
- int IsValidJob(char *cfilename, char *systemname, char grade);
- int GoNextLine(FILE *fh);
- unsigned int GetSequence(unsigned int);
- char *SeqToName(unsigned int);
- int IsPath(char *filename);
- char *myGetConfigEntry(char *keyword, char *def);
-
- void LockFile(char *);
- int FileIsLocked(char *);
- void UnLockFile(char *);
- void UnLockFiles(void);
-
- int InitDirScan(char *);
- char *ScanNextFile(void);
- void EndDirScan(void);
-
- char *GetConfigEntry(char *, char *, char *);
-
- /************************************* global variables ***/
- static const char __RCSId[] = "$Id: LharcUUCP.c,v 0.24 1993/12/14 22:04:24 simons Exp simons $";
- static const char __DOSVer[] = VERSTAG;
- char *homesystem;
- int processed_flag;
-
- /************************************* program ************/
-
- int main(int argc, char **argv)
- {
- char currentdir[512];
-
- if (argc < 2) {
- fprintf(stderr, USAGE);
- return 10;
- }
-
- if (!(homesystem = getenv("HOSTNAME")))
- if (!(homesystem = GetConfigEntry(NULL, "NodeName", NULL))) {
- fprintf(stderr, "LharcUUCP: Can't determine the name of this machine!\n");
- return 10;
- }
-
- if (getcd(0, currentdir))
- return 10;
-
- while (--argc)
- PackSpoolJobs(argv[argc]);
-
- chdir(currentdir);
-
- return 0;
- }
-
-
- /************************************* subroutines ********/
- void PostArchive(char *systemname, char *postfix, char grade)
- {
- FILE *cfh, *xfh;
- char cfilename[64], xfilename[64], *trunc_sysname;
- char dremote[64];
-
- trunc_sysname = TruncName(systemname);
-
- sprintf(cfilename, "C.%s%c0000", trunc_sysname, grade);
- LockFile(cfilename);
- if (!(cfh = fopen(cfilename, "r"))) {
- fclose(cfh);
-
- /*
- * When the fopen() call succedes, does the file already
- * exist and we're finished.
- */
-
- sprintf(xfilename, "D.%sX%s", trunc_sysname, SeqToName(GetSequence(1)));
- sprintf(dremote, "%s%s", TruncName(homesystem), SeqToName(GetSequence(1)));
-
- if (cfh = fopen(cfilename, "w")) {
- fprintf(cfh, "S %s%s D.%s lharc-uucp-daemon - %s%s 0666\n",
- systemname, postfix, dremote, systemname, postfix);
- fprintf(cfh, "S %s X.%s%s lharc-uucp-daemon - %s 0666\n",
- xfilename, TruncName(homesystem), SeqToName(GetSequence(1)), xfilename);
- fclose(cfh);
- }
-
- LockFile(xfilename);
- if (xfh = fopen(xfilename, "w")) {
- fprintf(xfh, "U lharc-uucp-daemon %s\nF D.%s\nC rlharc\n", homesystem, dremote);
- fclose(xfh);
- }
- else
- remove(cfilename);
- UnLockFile(xfilename);
- }
- else
- fclose(cfh);
-
- UnLockFile(cfilename);
- }
-
-
- void PackSpoolJobs(char *systemname)
- {
- char currentdir[BUFFERSIZE], *cfile;
- int success;
- char owngrade, grade;
-
- processed_flag = 0;
-
- if (strlen(systemname)+strlen(UUSPOOL)+1 > BUFFERSIZE) {
- fprintf(stderr, "LharcUUCP: Directoryname is too long for internal buffer.\n");
- return; /* Buffer overflow! */
- }
-
- printf("Processing queued jobs for >%s<.\n", systemname);
-
-
- /*
- * Change into the appropiate directory, holding the spool jobs
- * for the specified system.
- */
-
- sprintf(currentdir, "%s%s", UUSPOOL, systemname);
- if (chdir(currentdir)) {
- sprintf(currentdir, "%s%s", UUSPOOL, TruncName(systemname));
- if (chdir(currentdir)) {
- fprintf(stderr, "LharcUUCP: System >%s< has no spool directory?\n", systemname);
- strcpy(currentdir, UUSPOOL);
- if (chdir(currentdir)) {
- fprintf(stderr, "LharcUUCP: Cd to >%s< failed.\n", UUSPOOL);
- return;
- }
- }
- }
-
-
- /*
- * Determine the configured grades for our process.
- */
-
- {
- char *string, buf[80];
-
- string = myGetConfigEntry("BatchOnlyGrade", NULL);
- grade = (string && isalnum(string[0])) ? string[0] : 'z';
-
- sprintf(buf, "%s_%s", "BatchOnlyGrade", systemname);
- string = myGetConfigEntry(buf, NULL);
- grade = (string && isalnum(string[0])) ? string[0] : grade;
-
- string = myGetConfigEntry("LharcBatchGrade", NULL);
- owngrade = (string && isalnum(string[0])) ? string[0] : 'A';
- }
-
-
- /*
- * Build a pattern matching 'C.system*', with the systemname
- * truncated to 7 characters and scan the spooldirectory for
- * queued jobs we can pack.
- */
-
- {
- char pattern[64];
- sprintf(pattern, "C.%s#?", TruncName(systemname));
- success = InitDirScan(pattern);
- }
-
- if (success)
- while (cfile = ScanNextFile())
- LharcJob(systemname, cfile, grade);
- else
- fprintf(stderr, "LharcUUCP: Directory scan for >%s< failed!\n", currentdir);
-
- EndDirScan();
-
- if (processed_flag)
- PostArchive(systemname, LHARCPOSTFIX, owngrade);
- }
-
-
- void LharcJob(char *systemname, char *cfilename, char grade)
- {
- FILE *cfilehandle;
- char command[2], from[256], to[256], from2[256], to2[256];
- char cmdbuf[256], archivename[64];
- int success = 0;
-
- printf("LharcUUCP: processing <%s>\n", cfilename);
-
- if (FileIsLocked(cfilename))
- return; /* uucico is processing this job right now,
- * so we better leave it alone.
- */
- LockFile(cfilename);
-
- if(!IsValidJob(cfilename, systemname, grade)) {
- UnLockFile(cfilename);
- return;
- }
-
- if (cfilehandle = fopen(cfilename, "r")) {
- fscanf(cfilehandle, "%s%s%s", command, from, to);
- if (GoNextLine(cfilehandle) != EOF) {
- fscanf(cfilehandle, "%s%s%s", command, from2, to2);
-
- LockFile(from);
- LockFile(to);
- LockFile(from2);
- LockFile(to2);
- if (!(rename(from, to)))
- if (!(rename(from2, to2))) {
- success = 1;
- processed_flag = 1;
-
-
- /* Free unused files a soon as
- * possible.
- */
-
- fclose(cfilehandle);
- remove(cfilename);
- UnLockFile(from);
- UnLockFile(from2);
- UnLockFile(cfilename);
-
-
- /* Batch the processed files.
- */
-
- sprintf(cmdbuf, "%s %s %s %s", LHARC, systemname, to, to2);
- printf("%s\n", cmdbuf);
- sprintf(archivename, "%s%s", systemname, LHARCPOSTFIX);
- LockFile(archivename);
- system(cmdbuf);
- UnLockFile(archivename);
- }
- else
- rename(to, from);
-
-
- /* When one of the 'renames' failed, we still
- * have to close and unlock the files.
- */
-
- if (!success) {
- UnLockFile(from);
- UnLockFile(from2);
- fclose(cfilehandle);
- UnLockFile(cfilename);
- }
-
- UnLockFile(to); /* These must be freed */
- UnLockFile(to2); /* in any case. */
- }
- }
- }
-
-
- /*
- * IsValidJob() checks the provided C.* file and tests if this job may
- * may be processed by LharcUUCP. Currently, we only process mail and
- * news. UUCP- and lharc-jobs are left alone.
- */
-
- int IsValidJob(char *cfilename, char *systemname, char grade)
- {
-
- /*
- * Test if the grade of the commandfile is lower or the same as
- * our max. grade.
- */
-
- if (cfilename[strlen(TruncName(systemname)) + 2] > grade)
- return 0;
-
-
- /*
- * Check the number part of the filename. C.*0000 are the C.*
- * files for the processed archives and won't be touched.
- */
-
- if (!strncmp(&cfilename[strlen(cfilename) - 4], "0000", 4))
- return 0;
-
-
- /*
- * Check the contents of the file. Neither target nor source file
- * may contain paths and we can't batch read-requests of course.
- */
-
- {
- FILE *fh;
- int success = 0;
- char from[256], to[256];
-
- if (fh = fopen(cfilename, "r")) {
- while (1) {
- if (fgetc(fh) == 'S') {
- fscanf(fh, "%s%s", from, to);
- if (IsPath(from) || IsPath(to))
- break;
- GoNextLine(fh);
- if (feof(fh)) {
- success = 1;
- break;
- }
- }
- else
- break;
- }
- fclose(fh);
- }
- if (!success)
- return 0;
- }
-
- return 1;
- }
-
-
-
- unsigned int GetSequence(unsigned int bump)
- {
- FILE *fh;
- unsigned int seq = 0;
-
- LockFile(SEQ);
- if (fh = fopen(SEQ, "r")) {
- fscanf(fh, "%u", &seq);
- fclose(fh);
- }
- else {
- fprintf(stderr, "LharcUUCP: Can't open seq file!\n");
- }
-
- if (bump && seq >= 0) {
- if (bump + seq > 0xFFFFF)
- seq = 1;
-
- endlessloop:
- if (fh = fopen(SEQ, "w")) {
- fprintf(fh, "%u", seq + bump);
- fclose(fh);
- }
- else {
- fprintf(stderr, "LharcUUCP: Can't update seq file!\n");
- Delay(5*50);
- goto endlessloop;
- }
- }
- UnLockFile(SEQ);
- return seq;
- }
-
-
- /*
- * Convert a sequence number into a numeric/character combination. Names
- * are unique and case-insensitive. The sequence number 0-0xFFFFF will be
- * converted to a 4 character string each position containing 0-9 a-z,
- * or base 36 (total of 1.6 million combinations)
- */
-
- char *SeqToName(unsigned int seqNo)
- {
- static char Buf[5];
- short i;
-
- seqNo &= 0xFFFFF;
-
- for (i = 3; i >= 0; --i) {
- short n = seqNo % 36;
-
- if (n < 10)
- Buf[i] = n + '0';
- else
- Buf[i] = n - 10 + 'a';
- seqNo /= 36;
- }
- Buf[4] = '\0';
- return (Buf);
- }
-
-
- /*
- * TruncName() duplicates the given string and truncates it to 7
- * characters, which is required by a number of tasks in the UUCP
- * enviroment.
- */
-
- char *TruncName(char *string)
- {
- static char buffer[8];
-
- strncpy(buffer, string, 7);
- buffer[7] = '\0';
-
- return buffer;
- }
-
-
- /*
- * GoNextLine() reads from the provided filehandle until either end-
- * of-file or an end-of-line ('\n') occurs.
- */
-
- int GoNextLine(FILE *fh)
- {
- int c;
-
- while ((c = fgetc(fh)) != EOF && c != '\n')
- ;
-
- if ((c = fgetc(fh)) != EOF) /* Read next character to make */
- ungetc(c, fh); /* feof() work. */
-
- return c;
- }
-
-
- /*
- * This small routine returns a flag indicating wether the provided
- * string was a filepath or just a filename! This is important, because
- * filerequests containing paths can't be processed with LharcUUCP.
- * This routine has to be customized for other systems.
- */
-
- int IsPath(char *filename)
- {
- if (strchr(filename, '/') || strchr(filename, ':'))
- return 1;
- else
- return 0;
- }
-
-
- char *myGetConfigEntry(char *keyword, char *def)
- {
- char *string;
-
- if (string = getenv(keyword))
- return string;
-
- return GetConfigEntry(NULL, keyword, def);
- }
-
- @
-
-
- 0.24
- log
- @Added check, wether the specified grade is a valid alpha-numeric
- character or not.
- @
- text
- @d3 2
- a4 2
- * $Revision: 0.23 $
- * $Date: 1993/12/14 21:52:37 $
- d22 1
- a22 1
- * $Id: LharcUUCP.c,v 0.23 1993/12/14 21:52:37 simons Exp simons $
- d26 4
- d195 1
- d209 1
- a209 1
- static const char __RCSId[] = "$Id: LharcUUCP.c,v 0.23 1993/12/14 21:52:37 simons Exp simons $";
- d329 1
- a329 1
- char *string;
- d331 1
- a331 3
- if (!(string = getenv("BatchOnlyGrade"))) {
- string = GetConfigEntry(NULL, "BatchOnlyGrade", NULL);
- }
- d334 5
- a338 3
- if (!(string = getenv("LharcBatchGrade"))) {
- string = GetConfigEntry(NULL, "LharcBatchGrade", NULL);
- }
- d620 11
- @
-
-
- 0.23
- log
- @Added a comment describing IsPath().
- @
- text
- @d3 2
- a4 2
- * $Revision: 0.22 $
- * $Date: 1993/12/14 21:25:45 $
- d22 1
- a22 1
- * $Id: LharcUUCP.c,v 0.22 1993/12/14 21:25:45 simons Exp simons $
- d26 3
- d164 1
- d204 1
- a204 1
- static const char __RCSId[] = "$Id: LharcUUCP.c,v 0.22 1993/12/14 21:25:45 simons Exp simons $";
- d329 1
- a329 1
- grade = (string) ? string[0] : 'z';
- d334 1
- a334 1
- owngrade = (string) ? string[0] : 'A';
- @
-
-
- 0.22
- log
- @Changed the main loop in LharcJob() to free the C.* file as soon as
- possible, right after the renames, so that an eventually waiting uucico
- doesn't get blocked.
- @
- text
- @d3 2
- a4 2
- * $Revision: 0.21 $
- * $Date: 1993/12/14 17:59:16 $
- d22 1
- a22 1
- * $Id: LharcUUCP.c,v 0.21 1993/12/14 17:59:16 simons Exp simons $
- d26 5
- d200 1
- a200 1
- static const char __RCSId[] = "$Id: LharcUUCP.c,v 0.21 1993/12/14 17:59:16 simons Exp simons $";
- d598 7
- d612 1
- @
-
-
- 0.21
- log
- @Remved the tests in the routines handling with grades. Now we just need
- one central test in LharcUUCPJob(), right after the configfile is read.
- Changed the arraysize for the filenames in jobs to 256 byte.
- Changed GoNextLine() to work with a following feof().
- Added IsPath() to determine the validity of the requests.
- Changed the way, IsValidJob() recognizes 'unbatchable' UUCP requests. The
- last version just counted the number of lines (If that's no hack, what
- else? :->), while this version recognizes the paths.
- Added a missing comment in the history (for 0.18).
- Added a few comments.
- @
- text
- @d3 2
- a4 2
- * $Revision: 0.20 $
- * $Date: 1993/12/14 16:42:41 $
- d22 1
- a22 1
- * $Id: LharcUUCP.c,v 0.20 1993/12/14 16:42:41 simons Exp simons $
- d26 12
- d195 1
- a195 1
- static const char __RCSId[] = "$Id: LharcUUCP.c,v 0.20 1993/12/14 16:42:41 simons Exp simons $";
- d358 1
- d384 1
- a384 1
- if (!(rename(from2, to2)))
- d386 24
- a411 2
- UnLockFile(from);
- UnLockFile(from2);
- a412 2
- {
- char cmdbuf[256], archivename[64];
- d414 9
- a422 6
- sprintf(cmdbuf, "%s %s %s %s", LHARC, systemname, to, to2);
- printf("%s\n", cmdbuf);
- sprintf(archivename, "%s%s", systemname, LHARCPOSTFIX);
- LockFile(archivename);
- system(cmdbuf);
- UnLockFile(archivename);
- d425 2
- a426 2
- UnLockFile(to);
- UnLockFile(to2);
- a427 6
- fclose(cfilehandle);
- if(success) {
- remove(cfilename);
- processed_flag = 1;
- }
- UnLockFile(cfilename);
- @
-
-
- 0.20
- log
- @Adedd a DOS version string using C='s bumprev tool.
- Changes usage-output.
- @
- text
- @d3 2
- a4 2
- * $Revision: 0.19 $
- * $Date: 1993/12/14 15:21:36 $
- d22 1
- a22 1
- * $Id: LharcUUCP.c,v 0.19 1993/12/14 15:21:36 simons Exp simons $
- d26 4
- d35 7
- d169 1
- d183 1
- a183 1
- static const char __RCSId[] = "$Id: LharcUUCP.c,v 0.19 1993/12/14 15:21:36 simons Exp simons $";
- a225 3
- if (!grade)
- grade = 'A'; /* Default: Grade 'A' */
-
- d308 1
- a308 1
- grade = (string) ? string[0] : NULL;
- d313 1
- a313 1
- owngrade = (string) ? string[0] : NULL;
- d345 1
- a345 1
- char command[2], from[32], to[32], from2[32], to2[32];
- d430 2
- a431 3
- * Check if the provided file is a send request and wether it
- * consists of two files or not. One-file requests are usually
- * UUCP jobs and are not handled by this version.
- d437 1
- a438 1
- LockFile(cfilename);
- d440 7
- a446 3
- if (getc(fh) == 'S')
- if (GoNextLine(fh) != EOF)
- if (getc(fh) == 'S')
- d448 6
- a455 1
- UnLockFile(cfilename);
- d498 1
- d544 5
- d553 1
- a553 1
- while ((c = getc(fh)) != EOF && c != '\n')
- d556 3
- d562 8
- @
-
-
- 0.19
- log
- @Added a variable 'LharcBatchGrade' determining the batch-grade of our
- own job. This defaults to 'A'. Currently, this is only global for the
- whole system.
- @
- text
- @d3 2
- a4 2
- * $Revision: 0.17 $
- * $Date: 1993/12/11 14:31:46 $
- d22 1
- a22 1
- * $Id: LharcUUCP.c,v 0.17 1993/12/11 14:31:46 simons Exp simons $
- d26 5
- d134 1
- d136 1
- a136 1
- #include <proto/dos.h>
- d145 2
- a146 2
- #define USAGE "Usage: LharcUUCP system [[system] [...]]\n" \
- "written by Peter Simons <simons@@peti.GUN.de>\n"
- d171 2
- a172 1
- static const char __RCSId[] = "$Id: LharcUUCP.c,v 0.17 1993/12/11 14:31:46 simons Exp simons $";
- @
-
-
- 0.18
- log
- @Added a grade-check into IsValidJob(). This required two more parameters:
- systemname and grade. Currently, the grade is only global, but I'll add
- some local way.
- Changed the order of checks in IsValidJob(). Now, the check requiring
- fileaccess is the last one.
- @
- text
- @d146 1
- a146 1
- void PostArchive(char *systemname, char *postfix);
- d199 1
- a199 1
- void PostArchive(char *systemname, char *postfix)
- d207 4
- a210 1
- sprintf(cfilename, "C.%sA0000", trunc_sysname);
- d251 1
- a251 1
- char grade;
- d283 1
- a283 1
- * Determine the configured grade for our process.
- d293 5
- d322 1
- a322 1
- PostArchive(systemname, LHARCPOSTFIX);
- @
-
-
- 0.17
- log
- @LharcUUCP is now able to parse the UUCP main config file and determine
- the sitename from the appropiate entry there. However, HOSTNAME is tested
- before parsing the file and still has priority. Local vars aren't
- supported.
- @
- text
- @d3 2
- a4 2
- * $Revision: 0.16 $
- * $Date: 1993/12/10 22:26:14 $
- d22 1
- a22 1
- * $Id: LharcUUCP.c,v 0.16 1993/12/10 22:26:14 simons Exp simons $
- d26 6
- d145 1
- a145 1
- void LharcJob(char *systemname, char *cfile);
- d148 1
- a148 1
- int IsValidJob(char *cfilename);
- d165 1
- a165 1
- static const char __RCSId[] = "$Id: LharcUUCP.c,v 0.16 1993/12/10 22:26:14 simons Exp simons $";
- d248 1
- d280 14
- d307 1
- a307 1
- LharcJob(systemname, cfile);
- d318 1
- a318 1
- void LharcJob(char *systemname, char *cfilename)
- d332 1
- a332 1
- if(!IsValidJob(cfilename)) {
- d384 1
- a384 1
- int IsValidJob(char *cfilename)
- a385 2
- FILE *fh;
- int success = 0;
- d388 2
- a389 3
- * Check if the provided file is a send request and wether it
- * consists of two files or not. One-file requests are usually
- * UUCP jobs and are not handled by this version.
- d392 1
- a392 10
- LockFile(cfilename);
- if (fh = fopen(cfilename, "r")) {
- if (getc(fh) == 'S')
- if (GoNextLine(fh) != EOF)
- if (getc(fh) == 'S')
- success = 1;
- fclose(fh);
- }
- UnLockFile(cfilename);
- if (!success)
- d395 1
- d401 1
- a401 2
- cfilename += strlen(cfilename) - 4;
- if (!strncmp(cfilename, "0000", 4))
- d403 24
- @
-
-
- 0.16
- log
- @Added the command ("m") in the LHARC-define.
- LharcUUCP() now terminates, when the current C.* file is already locked,
- because this usually means, that uucico is currently working on this job
- and our batch would fail anyway, so we better process the next job.
- Then LharcUUCP() used to unlock the C.* file before deleting it. This
- has been fixed.
- Now, we're locking the full archive name (<system>.LHARCPOSTFIX), to
- avoid problems with uucico, trying to transfer our archive while we're
- working on it.
- @
- text
- @d3 2
- a4 2
- * $Revision: 0.15 $
- * $Date: 1993/12/08 17:11:03 $
- d22 1
- a22 1
- * $Id: LharcUUCP.c,v 0.15 1993/12/08 17:11:03 simons Exp simons $
- d26 11
- d144 2
- d156 1
- a156 2
- unsigned int GetSequence(unsigned int);
- char *SeqToName(unsigned int);
- d159 2
- a160 2
- static const char __RCSId[] = "$Id: LharcUUCP.c,v 0.15 1993/12/08 17:11:03 simons Exp simons $";
- char *HOMESYSTEM;
- d174 5
- a178 4
- if (!(HOMESYSTEM = getenv("HOSTNAME"))) {
- fprintf(stderr, "LharcUUCP: >HOSTNAME< variable required!\n");
- return 10;
- }
- d212 1
- a212 1
- sprintf(dremote, "%s%s", TruncName(HOMESYSTEM), SeqToName(GetSequence(1)));
- d218 1
- a218 1
- xfilename, TruncName(HOMESYSTEM), SeqToName(GetSequence(1)), xfilename);
- d224 1
- a224 1
- fprintf(xfh, "U lharc-uucp-daemon %s\nF D.%s\nC rlharc\n", HOMESYSTEM, dremote);
- d487 1
- @
-
-
- 0.15
- log
- @Changed the call to InitDirScan() to match the new routines.
- @
- text
- @d3 2
- a4 2
- * $Revision: 0.14 $
- * $Date: 1993/12/07 02:22:48 $
- d22 1
- a22 1
- * $Id: LharcUUCP.c,v 0.14 1993/12/07 02:22:48 simons Exp simons $
- d26 3
- d119 1
- a119 1
- #define LHARC "LhA"
- d147 1
- a147 1
- static const char __RCSId[] = "$Id: LharcUUCP.c,v 0.14 1993/12/07 02:22:48 simons Exp simons $";
- d292 8
- a299 1
- if(!IsValidJob(cfilename))
- d301 1
- a302 1
- LockFile(cfilename);
- d321 1
- a321 1
- char cmdbuf[256];
- d323 1
- a323 1
- sprintf(cmdbuf, "%s m %s %s %s", LHARC, systemname, to, to2);
- d325 2
- a326 1
- LockFile(systemname);
- d328 1
- a328 1
- UnLockFile(systemname);
- a334 1
- UnLockFile(cfilename);
- d339 1
- @
-
-
- 0.14
- log
- @Changed the spool directory finding routine again.
- @
- text
- @d3 2
- a4 2
- * $Revision: 0.13 $
- * $Date: 1993/12/07 02:15:50 $
- d22 1
- a22 1
- * $Id: LharcUUCP.c,v 0.13 1993/12/07 02:15:50 simons Exp simons $
- d26 3
- d136 1
- a136 1
- int InitDirScan(char *, char *);
- d144 1
- a144 1
- static const char __RCSId[] = "$Id: LharcUUCP.c,v 0.13 1993/12/07 02:15:50 simons Exp simons $";
- d265 1
- a265 1
- success = InitDirScan(currentdir, pattern);
- @
-
-
- 0.13
- log
- @Now checking for a spooldirectory with a truncated systemname, too.
- @
- text
- @d3 2
- a4 2
- * $Revision: 0.12 $
- * $Date: 1993/12/05 16:11:39 $
- d22 1
- a22 1
- * $Id: LharcUUCP.c,v 0.12 1993/12/05 16:11:39 simons Exp simons $
- d26 3
- d141 1
- a141 1
- static const char __RCSId[] = "$Id: LharcUUCP.c,v 0.12 1993/12/05 16:11:39 simons Exp simons $";
- d239 1
- a239 1
- sprintf("%s%s", currentdir, UUSPOOL, systemname);
- d241 4
- a244 2
- if(strlen(systemname) > 7) {
- sprintf("%s%s", currentdir, UUSPOOL, TruncName(systemname));
- d246 2
- a247 6
- fprintf(stderr, "LharcUUCP: System >%s< has no spool directory?\n", systemname);
- strcpy(currentdir, UUSPOOL);
- if (chdir(currentdir)) {
- fprintf(stderr, "LharcUUCP: Cd to >%s< failed.\n", UUSPOOL);
- return;
- }
- @
-
-
- 0.12
- log
- @IsValidJob() didn't free the locked files.
- @
- text
- @d3 2
- a4 2
- * $Revision: 0.11 $
- * $Date: 1993/12/05 15:46:13 $
- d22 1
- a22 1
- * $Id: LharcUUCP.c,v 0.11 1993/12/05 15:46:13 simons Exp simons $
- d26 3
- d138 1
- a138 1
- static const char __RCSId[] = "$Id: LharcUUCP.c,v 0.11 1993/12/05 15:46:13 simons Exp simons $";
- d236 1
- a236 2
- strcpy(currentdir, UUSPOOL);
- strcat(currentdir, systemname);
- d238 10
- a247 5
- fprintf(stderr, "LharcUUCP: System >%s< has no spool directory?\n", systemname);
- strcpy(currentdir, UUSPOOL);
- if (chdir(currentdir)) {
- fprintf(stderr, "LharcUUCP: Cd to >%s< failed.\n", UUSPOOL);
- return;
- @
-
-
- 0.11
- log
- @Added IsValidJob() which determines if we should process this job.
- Currently, only mail and news are processed--UUCP commands and our
- own archive-copy is skipped. Since this check is now in a seperate
- routine, LharcJob() has become a little bit easier and more straight.
- @
- text
- @d3 2
- a4 2
- * $Revision: 0.10 $
- * $Date: 1993/12/05 13:32:37 $
- d22 1
- a22 1
- * $Id: LharcUUCP.c,v 0.10 1993/12/05 13:32:37 simons Exp simons $
- d26 6
- d135 1
- a135 1
- static const char __RCSId[] = "$Id: LharcUUCP.c,v 0.10 1993/12/05 13:32:37 simons Exp simons $";
- d331 1
- a331 1
- int c, success = 0;
- d347 1
- @
-
-
- 0.10
- log
- @PostArchive() is now called only, when actually a job has been processed.
- Additionally, it's called after the process is finished, not every time
- the archive changed. I'm not completely sure if this is the better
- way--will need some thought.
- @
- text
- @d3 2
- a4 2
- * $Revision: 0.9 $
- * $Date: 1993/12/05 13:19:28 $
- d22 1
- a22 1
- * $Id: LharcUUCP.c,v 0.9 1993/12/05 13:19:28 simons Exp simons $
- d26 6
- d113 2
- d129 1
- a129 1
- static const char __RCSId[] = "$Id: LharcUUCP.c,v 0.9 1993/12/05 13:19:28 simons Exp simons $";
- d193 1
- a193 1
- fprintf(xfh, "U lharc-uucp-daemon %s\nF D.%s\nC rlharc\n", TruncName(HOMESYSTEM), dremote);
- d267 1
- a267 1
- char command[5], from[32], to[32], from2[32], to2[32];
- d272 3
- d277 25
- a301 30
- fscanf(cfilehandle, "%s", command);
- if (!stricmp(command, "S")) {
- fscanf(cfilehandle, "%s%s", from, to);
- while ((success = getc(cfilehandle)) != '\n' && success != EOF)
- ;
- if (success != EOF) {
- fscanf(cfilehandle, "%s%s%s", command, from2, to2);
-
- LockFile(from);
- LockFile(to);
- LockFile(from2);
- LockFile(to2);
- success = 0;
- if (!(rename(from, to)))
- if (!(rename(from2, to2)))
- success = 1;
- else
- rename(to, from);
- UnLockFile(from);
- UnLockFile(from2);
-
- {
- char cmdbuf[256];
-
- sprintf(cmdbuf, "%s m %s %s %s", LHARC, systemname, to, to2);
- printf("%s\n", cmdbuf);
- LockFile(systemname);
- system(cmdbuf);
- UnLockFile(systemname);
- }
- d303 2
- a304 5
- UnLockFile(to);
- UnLockFile(to2);
- }
- else
- success = 0;
- d316 42
- a390 1
-
- d435 10
- @
-
-
- 0.9
- log
- @HOMESYSTEM is not determined at startup from the related enviroment
- variable, maybe I'll add configfile parsing some day.
- Change the order of the tests in main(): Now the commandline is checked
- first.
- Added TruncName(), which makes the handling of the 7-char-maximum
- systemnames easier.
- Changed commentblock style.
- @
- text
- @d3 2
- a4 2
- * $Revision: 0.8 $
- * $Date: 1993/12/05 00:35:28 $
- d22 1
- a22 1
- * $Id: LharcUUCP.c,v 0.8 1993/12/05 00:35:28 simons Exp simons $
- d26 9
- d121 1
- a121 1
- static const char __RCSId[] = "$Id: LharcUUCP.c,v 0.8 1993/12/05 00:35:28 simons Exp simons $";
- d123 1
- d204 2
- d250 3
- d305 1
- a305 1
- if(success)
- d307 2
- a309 1
- PostArchive(systemname, LHARCPOSTFIX);
- @
-
-
- 0.8
- log
- @The history in the sourcefile was broken.
- Also I didn't mention the seq-routines, I took from Dillon UUCP.
- Known bug: LharcUUCP packs it's self-generated Archive job. :-) It
- doesn't really matter, but I'll find a way around this.
- @
- text
- @d3 2
- a4 2
- * $Revision: 0.7 $
- * $Date: 1993/12/05 00:29:29 $
- d22 1
- a22 1
- * $Id: LharcUUCP.c,v 0.7 1993/12/05 00:29:29 simons Exp simons $
- d26 6
- a87 1
- #define HOMESYSTEM "peti"
- d97 1
- d112 2
- a113 1
- static const char __RCSId[] = "$Id: LharcUUCP.c,v 0.7 1993/12/05 00:29:29 simons Exp simons $";
- d121 10
- a133 3
- if (argc < 2)
- fprintf(stderr, USAGE);
-
- d147 1
- a147 1
- char cfilename[64], xfilename[64], trunc_sysname[8];
- d150 1
- a150 2
- strncpy(trunc_sysname, systemname, 7);
- trunc_sysname[7] = '\0';
- d157 2
- a158 1
- /* When the fopen() call succedes, does the file already
- d163 1
- a163 1
- sprintf(dremote, "%s%s", HOMESYSTEM, SeqToName(GetSequence(1)));
- d169 1
- a169 1
- xfilename, HOMESYSTEM, SeqToName(GetSequence(1)), xfilename);
- d175 1
- a175 1
- fprintf(xfh, "U lharc-uucp-daemon %s\nF D.%s\nC rlharc\n", HOMESYSTEM, dremote);
- d202 2
- a203 1
- /* Change into the appropiate directory, holding the spool jobs
- d219 2
- a220 1
- /* Build a pattern matching 'C.system*', with the systemname
- d226 2
- a227 4
- char tmp[8], pattern[64];
- memset(tmp, 0, 8);
- strncpy(tmp, systemname, 7);
- sprintf(pattern, "C.%s#?", tmp);
- d331 6
- a336 6
- /*
- * Convert a sequence number into a numeric/character combination. Names
- * are unique and case-insensitive. The sequence number 0-0xFFFFF will be
- * converted to a 4 character string each position containing 0-9 a-z,
- * or base 36 (total of 1.6 million combinations)
- */
- d357 18
- @
-
-
- 0.7
- log
- @Added PostArchive(), a small and neat routine to create the X.* and
- the C.* file for the archive.
- @
- text
- @d3 2
- a4 2
- * $Revision: 0.5 $
- * $Date: 1993/12/04 22:30:44 $
- d22 1
- a22 1
- * $Id: LharcUUCP.c,v 0.5 1993/12/04 22:30:44 simons Exp simons $
- d26 10
- d106 1
- a106 1
- static const char __RCSId[] = "$Id: LharcUUCP.c,v 0.5 1993/12/04 22:30:44 simons Exp simons $";
- a342 1
-
- @
-
-
- 0.6
- log
- @The outgoing-archive is now locked while the archiver runs. Actually,
- only the systemname is used to lock the archive, not the complete name,
- like "peti.lha" or something similar. So, the mechanism will work with
- different archivers than LhA on the Amiga platform.
- @
- text
- @d64 2
- d67 1
- d69 1
- a69 1
- #define BUFFERSIZE 128
- d71 2
- d81 1
- d92 3
- a97 1
-
- d120 45
- a213 1
-
- d269 63
- @
-
-
- 0.5
- log
- @Now actually starting the archiver, creating a file names <system>.lha,
- located in the appropiate outgoing directory.
- @
- text
- @d3 2
- a4 2
- * $Revision: 0.4 $
- * $Date: 1993/12/04 20:44:35 $
- d22 1
- a22 1
- * $Id: LharcUUCP.c,v 0.4 1993/12/04 20:44:35 simons Exp simons $
- d26 4
- d87 1
- a87 1
- static const char __RCSId[] = "$Id: LharcUUCP.c,v 0.4 1993/12/04 20:44:35 simons Exp simons $";
- d201 1
- d203 1
- @
-
-
- 0.4
- log
- @Moved the directory scanning routine into an extra module, since this
- is the only routine that is really system-dependant.
- @
- text
- @d3 2
- a4 2
- * $Revision: 0.3 $
- * $Date: 1993/12/04 18:05:00 $
- d22 1
- a22 1
- * $Id: LharcUUCP.c,v 0.3 1993/12/04 18:05:00 simons Exp simons $
- d26 4
- d62 2
- a63 1
- #define BUFFERSIZE 1024
- d78 4
- d83 1
- a83 1
- static const char __RCSId[] = "$Id: LharcUUCP.c,v 0.3 1993/12/04 18:05:00 simons Exp simons $";
- d110 2
- a111 1
- char buffer[BUFFERSIZE], *cfile;
- d125 3
- a127 3
- strcpy(buffer, UUSPOOL);
- strcat(buffer, systemname);
- if (chdir(buffer)) {
- d129 2
- a130 1
- if (chdir(UUSPOOL)) {
- d143 1
- a143 1
- char tmp[8];
- d146 2
- a147 1
- sprintf(buffer, "C.%s#?", tmp);
- d150 8
- a157 5
- /* if (GetFileName(buffer, 1)) {
- * while (cfile = GetFileName(buffer, 0))
- * LharcJob(systemname, cfile);
- * }
- */
- d190 10
- a200 1
- UnLockFile(from2);
- @
-
-
- 0.3
- log
- @LharcJob() now reads the C.* files and renames the D.* and X.* file to
- the names they shall have on the remote system, so they can be easily
- packed.
- Non-send-jobs are recognized.
- UUCP jobs (which are send-jobs in fact) are merely recognized, although
- the current method (UUCP-jobs have only one line!) is a hack. I'll
- change that soon.
- Also some problems with the directory scanning routine occur. I will
- have to re-write GetFileName() soon, too.
- @
- text
- @d3 2
- a4 2
- * $Revision: 0.1 $
- * $Date: 1993/12/04 13:45:54 $
- d22 1
- a22 1
- * $Id: LharcUUCP.c,v 0.1 1993/12/04 13:45:54 simons Exp simons $
- d26 20
- a45 1
- * Revision 0.1 1993/12/04 13:45:54 simons
- a55 3
- #include <dos/dos.h>
- #include <proto/dos.h>
-
- d74 1
- a74 3
-
- static const char __RCSId[] = "$Id: LharcUUCP.c,v 0.1 1993/12/04 13:45:54 simons Exp simons $";
-
- d138 5
- a142 4
- if (GetFileName(buffer, 1)) {
- while (cfile = GetFileName(buffer, 0))
- LharcJob(systemname, cfile);
- }
- a188 45
-
-
- /*
- * GetFileName() returns the first file, matching the provided pattern in
- * the current directory. If no file matched, NULL is returned.
- *
- * Every time you're scanning a new directory, you have to set the reset
- * parameter != 0 and check the returncode.
- *
- * Please take note, that GetFileName() saves the 'position' of the
- * first hit and continues after that file when called again, unless the
- * reset parameter is set again.
- */
-
- char *GetFileName(char *pattern, int reset)
- {
- #ifdef AMIGA
- static struct FileInfoBlock __aligned fib;
- BPTR lock;
- char *filename = NULL, token[128];
-
- if (reset) {
- if (lock = Lock("", ACCESS_READ)) {
- if (!(Examine(lock, &fib)))
- reset = 0;
- UnLock(lock);
- }
- return ((char *) reset);
- }
-
- if (ParsePatternNoCase(pattern, token, 128) == 1)
- if (lock = Lock("", ACCESS_READ)) {
- do {
- if (ExNext(lock, &fib))
- filename = fib.fib_FileName;
- else
- filename = NULL;
- } while (filename && !MatchPatternNoCase(token, filename));
- UnLock(lock);
- }
- return filename;
- #else
- return NULL;
- #endif
- }
- @
-
-
- 0.2
- log
- @Added commandline parsing, calling PackSpoolJobs() for every provided
- system.
- Added GetFileName() which is able to scan a directory for files,
- matching a certain pattern.
- Added a basic LharcJob() call, which just locks and opens the file
- until now.
- @
- text
- @d134 2
- a135 1
- char buffer[256];
- d141 25
- a165 3
- fscanf(cfilehandle, "%s", buffer);
- if (!stricmp(buffer, "S")) {
- ;
- d168 3
- d180 3
- d185 1
- a185 1
- * reset-parameter is != 0.
- @
-
-
- 0.1
- log
- @This program is released under the GNU General Public License.
- @
- text
- @d3 2
- a4 2
- * $Revision$
- * $Date$
- d22 1
- a22 1
- * $Id$
- d25 3
- a27 1
- * $Log$
- d32 4
- d37 3
- d41 5
- d48 8
- d59 2
- a60 1
- static const char __RCSId[] = "$Id$";
- d67 10
- d78 2
- d81 108
- @
-