macros.h 490 B

12345678910111213141516171819202122
  1. /* Macros for simplifying to write subsystem's service functions */
  2. #ifndef _clish_macros_h
  3. #define _clish_macros_h
  4. #include <assert.h>
  5. /* Function to get value from structure by name */
  6. #define _CLISH_GET(obj, type, name) \
  7. type clish_##obj##__get_##name(const clish_##obj##_t *obj)
  8. #define CLISH_GET(obj, type, name) \
  9. _CLISH_GET(obj, type, name) { \
  10. assert(obj); \
  11. return obj->name; \
  12. }
  13. #define CLISH_SET(obj_type, field_type, field_name, value)
  14. #endif // _clish_macros_h