@@ -5,10 +5,13 @@ use core::ffi::CStr;
55use  core:: ffi:: c_char; 
66
77/** HTTP **/ 
8+ #[ allow( dead_code) ]  
89pub  static  REQ :   u8  = 0 ; 
10+ #[ allow( dead_code) ]  
911pub  static  RESP :  u8  = 1 ; 
1012
1113#[ inline]  
14+ #[ allow( dead_code) ]  
1215pub  fn  log ( field :  & str )  -> i32 
1316{ 
1417	let  mut  result = 0x7F000 ; 
@@ -23,6 +26,7 @@ pub fn log(field: &str) -> i32
2326} 
2427
2528#[ inline]  
29+ #[ allow( dead_code) ]  
2630pub  fn  append ( hp :  u8 ,  field :  & str )  -> i32 
2731{ 
2832	let  mut  result = 0x10020 ; 
@@ -38,6 +42,7 @@ pub fn append(hp: u8, field: &str) -> i32
3842} 
3943
4044#[ inline]  
45+ #[ allow( dead_code) ]  
4146pub  fn  set_cacheable ( cached :  bool ,  ttl :  f32 ,  grace :  f32 ,  keep :  f32 ) 
4247{ 
4348	unsafe  { 
@@ -52,6 +57,7 @@ pub fn set_cacheable(cached: bool, ttl: f32, grace: f32, keep: f32)
5257} 
5358
5459#[ inline]  
60+ #[ allow( dead_code) ]  
5561pub  fn  backend_response ( status :  u16 ,  ctype :  & str ,  data :  & [ u8 ] ) 
5662{ 
5763	unsafe  { 
@@ -61,12 +67,46 @@ pub fn backend_response(status: u16, ctype: &str, data: &[u8])
6167			in( "rsi" )  ctype. as_ptr( ) , 
6268			in( "rdx" )  ctype. len( ) , 
6369			in( "rcx" )  data. as_ptr( ) , 
64- 			in( "r8" )   data. len( ) 
70+ 			in( "r8" )   data. len( ) , 
71+ 			in( "r9" )   0  // Extra data 
72+ 		) ; 
73+ 	} 
74+ } 
75+ 
76+ #[ allow( dead_code) ]  
77+ pub  struct  ResponseHeader  { 
78+ 	pub  data :  * const  u8 , 
79+ 	pub  len :  usize , 
80+ } 
81+ #[ allow( dead_code) ]  
82+ pub  struct  ExtraResponseData  { 
83+ 	pub  headers :  * const  ResponseHeader , 
84+ 	pub  num_headers :  usize , 
85+ 	pub  cached :  bool , 
86+ 	pub  ttl :  f32 , 
87+ 	pub  grace :  f32 , 
88+ 	pub  keep :  f32 , 
89+ } 
90+ 
91+ #[ inline]  
92+ #[ allow( dead_code) ]  
93+ pub  fn  backend_response_full ( status :  u16 ,  ctype :  & str ,  data :  & [ u8 ] ,  extra :  & ExtraResponseData ) 
94+ { 
95+ 	unsafe  { 
96+ 		asm ! ( "out 0x0, eax" , 
97+ 			in( "eax" )  0x10010 , 
98+ 			in( "rdi" )  status, 
99+ 			in( "rsi" )  ctype. as_ptr( ) , 
100+ 			in( "rdx" )  ctype. len( ) , 
101+ 			in( "rcx" )  data. as_ptr( ) , 
102+ 			in( "r8" )   data. len( ) , 
103+ 			in( "r9" )   extra as  * const  ExtraResponseData 
65104		) ; 
66105	} 
67106} 
68107
69108#[ inline]  
109+ #[ allow( dead_code) ]  
70110pub  fn  backend_response_str ( status :  u16 ,  ctype :  & str ,  data :  & str ) 
71111{ 
72112	backend_response ( status,  ctype,  data. as_bytes ( ) ) ; 
@@ -135,6 +175,7 @@ pub fn set_backend_post(cb: PostHandler)
135175} 
136176
137177#[ inline]  
178+ #[ allow( dead_code) ]  
138179pub  fn  wait_for_requests ( )  -> !
139180{ 
140181	unsafe  { 
@@ -159,6 +200,7 @@ struct backend_request {
159200	size_t         content_len; 
160201}; 
161202*/ 
203+ #[ allow( dead_code) ]  
162204pub  struct  Request  { 
163205	pub  method :  * const  c_char , 
164206	pub  url :  * const  c_char , 
@@ -173,24 +215,30 @@ pub struct Request {
173215} 
174216
175217impl  Request  { 
218+ 	#[ allow( dead_code) ]  
176219	pub  fn  method ( & self )  -> & str  { 
177220		unsafe  {  CStr :: from_ptr ( self . method ) . to_str ( ) . unwrap ( )  } 
178221	} 
222+ 	#[ allow( dead_code) ]  
179223	pub  fn  url ( & self )  -> & str  { 
180224		unsafe  {  CStr :: from_ptr ( self . url ) . to_str ( ) . unwrap ( )  } 
181225	} 
226+ 	#[ allow( dead_code) ]  
182227	pub  fn  arg ( & self )  -> & str  { 
183228		unsafe  {  CStr :: from_ptr ( self . arg ) . to_str ( ) . unwrap ( )  } 
184229	} 
230+ 	#[ allow( dead_code) ]  
185231	pub  fn  content_type ( & self )  -> & str  { 
186232		unsafe  {  CStr :: from_ptr ( self . content_type ) . to_str ( ) . unwrap ( )  } 
187233	} 
234+ 	#[ allow( dead_code) ]  
188235	pub  fn  content ( & self )  -> & [ u8 ]  { 
189236		unsafe  {  std:: slice:: from_raw_parts ( self . content ,  self . content_len )  } 
190237	} 
191238} 
192239
193240#[ inline]  
241+ #[ allow( dead_code) ]  
194242pub  fn  wait_for_requests_paused ( )  -> Request 
195243{ 
196244	unsafe  { 
@@ -206,6 +254,7 @@ pub fn wait_for_requests_paused() -> Request
206254/** Debugging and introspection **/ 
207255
208256#[ inline]  
257+ #[ allow( dead_code) ]  
209258pub  fn  breakpoint ( ) 
210259{ 
211260	unsafe  { 
0 commit comments