Real Time Open Sound Control librtosc
rtosc-time.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 Johannes Lorenz
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the "Software"),
6  * to deal in the Software without restriction, including without limitation
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8  * and/or sell copies of the Software, and to permit persons to whom the
9  * Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice (including the next
12  * paragraph) shall be included in all copies or substantial portions of the
13  * Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19  * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  * DEALINGS IN THE SOFTWARE.
23  */
24 
25 #ifndef RTOSC_TIME
26 #define RTOSC_TIME
27 
33 #include <stdint.h>
34 #include <time.h>
35 
36 #include <rtosc/rtosc.h>
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 /*
43  * creating arg vals
44  */
45 
46 rtosc_arg_val_t* rtosc_arg_val_from_time_t(rtosc_arg_val_t* dest, time_t time,
47  uint64_t secfracs);
48 rtosc_arg_val_t* rtosc_arg_val_from_params(rtosc_arg_val_t* dest,
49  struct tm *m_tm,
50  uint64_t secfracs);
51 rtosc_arg_val_t* rtosc_arg_val_current_time(rtosc_arg_val_t* dest);
52 rtosc_arg_val_t* rtosc_arg_val_immediatelly(rtosc_arg_val_t* dest);
53 
54 uint64_t rtosc_float2secfracs(float secfracsf);
55 
56 /*
57  * extracting arg vals
58  */
59 
60 time_t rtosct_time_t_from_arg_val(const rtosc_arg_val_t* arg);
61 struct tm *rtosct_params_from_arg_val(const rtosc_arg_val_t* arg);
62 uint64_t rtosct_secfracs_from_arg_val(const rtosc_arg_val_t* arg);
63 bool rtosc_arg_val_is_immediatelly(const rtosc_arg_val_t* arg);
64 
65 float rtosc_secfracs2float(uint64_t secfracs);
66 
67 #ifdef __cplusplus
68 }
69 #endif
70 #endif // RTOSC_TIME
Definition: rtosc.h:86
Functions handling messages and arguments.