TIP: Click on subject to list as thread! ANSI
echo: public_domain
to: All
from: Paul Edwards
date: 1995-06-25 15:09:06
subject: repo.c

/*********************************************************************/
/*                                                                   */
/*  This Program Written by Paul Edwards, 3:711/934{at}fidonet.         */
/*  Released to the Public Domain                                    */
/*                                                                   */
/*********************************************************************/
/*********************************************************************/
/*                                                                   */
/*  repo - repositioning functions                                   */
/*                                                                   */
/*********************************************************************/

#include "repo.h"
#include "unused.h"

/* The following functions are designed to be used by applications */

void repoOpen(REPO *repo)
{
    repo->openFnc(repo->vstr);
    return;
}

void repoClose(REPO *repo)
{
    repo->closeFnc(repo->vstr);
    return;
}

void repoSeek(REPO *repo, long offset)
{
    repo->seekFnc(repo->vstr, offset);
    return;
}

size_t repoRead(REPO *repo, char *buf, size_t amount)
{
    size_t bytes;
    
    bytes = repo->readFnc(repo->vstr, buf, amount);
    return (bytes);
}

/* The following functions are meant to be used by the setup
   code */
   
void repoDefaults(REPO *repo)
{
    unused(repo);   
    return;
}

void repoInit(REPO *repo)
{
    unused(repo);
    return;
}
   
void repoTerm(REPO *repo)
{
    unused(repo);
    return;
}

void repoSetV(REPO *repo, void *vstr)
{
    repo->vstr = vstr;
    return;
}
   
void repoSetOpen(REPO *repo, void (*openFnc)(void *vstr))
{
    repo->openFnc = openFnc;
    return;
}

void repoSetClose(REPO *repo, void (*closeFnc)(void *vstr))
{
    repo->closeFnc = closeFnc;
    return;
}

void repoSetSeek(REPO *repo, void (*seekFnc)(void *vstr, long offset))
{
    repo->seekFnc = seekFnc;
    return;
}

void repoSetRead(REPO *repo, size_t (*readFnc)(void *, char *, size_t))
{
    repo->readFnc = readFnc;
    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™.