TIP: Click on subject to list as thread! ANSI
echo: net_dev
to: All
from: Paul Edwards
date: 1997-03-27 19:43:58
subject: missing file in tobruk

Sorry folks, I left route.c out of the archive.  Will be fixed for the next
release...

/* route - routing functions */
/* Originally written by Paul Edwards */
/* Released to the Public Domain */

#include 
#include 

#include "route.h"
#include "unused.h"
#include "estdio.h"
#include "patmat.h"
#include "strinl.h"
#include "stritr.h"
#include "faddr.h"

void routeDefaults(ROUTE *route)
{
    unused(route);
    return;
}

void routeInit(ROUTE *route, char *filename)
{
    efileOpen(&route->fp, filename, "r");
    return;
}

int routeMap(ROUTE *route, fidoAddress *in, fidoAddress *out)
{
    char buf[200];
    char inFull[50];
    int found = 0;
    
    sprintf(inFull, "%d:%d/%d.%d", in->zone, in->net,
in->node, in->point);
    efileRewind(&route->fp);
    while (efileGets(&route->fp, buf, sizeof buf) != NULL)
    {
        strinl(buf);
        stritr(buf);
        if (strncmp(buf, "Send Hold ", 10) == 0)
        {
            if (patmat(inFull, buf + 10))
            {
                *out = *in;
                found = 1;
                break;
            }
        }
        else if (strncmp(buf, "Route Hold ", 11) == 0)
        {
            char *p;
            
            p = strchr(buf + 11, ' ');
            if (p != NULL)
            {
                if (patmat(inFull, p + 1))
                {
                    FADDR fa;
                    
                    faddrOnePassCreate(&fa, buf + 11, out);
                    found = 1;
                    break;
                }
            }
        }
    }
    return (found);
}

void routeTerm(ROUTE *route)
{
    efileClose(&route->fp);
    return;
}
@EOT:

---
* Origin: X (3:711/934.9)

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.