1 /********************************************************************/ 2 /* */ 3 /* pol_drv.h Prototypes of functions to support poll. */ 4 /* Copyright (C) 1989 - 2011 Thomas Mertes */ 5 /* */ 6 /* This file is part of the Seed7 Runtime Library. */ 7 /* */ 8 /* The Seed7 Runtime Library is free software; you can */ 9 /* redistribute it and/or modify it under the terms of the GNU */ 10 /* Lesser General Public License as published by the Free Software */ 11 /* Foundation; either version 2.1 of the License, or (at your */ 12 /* option) any later version. */ 13 /* */ 14 /* The Seed7 Runtime Library is distributed in the hope that it */ 15 /* will be useful, but WITHOUT ANY WARRANTY; without even the */ 16 /* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR */ 17 /* PURPOSE. See the GNU Lesser General Public License for more */ 18 /* details. */ 19 /* */ 20 /* You should have received a copy of the GNU Lesser General */ 21 /* Public License along with this program; if not, write to the */ 22 /* Free Software Foundation, Inc., 51 Franklin Street, */ 23 /* Fifth Floor, Boston, MA 02110-1301, USA. */ 24 /* */ 25 /* Module: Seed7 Runtime Library */ 26 /* File: seed7/src/pol_drv.h */ 27 /* Changes: 2011 Thomas Mertes */ 28 /* Content: Prototypes of functions to support poll. */ 29 /* */ 30 /********************************************************************/ 31 32 #define POLL_NOTHING 0 33 #define POLL_IN 1 34 #define POLL_OUT 2 35 #define POLL_INOUT 3 36 37 typedef struct { 38 createFuncType incrUsageCount; 39 destrFuncType decrUsageCount; 40 } fileObjectOpType; 41 42 #ifdef DO_INIT 43 fileObjectOpType fileObjectOps = {NULL, NULL}; 44 #else 45 EXTERN fileObjectOpType fileObjectOps; 46 #endif 47 48 49 void initPollOperations (const createFuncType incrUsageCount, 50 const destrFuncType decrUsageCount); 51 void polAddCheck (const pollType pollData, const socketType aSocket, 52 intType eventsToCheck, const genericType fileObj); 53 void polClear (const pollType pollData); 54 void polCpy (const pollType dest, const const_pollType source); 55 pollType polCreate (const const_pollType source); 56 void polDestr (const pollType oldPollData); 57 pollType polEmpty (void); 58 intType polGetCheck (const const_pollType pollData, const socketType aSocket); 59 intType polGetFinding (const const_pollType pollData, const socketType aSocket); 60 boolType polHasNext (const pollType pollData); 61 void polIterChecks (const pollType pollData, intType pollMode); 62 void polIterFindings (const pollType pollData, intType pollMode); 63 genericType polNextFile (const pollType pollData, const genericType nullFile); 64 void polPoll (const pollType pollData); 65 void polRemoveCheck (const pollType pollData, const socketType aSocket, 66 intType eventsToCheck); 67