aboutsummaryrefslogtreecommitdiff
path: root/src/zjs_modules.h
blob: b49b3afe62156fc99763c210dfadc7627d4723a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright (c) 2016, Intel Corporation.

#ifndef __zjs_modules_h__
#define __zjs_modules_h__

#ifndef ZJS_LINUX_BUILD
#include <zephyr.h>
#endif

#include "jerry-api.h"

#define NUM_SERVICE_ROUTINES 3

/**
 * Service routine function type
 *
 * @param handle        Handle that was registered
 *
 * @return              1 if the routine did any processing
 *                      0 if the routine did not process anything
 *
 * Note: The return value is only used for the auto-exit Linux feature. If
 *       0 is returned (and there are no timers or callbacks) AND auto-exit
 *       is enabled, it will cause the program to exit.
 */
typedef uint8_t (*zjs_service_routine)(void *handle);

void zjs_modules_init();
void zjs_modules_cleanup();
void zjs_register_service_routine(void *handle, zjs_service_routine func);
uint8_t zjs_service_routines(void);

#endif  // __zjs_modules_h__