• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *
3  * Copyright 2016 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 /* This file has empty implementation of all the functions exposed by the cronet
20 library, so we can build it in all environments */
21 
22 #include <grpc/support/port_platform.h>
23 
24 #include <stdbool.h>
25 
26 #include <grpc/support/log.h>
27 
28 #include "third_party/objective_c/Cronet/bidirectional_stream_c.h"
29 
30 #ifdef GRPC_COMPILE_WITH_CRONET
31 /* link with the real CRONET library in the build system */
32 #else
33 /* Dummy implementation of cronet API just to test for build-ability */
bidirectional_stream_create(stream_engine * engine,void * annotation,bidirectional_stream_callback * callback)34 bidirectional_stream* bidirectional_stream_create(
35     stream_engine* engine, void* annotation,
36     bidirectional_stream_callback* callback) {
37   GPR_ASSERT(0);
38   return nullptr;
39 }
40 
bidirectional_stream_destroy(bidirectional_stream * stream)41 int bidirectional_stream_destroy(bidirectional_stream* stream) {
42   GPR_ASSERT(0);
43   return 0;
44 }
45 
bidirectional_stream_start(bidirectional_stream * stream,const char * url,int priority,const char * method,const bidirectional_stream_header_array * headers,bool end_of_stream)46 int bidirectional_stream_start(bidirectional_stream* stream, const char* url,
47                                int priority, const char* method,
48                                const bidirectional_stream_header_array* headers,
49                                bool end_of_stream) {
50   GPR_ASSERT(0);
51   return 0;
52 }
53 
bidirectional_stream_read(bidirectional_stream * stream,char * buffer,int capacity)54 int bidirectional_stream_read(bidirectional_stream* stream, char* buffer,
55                               int capacity) {
56   GPR_ASSERT(0);
57   return 0;
58 }
59 
bidirectional_stream_write(bidirectional_stream * stream,const char * buffer,int count,bool end_of_stream)60 int bidirectional_stream_write(bidirectional_stream* stream, const char* buffer,
61                                int count, bool end_of_stream) {
62   GPR_ASSERT(0);
63   return 0;
64 }
65 
bidirectional_stream_cancel(bidirectional_stream * stream)66 void bidirectional_stream_cancel(bidirectional_stream* stream) {
67   GPR_ASSERT(0);
68 }
69 
bidirectional_stream_disable_auto_flush(bidirectional_stream * stream,bool disable_auto_flush)70 void bidirectional_stream_disable_auto_flush(bidirectional_stream* stream,
71                                              bool disable_auto_flush) {
72   GPR_ASSERT(0);
73 }
74 
bidirectional_stream_delay_request_headers_until_flush(bidirectional_stream * stream,bool delay_headers_until_flush)75 void bidirectional_stream_delay_request_headers_until_flush(
76     bidirectional_stream* stream, bool delay_headers_until_flush) {
77   GPR_ASSERT(0);
78 }
79 
bidirectional_stream_flush(bidirectional_stream * stream)80 void bidirectional_stream_flush(bidirectional_stream* stream) { GPR_ASSERT(0); }
81 
82 #endif /* GRPC_COMPILE_WITH_CRONET */
83