Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Piatok, 29. marec 2024

Súbor: [Platon] / ep / src / fd.h (stiahnutie)

Revízia 1.12, Fri Nov 28 17:35:11 2003 UTC (20 years, 4 months ago) by nepto


Zmeny od 1.11: +3 -3 [lines]

Changed URL from www.platon.sk to platon.sk.

/*
 * ep - extended pipelining
 *
 * fd.h - filedescriptor structure header file
 * ____________________________________________________________
 *
 * Developed by Ondrej Jombik <nepto@platon.sk>
 *          and Lubomir Host <rajo@platon.sk>
 * Copyright (c) 2000-2003 Platon SDG, http://platon.sk/
 * All rights reserved.
 *
 * See README file for more information about this software.
 * See COPYING file for license information.
 *
 * Download the latest version from
 * http://platon.sk/projects/ep/
 */

/* $Platon: ep/src/fd.h,v 1.11 2003/05/03 09:58:19 nepto Exp $ */

#ifndef _FD_H
#define _FD_H

#include "proclink.h"

#define N_FD            3

#define FD_IN           0
#define FD_OUT          1
#define FD_ERR          2
#define INVALID_FD        0xffff

#define N_FD_STR    (4)


struct fd
{
    /* ID */
    /* int id; */

    /* Number of links. */
    int n_link;

    /* Dynamic array of links with size n_link. */
    struct proclink *link;

    /* Link's pipe. */
    int pipe[2];

};

/* Returns the fd str of fd id. */
char *fd_id_to_fd_str(int id);

/* Returns the fd id of string fd str. */
int fd_str_to_fd_id(char *str);

/* Add link to fd..                            */
/* Return 1 if OK, 0 for errors.            */
int fd_add_proclink(
        struct fd *fd,
        const struct proclink *link);

/* Remove link from fd.                            */
/* Return 1 if OK, 0 for errors.                */
int fd_remove_proclink(
        struct fd *fd,
        const struct proclink *link);

int fd_remove_proclink2(
        struct fd *fd,
        int link_proc_id,
        int link_fd_id);

int fd_remove_proclink_by_index(
        struct fd *fd,
        const int index);

/* Check existence of link in process according to fd_no. */
/* Return index + 1 of link if link exists, 0 if not.    */
int fd_is_proclink(
        struct fd *fd,
        const struct proclink *link);

int fd_is_proclink2(
        struct fd *fd,
        int link_proc_id,
        int link_fd_id);

#endif /* #ifndef _FD_H */


Platon Group <platon@platon.sk> http://platon.sk/
Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok