fastcgi.pp 3.0 KB

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