/usr/include/upnp/TemplateInclude.h is in libupnp1.8-dev 1:1.8.2-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 | /*
* C Template objects.
*
* Copyright (C) 2010 Marcelo Roberto Jimenez <mroberto@users.sourceforge.net>
*/
#ifndef TEMPLATEINCLUDE_H
#define TEMPLATEINCLUDE_H
/*!
* \file
*
* \brief Templates for include files of objects.
*
* Usage:
*
* - In the include file Token.h:
* #include "Token_def.h"
* #include "TemplateInclude.h"
*
* - In the source file Token.c:
* #include "Token.h"
* #include "TemplateSource.h"
*
* \author Marcelo Roberto Jimenez
*/
/******************************************************************************/
#define TEMPLATE_PROTOTYPE_COMMON(CLASS) \
TEMPLATE_PROTOTYPE_COMMON_AUX(CLASS)
#define TEMPLATE_PROTOTYPE_COMMON_AUX(CLASS) \
/*!
* DOC_##CLASS
*/ \
typedef struct s_##CLASS CLASS; \
\
/*! Constructor */ \
EXPORT_SPEC CLASS *CLASS##_new(); \
\
/*! Destructor */ \
EXPORT_SPEC void CLASS##_delete(CLASS *p); \
\
/*! Copy Constructor */ \
EXPORT_SPEC CLASS *CLASS##_dup(const CLASS *p); \
\
/*! Assignment operator */ \
EXPORT_SPEC int CLASS##_assign(CLASS *p, const CLASS *q); \
/******************************************************************************/
#define TEMPLATE_PROTOTYPE_INT(CLASS, MEMBER, TYPE) \
TEMPLATE_PROTOTYPE_INT_AUX(CLASS, MEMBER, TYPE)
#define TEMPLATE_PROTOTYPE_INT_AUX(CLASS, MEMBER, TYPE) \
/*! DOC_##CLASS##_##MEMBER */ \
EXPORT_SPEC TYPE CLASS##_get_##MEMBER(const CLASS *p); \
EXPORT_SPEC int CLASS##_set_##MEMBER(CLASS *p, TYPE n); \
/******************************************************************************/
#define TEMPLATE_PROTOTYPE_BUFFER(CLASS, MEMBER, TYPE) \
TEMPLATE_PROTOTYPE_BUFFER_AUX(CLASS, MEMBER, TYPE)
#define TEMPLATE_PROTOTYPE_BUFFER_AUX(CLASS, MEMBER, TYPE) \
/*! DOC_##CLASS_##MEMBER */ \
EXPORT_SPEC const TYPE *CLASS##_get_##MEMBER(const CLASS *p); \
EXPORT_SPEC int CLASS##_set_##MEMBER(CLASS *p, const TYPE *buf); \
EXPORT_SPEC void CLASS##_clear_##MEMBER(CLASS *p); \
/******************************************************************************/
#define TEMPLATE_PROTOTYPE_LIST(CLASS, MEMBER) \
TEMPLATE_PROTOTYPE_LIST_AUX(CLASS, MEMBER)
#define TEMPLATE_PROTOTYPE_LIST_AUX(CLASS, MEMBER) \
/*! DOC_##CLASS_##MEMBER */ \
EXPORT_SPEC const struct list_head *CLASS##_get_##MEMBER(const CLASS *p); \
EXPORT_SPEC void CLASS##_add_to_list_##MEMBER(CLASS *p, struct list_head *head); \
EXPORT_SPEC void CLASS##_remove_from_list_##MEMBER(CLASS *p); \
EXPORT_SPEC void CLASS##_replace_in_list_##MEMBER(CLASS *p, struct list_head *new); \
/******************************************************************************/
#define TEMPLATE_PROTOTYPE_OBJECT(CLASS, MEMBER, TYPE) \
TEMPLATE_PROTOTYPE_OBJECT_AUX(CLASS, MEMBER, TYPE)
#define TEMPLATE_PROTOTYPE_OBJECT_AUX(CLASS, MEMBER, TYPE) \
/*! DOC_##CLASS##_##MEMBER */ \
EXPORT_SPEC const TYPE *CLASS##_get_##MEMBER(const CLASS *p); \
EXPORT_SPEC int CLASS##_set_##MEMBER(CLASS *p, const TYPE *n); \
/******************************************************************************/
#define TEMPLATE_PROTOTYPE_STRING(CLASS, MEMBER) \
TEMPLATE_PROTOTYPE_STRING_AUX(CLASS, MEMBER)
#define TEMPLATE_PROTOTYPE_STRING_AUX(CLASS, MEMBER) \
/*! DOC_##CLASS##_##MEMBER */ \
EXPORT_SPEC const UpnpString *CLASS##_get_##MEMBER(const CLASS *p); \
EXPORT_SPEC int CLASS##_set_##MEMBER(CLASS *p, const UpnpString *s); \
EXPORT_SPEC size_t CLASS##_get_##MEMBER##_Length(const CLASS *p); \
EXPORT_SPEC const char *CLASS##_get_##MEMBER##_cstr(const CLASS *p); \
EXPORT_SPEC int CLASS##_strcpy_##MEMBER(CLASS *p, const char *s); \
EXPORT_SPEC int CLASS##_strncpy_##MEMBER(CLASS *p, const char *s, size_t n); \
EXPORT_SPEC void CLASS##_clear_##MEMBER(CLASS *p); \
/******************************************************************************/
#define TEMPLATE_PROTOTYPE_DOMSTRING(CLASS, MEMBER) \
TEMPLATE_PROTOTYPE_DOMSTRING_AUX(CLASS, MEMBER)
#define TEMPLATE_PROTOTYPE_DOMSTRING_AUX(CLASS, MEMBER) \
/*! DOC_##CLASS_##MEMBER */ \
EXPORT_SPEC const DOMString CLASS##_get_##MEMBER(const CLASS *p); \
EXPORT_SPEC int CLASS##_set_##MEMBER(CLASS *p, const DOMString s); \
EXPORT_SPEC const char *CLASS##_get_##MEMBER##_cstr(const CLASS *p); \
#endif /* TEMPLATEINCLUDE_H */
/******************************************************************************
*
* Actual source starts here.
*
******************************************************************************/
#include <stdlib.h> /* for size_t */
#include "ixml.h" /* for DOMString, IXML_Document */
#include "list.h" /* for struct list_head */
#include "UpnpGlobal.h" /* for EXPORT_SPEC */
#include "UpnpString.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
TEMPLATE_PROTOTYPE_COMMON(CLASS)
#define EXPAND_CLASS_MEMBER_INT(CLASS, MEMBER, TYPE) TEMPLATE_PROTOTYPE_INT(CLASS, MEMBER, TYPE)
#define EXPAND_CLASS_MEMBER_BUFFER(CLASS, MEMBER, TYPE) TEMPLATE_PROTOTYPE_BUFFER(CLASS, MEMBER, TYPE)
#define EXPAND_CLASS_MEMBER_LIST(CLASS, MEMBER) TEMPLATE_PROTOTYPE_LIST(CLASS, MEMBER)
#define EXPAND_CLASS_MEMBER_OBJECT(CLASS, MEMBER, TYPE) TEMPLATE_PROTOTYPE_OBJECT(CLASS, MEMBER, TYPE)
#define EXPAND_CLASS_MEMBER_STRING(CLASS, MEMBER) TEMPLATE_PROTOTYPE_STRING(CLASS, MEMBER)
#define EXPAND_CLASS_MEMBER_DOMSTRING(CLASS, MEMBER) TEMPLATE_PROTOTYPE_DOMSTRING(CLASS, MEMBER)
EXPAND_CLASS_MEMBERS(CLASS)
#include "TemplateUndef.h"
#ifdef __cplusplus
}
#endif /* __cplusplus */
#ifdef TEMPLATE_GENERATE_SOURCE
#include "TemplateSource.h"
#endif /* TEMPLATE_GENERATE_SOURCE */
/* Cleanup the template mess. */
#undef PREFIX
#undef CLASS
#undef EXPAND_CLASS_MEMBERS
|