• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2025-2025 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #ifndef MOCK_FFRT_API_C_LOOP_H
16 #define MOCK_FFRT_API_C_LOOP_H
17 
18 #include <stdbool.h>
19 #include "type_def.h"
20 #include "queue.h"
21 
22 typedef void *ffrt_loop_t;
ffrt_loop_create(ffrt_queue_t queue)23 inline FFRT_C_API ffrt_loop_t ffrt_loop_create(ffrt_queue_t queue)
24 {
25     return {};
26 }
27 
ffrt_loop_destroy(ffrt_loop_t loop)28 inline FFRT_C_API int ffrt_loop_destroy(ffrt_loop_t loop)
29 {
30     return 0;
31 }
32 
ffrt_loop_run(ffrt_loop_t loop)33 inline FFRT_C_API int ffrt_loop_run(ffrt_loop_t loop)
34 {
35     return 0;
36 }
37 
ffrt_loop_stop(ffrt_loop_t loop)38 inline FFRT_C_API void ffrt_loop_stop(ffrt_loop_t loop)
39 {}
40 
ffrt_loop_epoll_ctl(ffrt_loop_t loop,int op,int fd,uint32_t events,void * data,ffrt_poller_cb cb)41 inline FFRT_C_API int ffrt_loop_epoll_ctl(
42     ffrt_loop_t loop, int op, int fd, uint32_t events, void *data, ffrt_poller_cb cb)
43 {
44     return 0;
45 }
46 
ffrt_loop_timer_start(ffrt_loop_t loop,uint64_t timeout,void * data,ffrt_timer_cb cb,bool repeat)47 inline FFRT_C_API ffrt_timer_t ffrt_loop_timer_start(
48     ffrt_loop_t loop, uint64_t timeout, void *data, ffrt_timer_cb cb, bool repeat)
49 {
50     return {};
51 }
52 
ffrt_loop_timer_stop(ffrt_loop_t loop,ffrt_timer_t handle)53 inline FFRT_C_API int ffrt_loop_timer_stop(ffrt_loop_t loop, ffrt_timer_t handle)
54 {
55     return 0;
56 }
57 
58 #endif