#ifndef  OPENTRANSPORTPROTOCOL_H
#define OPENTRANSPORTPROTOCOL_H

#ifndef CONDITIONALMACROS_H
#include <CarbonCore/ConditionalMacros.h>
#endif


#if CALL_NOT_IN_CARBON
#ifndef FILES_H
#include <CarbonCore/Files.h>
#endif

#ifndef CODEFRAGMENTS_H
#include <CarbonCore/CodeFragments.h>
#endif

#endif 

#ifndef OPENTRANSPORT_H
#include <OSServices/OpenTransport.h>
#endif


#ifdef __cplusplus
#include <stddef.h>
#endif

#include <AvailabilityMacros.h>
//#include <HYS/OSServices/OpenTransportProtocol.h>
#include <APPLE/OSServices/OpenTransportProtocol.h>
#if PRAGMA_ONCE
#pragma once
#endif

#ifdef __cplusplus
extern "C" {
#endif



/*OTTimerTask


typedef  long  OTTimerTask;
Availability
Available in Mac OS X v10.0 and later.*/
typedef  long  OTTimerTask;

/*I_NREAD


enum {
   I_NREAD = ((MIOC_STREAMIO << 8) | 1),
   I_PUSH = ((MIOC_STREAMIO << 8) | 2),
   I_POP = ((MIOC_STREAMIO << 8) | 3),
   I_LOOK = ((MIOC_STREAMIO << 8) | 4),
   I_FLUSH = ((MIOC_STREAMIO << 8) | 5),
   I_SRDOPT = ((MIOC_STREAMIO << 8) | 6),
   I_GRDOPT = ((MIOC_STREAMIO << 8) | 7),
   I_STR = ((MIOC_STREAMIO << 8) | 8),
   I_SETSIG = ((MIOC_STREAMIO << 8) | 9),
   I_GETSIG = ((MIOC_STREAMIO << 8) | 10),
   I_FIND = ((MIOC_STREAMIO << 8) | 11),
   I_LINK = ((MIOC_STREAMIO << 8) | 12),
   I_UNLINK = ((MIOC_STREAMIO << 8) | 13),
   I_PEEK = ((MIOC_STREAMIO << 8) | 15),
   I_FDINSERT = ((MIOC_STREAMIO << 8) | 16),
   I_SENDFD = ((MIOC_STREAMIO << 8) | 17),
   I_RECVFD = ((MIOC_STREAMIO << 8) | 18),
   I_FLUSHBAND = ((MIOC_STREAMIO << 8) | 19),
   I_SWROPT = ((MIOC_STREAMIO << 8) | 20),
   I_GWROPT = ((MIOC_STREAMIO << 8) | 21),
   I_LIST = ((MIOC_STREAMIO << 8) | 22),
   I_ATMARK = ((MIOC_STREAMIO << 8) | 23),
   I_CKBAND = ((MIOC_STREAMIO << 8) | 24),
   I_GETBAND = ((MIOC_STREAMIO << 8) | 25),
   I_CANPUT = ((MIOC_STREAMIO << 8) | 26),
   I_SETCLTIME = ((MIOC_STREAMIO << 8) | 27),
   I_GETCLTIME = ((MIOC_STREAMIO << 8) | 28),
   I_PLINK = ((MIOC_STREAMIO << 8) | 29),
   I_PUNLINK = ((MIOC_STREAMIO << 8) | 30),
   I_GETMSG = ((MIOC_STREAMIO << 8) | 40),
   I_PUTMSG = ((MIOC_STREAMIO << 8) | 41),
   I_POLL = ((MIOC_STREAMIO << 8) | 42),
   I_SETDELAY = ((MIOC_STREAMIO << 8) | 43),
   I_GETDELAY = ((MIOC_STREAMIO << 8) | 44),
   I_RUN_QUEUES = ((MIOC_STREAMIO << 8) | 45),
   I_GETPMSG = ((MIOC_STREAMIO << 8) | 46),
   I_PUTPMSG = ((MIOC_STREAMIO << 8) | 47),
   I_AUTOPUSH = ((MIOC_STREAMIO << 8) | 48),
   I_PIPE = ((MIOC_STREAMIO << 8) | 49),
   I_HEAP_REPORT = ((MIOC_STREAMIO << 8) | 50),
   I_FIFO = ((MIOC_STREAMIO << 8) | 51)
};
Constants
I_NREAD

Available in Mac OS X v10.0 and later.
I_PUSH

Available in Mac OS X v10.0 and later.
I_POP

Available in Mac OS X v10.0 and later.
I_LOOK

Available in Mac OS X v10.0 and later.
I_FLUSH

Available in Mac OS X v10.0 and later.
I_SRDOPT

Available in Mac OS X v10.0 and later.
I_GRDOPT

Available in Mac OS X v10.0 and later.
I_STR

Available in Mac OS X v10.0 and later.
I_SETSIG

Available in Mac OS X v10.0 and later.
I_GETSIG

Available in Mac OS X v10.0 and later.
I_FIND

Available in Mac OS X v10.0 and later.
I_LINK

Available in Mac OS X v10.0 and later.
I_UNLINK

Available in Mac OS X v10.0 and later.
I_PEEK

Available in Mac OS X v10.0 and later.
I_FDINSERT

Available in Mac OS X v10.0 and later.
I_SENDFD

Available in Mac OS X v10.0 and later.
I_RECVFD

Available in Mac OS X v10.0 and later.
I_FLUSHBAND

Available in Mac OS X v10.0 and later.
I_SWROPT

Available in Mac OS X v10.0 and later.
I_GWROPT

Available in Mac OS X v10.0 and later.
I_LIST

Available in Mac OS X v10.0 and later.
I_ATMARK

Available in Mac OS X v10.0 and later.
I_CKBAND

Available in Mac OS X v10.0 and later.
I_GETBAND

Available in Mac OS X v10.0 and later.
I_CANPUT

Available in Mac OS X v10.0 and later.
I_SETCLTIME

Available in Mac OS X v10.0 and later.
I_GETCLTIME

Available in Mac OS X v10.0 and later.
I_PLINK

Available in Mac OS X v10.0 and later.
I_PUNLINK

Available in Mac OS X v10.0 and later.
I_GETMSG

Available in Mac OS X v10.0 and later.
I_PUTMSG

Available in Mac OS X v10.0 and later.
I_POLL

Available in Mac OS X v10.0 and later.
I_SETDELAY

Available in Mac OS X v10.0 and later.
I_GETDELAY

Available in Mac OS X v10.0 and later.
I_RUN_QUEUES

Available in Mac OS X v10.0 and later.
I_GETPMSG

Available in Mac OS X v10.0 and later.
I_PUTPMSG

Available in Mac OS X v10.0 and later.
I_AUTOPUSH

Available in Mac OS X v10.0 and later.
I_PIPE

Available in Mac OS X v10.0 and later.
I_HEAP_REPORT

Available in Mac OS X v10.0 and later.
I_FIFO

Available in Mac OS X v10.0 and later.*/
enum {
   I_NREAD = ((MIOC_STREAMIO << 8) | 1),
   I_PUSH = ((MIOC_STREAMIO << 8) | 2),
   I_POP = ((MIOC_STREAMIO << 8) | 3),
   I_LOOK = ((MIOC_STREAMIO << 8) | 4),
   I_FLUSH = ((MIOC_STREAMIO << 8) | 5),
   I_SRDOPT = ((MIOC_STREAMIO << 8) | 6),
   I_GRDOPT = ((MIOC_STREAMIO << 8) | 7),
   I_STR = ((MIOC_STREAMIO << 8) | 8),
   I_SETSIG = ((MIOC_STREAMIO << 8) | 9),
   I_GETSIG = ((MIOC_STREAMIO << 8) | 10),
   I_FIND = ((MIOC_STREAMIO << 8) | 11),
   I_LINK = ((MIOC_STREAMIO << 8) | 12),
   I_UNLINK = ((MIOC_STREAMIO << 8) | 13),
   I_PEEK = ((MIOC_STREAMIO << 8) | 15),
   I_FDINSERT = ((MIOC_STREAMIO << 8) | 16),
   I_SENDFD = ((MIOC_STREAMIO << 8) | 17),
   I_RECVFD = ((MIOC_STREAMIO << 8) | 18),
   I_FLUSHBAND = ((MIOC_STREAMIO << 8) | 19),
   I_SWROPT = ((MIOC_STREAMIO << 8) | 20),
   I_GWROPT = ((MIOC_STREAMIO << 8) | 21),
   I_LIST = ((MIOC_STREAMIO << 8) | 22),
   I_ATMARK = ((MIOC_STREAMIO << 8) | 23),
   I_CKBAND = ((MIOC_STREAMIO << 8) | 24),
   I_GETBAND = ((MIOC_STREAMIO << 8) | 25),
   I_CANPUT = ((MIOC_STREAMIO << 8) | 26),
   I_SETCLTIME = ((MIOC_STREAMIO << 8) | 27),
   I_GETCLTIME = ((MIOC_STREAMIO << 8) | 28),
   I_PLINK = ((MIOC_STREAMIO << 8) | 29),
   I_PUNLINK = ((MIOC_STREAMIO << 8) | 30),
   I_GETMSG = ((MIOC_STREAMIO << 8) | 40),
   I_PUTMSG = ((MIOC_STREAMIO << 8) | 41),
   I_POLL = ((MIOC_STREAMIO << 8) | 42),
   I_SETDELAY = ((MIOC_STREAMIO << 8) | 43),
   I_GETDELAY = ((MIOC_STREAMIO << 8) | 44),
   I_RUN_QUEUES = ((MIOC_STREAMIO << 8) | 45),
   I_GETPMSG = ((MIOC_STREAMIO << 8) | 46),
   I_PUTPMSG = ((MIOC_STREAMIO << 8) | 47),
   I_AUTOPUSH = ((MIOC_STREAMIO << 8) | 48),
   I_PIPE = ((MIOC_STREAMIO << 8) | 49),
   I_HEAP_REPORT = ((MIOC_STREAMIO << 8) | 50),
   I_FIFO = ((MIOC_STREAMIO << 8) | 51)
};

/*FLUSHR


enum {
   FLUSHR = 0x01,
   FLUSHW = 0x02,
   FLUSHRW = (FLUSHW | FLUSHR)
};
Constants
FLUSHR

Available in Mac OS X v10.0 and later.
FLUSHW

Available in Mac OS X v10.0 and later.
FLUSHRW

Available in Mac OS X v10.0 and later.*/
enum {
   FLUSHR = 0x01,
   FLUSHW = 0x02,
   FLUSHRW = (FLUSHW | FLUSHR)
};


//function

/*OTBufferDataSize

Obtains the size of the no-copy receive buffer. (Deprecated in Mac OS X v10.4.)

OTByteCount OTBufferDataSize (
   OTBuffer * buffer
);
Parameters
buffer
Return Value

See the description of the OTByteCount data type.
Availability
Available in CarbonLib 1.0 and later when OpenTransport 1.0 or later is present.
Available in Mac OS X 10.0 and later.
Deprecated in Mac OS X v10.4.
Declared In
OpenTransportProtocol.h*/
OTByteCount OTBufferDataSize (
   OTBuffer * buffer
);

/*OTReleaseBuffer

Returns the no-copy receive buffer to the system. (Deprecated in Mac OS X v10.4.)

void OTReleaseBuffer (
   OTBuffer * buffer
);
Parameters
buffer
Availability
Available in CarbonLib 1.0 and later when OpenTransport 1.0 or later is present.
Available in Mac OS X 10.0 and later.
Deprecated in Mac OS X v10.4.
Declared In
OpenTransportProtocol.h*/
void OTReleaseBuffer (
   OTBuffer * buffer
);

/*OTReadBuffer

Copies data out of a no-copy receive buffer. (Deprecated in Mac OS X v10.4.)

Boolean OTReadBuffer (
   OTBufferInfo * buffer,
   void * dest,
   OTByteCount * len
);
Parameters
buffer
dest
len
Availability
Available in CarbonLib 1.0 and later when OpenTransport 1.0 or later is present.
Available in Mac OS X 10.0 and later.
Deprecated in Mac OS X v10.4.
Declared In
OpenTransportProtocol.h*/
Boolean OTReadBuffer (
   OTBufferInfo * buffer,
   void * dest,
   OTByteCount * len
);

/*OTDestroyTimerTask

Disposes of a timer task. (Deprecated in Mac OS X v10.4.)

void OTDestroyTimerTask (
   OTTimerTask timerTask
);
Parameters
timerTask
Availability
Available in CarbonLib 1.0 and later.
Available in Mac OS X 10.0 and later.
Deprecated in Mac OS X v10.4.
Declared In
OpenTransportProtocol.h*/

void OTDestroyTimerTask (
   OTTimerTask timerTask
);

/*OTCancelTimerTask

Cancels a task that was already scheduled for execution. (Deprecated in Mac OS X v10.4.)

Boolean OTCancelTimerTask (
   OTTimerTask timerTask
);
Parameters
timerTask
Availability
Available in CarbonLib 1.0 and later.
Available in Mac OS X 10.0 and later.
Deprecated in Mac OS X v10.4.
Declared In
OpenTransportProtocol.h*/
Boolean OTCancelTimerTask (
   OTTimerTask timerTask
);

/*OTScheduleTimerTask

Schedules a timer task to be executed at the specified time. (Deprecated in Mac OS X v10.4.)

Boolean OTScheduleTimerTask (
   OTTimerTask timerTask,
   OTTimeout milliSeconds
);
Parameters
timerTask
milliSeconds
Availability
Available in CarbonLib 1.0 and later.
Available in Mac OS X 10.0 and later.
Deprecated in Mac OS X v10.4.
Declared In
OpenTransportProtocol.h*/

Boolean OTScheduleTimerTask (
   OTTimerTask timerTask,
   OTTimeout milliSeconds
);

/*OTCreateTimerTask
Creates a task to be scheduled.

C INTERFACE
pascal long OTCreateTimerTask(OTProcessProcPtr proc, void* arg);
C++ INTERFACES 
None. C++ applications use the C interface to this function.

PARAMETERS
proc 
A procedure pointer referencing the task to be created. 
arg 
A pointer to a user-defined value to be passed to the task when it executes. 
function result 
A 32-bit value identifying the task that was created. You must pass this value for the timerTask parameter of the OTScheduleTimerTask function. 
DISCUSSION
The OTCreateTimerTask function creates a task that you can schedule later with the function OTScheduleTimerTask.

SEE ALSO
The OTScheduleTimerTask function.

The OTCancelTimerTask function.

The OTDestroyTimerTask function.*/
pascal long OTCreateTimerTask(OTProcessProcPtr proc, void* arg);

#ifdef __cplusplus
}
#endif
#endif