fastcgi.pp 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. {$IFNDEF FPC_DOTTEDUNITS}
  2. unit fastcgi;
  3. {$ENDIF FPC_DOTTEDUNITS}
  4. interface
  5. {
  6. Automatically converted by H2Pas 0.99.16 from fastcgi.h
  7. The following command line parameters were used:
  8. fastcgi.h
  9. }
  10. {$IFDEF FPC}
  11. {$PACKRECORDS C}
  12. {$ENDIF}
  13. {
  14. * Listening socket file number
  15. }
  16. const
  17. FCGI_LISTENSOCK_FILENO = 0;
  18. type
  19. PFCGI_Header = ^FCGI_Header;
  20. FCGI_Header = record
  21. version : byte;
  22. reqtype : byte;
  23. // requestIdB1 : byte;
  24. // requestIdB0 : byte;
  25. requestID : word; // Stored as big-endian
  26. //contentLengthB1 : byte;
  27. //contentLengthB0 : byte;
  28. contentLength : word; // Stored as big-endian
  29. paddingLength : byte;
  30. reserved : byte;
  31. end;
  32. {
  33. * Number of bytes in a FCGI_Header. Future versions of the protocol
  34. * will not reduce this number.
  35. }
  36. const
  37. FCGI_HEADER_LEN = 8;
  38. {
  39. * Value for version component of FCGI_Header
  40. }
  41. FCGI_VERSION_1 = 1;
  42. {
  43. * Values for type component of FCGI_Header
  44. }
  45. FCGI_BEGIN_REQUEST = 1;
  46. FCGI_ABORT_REQUEST = 2;
  47. FCGI_END_REQUEST = 3;
  48. FCGI_PARAMS = 4;
  49. FCGI_STDIN = 5;
  50. FCGI_STDOUT = 6;
  51. FCGI_STDERR = 7;
  52. FCGI_DATA = 8;
  53. FCGI_GET_VALUES = 9;
  54. FCGI_GET_VALUES_RESULT = 10;
  55. FCGI_UNKNOWN_TYPE = 11;
  56. FCGI_MAXTYPE = FCGI_UNKNOWN_TYPE;
  57. {
  58. * Value for requestId component of FCGI_Header
  59. }
  60. FCGI_NULL_REQUEST_ID = 0;
  61. type
  62. FCGI_BeginRequestBody = record
  63. //roleB1 : byte;
  64. //roleB0 : byte;
  65. role : word; // Stored as big-endian
  66. flags : byte;
  67. reserved : array[0..4] of byte;
  68. end;
  69. PFCGI_BeginRequestRecord = ^FCGI_BeginRequestRecord;
  70. FCGI_BeginRequestRecord = record
  71. header : FCGI_Header;
  72. body : FCGI_BeginRequestBody;
  73. end;
  74. {
  75. * Mask for flags component of FCGI_BeginRequestBody
  76. }
  77. const
  78. FCGI_KEEP_CONN = 1;
  79. {
  80. * Values for role component of FCGI_BeginRequestBody
  81. }
  82. FCGI_RESPONDER = 1;
  83. FCGI_AUTHORIZER = 2;
  84. FCGI_FILTER = 3;
  85. type
  86. FCGI_EndRequestBody = record
  87. appStatusB3 : byte;
  88. appStatusB2 : byte;
  89. appStatusB1 : byte;
  90. appStatusB0 : byte;
  91. protocolStatus : byte;
  92. reserved : array[0..2] of byte;
  93. end;
  94. FCGI_EndRequestRecord = record
  95. header : FCGI_Header;
  96. body : FCGI_EndRequestBody;
  97. end;
  98. {
  99. * Values for protocolStatus component of FCGI_EndRequestBody
  100. }
  101. const
  102. FCGI_REQUEST_COMPLETE = 0;
  103. FCGI_CANT_MPX_CONN = 1;
  104. FCGI_OVERLOADED = 2;
  105. FCGI_UNKNOWN_ROLE = 3;
  106. {
  107. * Variable names for FCGI_GET_VALUES / FCGI_GET_VALUES_RESULT records
  108. }
  109. FCGI_MAX_CONNS = 'FCGI_MAX_CONNS';
  110. FCGI_MAX_REQS = 'FCGI_MAX_REQS';
  111. FCGI_MPXS_CONNS = 'FCGI_MPXS_CONNS';
  112. type
  113. FCGI_UnknownTypeBody = record
  114. _type : byte;
  115. reserved : array[0..6] of byte;
  116. end;
  117. FCGI_UnknownTypeRecord = record
  118. header : FCGI_Header;
  119. body : FCGI_UnknownTypeBody;
  120. end;
  121. PFCGI_ContentRecord = ^FCGI_ContentRecord;
  122. FCGI_ContentRecord = record
  123. header : FCGI_Header;
  124. ContentData : array[0..1023] of byte;
  125. end;
  126. implementation
  127. end.