Lines Matching defs:iep

40 #define	FMEV_API_ENTER(iep, v) \
41 fmev_api_enter(fmev_shdl_cmn(((iep)->ei_hdl)), LIBFMEVENT_VERSION_##v)
52 #define IMPL2FMEV(iep) ((fmev_t)(iep))
56 #define EVENT_VALID(iep) ((iep)->ei_magic == _FMEVMAGIC && \
57 (iep)->ei_refcnt > 0 && fmev_shdl_valid((iep)->ei_hdl))
71 fmev_impl_t *iep;
75 if ((iep = fmev_shdl_alloc(hdl, sizeof (*iep))) == NULL)
82 if (sysevent_get_attr_list(sep, &iep->ei_nvl) != 0) {
83 fmev_shdl_free(hdl, iep, sizeof (*iep));
88 *nvlp = iep->ei_nvl;
90 if (nvlist_lookup_string(iep->ei_nvl, FM_CLASS, clsp) != 0) {
91 nvlist_free(iep->ei_nvl);
92 fmev_shdl_free(hdl, iep, sizeof (*iep));
97 if (nvlist_lookup_uint64_array(iep->ei_nvl, "__tod", &tod,
99 nvlist_free(iep->ei_nvl);
100 fmev_shdl_free(hdl, iep, sizeof (*iep));
105 iep->ei_fmtime[FM_TIME_SEC] = tod[0];
106 iep->ei_fmtime[FM_TIME_NSEC] = tod[1];
111 (void) nvlist_remove_all(iep->ei_nvl, "__tod");
112 (void) nvlist_remove_all(iep->ei_nvl, "__ttl");
114 iep->ei_magic = _FMEVMAGIC;
115 iep->ei_hdl = hdl;
116 iep->ei_refcnt = 1;
117 ASSERT(EVENT_VALID(iep));
119 return (IMPL2FMEV(iep));
123 fmev_free(fmev_impl_t *iep)
125 ASSERT(iep->ei_refcnt == 0);
127 nvlist_free(iep->ei_nvl);
128 fmev_shdl_free(iep->ei_hdl, iep, sizeof (*iep));
134 fmev_impl_t *iep = FMEV2IMPL(ev);
136 ASSERT(EVENT_VALID(iep));
138 (void) FMEV_API_ENTER(iep, 1);
140 atomic_inc_32(&iep->ei_refcnt);
146 fmev_impl_t *iep = FMEV2IMPL(ev);
148 ASSERT(EVENT_VALID(iep));
150 (void) FMEV_API_ENTER(iep, 1);
152 if (atomic_dec_32_nv(&iep->ei_refcnt) == 0)
153 fmev_free(iep);
159 fmev_impl_t *iep = FMEV2IMPL(ev);
162 ASSERT(EVENT_VALID(iep));
164 if (!FMEV_API_ENTER(iep, 1))
172 if ((cp = fmev_shdl_alloc(iep->ei_hdl, sizeof (*iep))) == NULL) {
177 if (nvlist_dup(iep->ei_nvl, &cp->ei_nvl, 0) != 0) {
178 fmev_shdl_free(iep->ei_hdl, cp, sizeof (*cp));
184 cp->ei_hdl = iep->ei_hdl;
192 fmev_impl_t *iep = FMEV2IMPL(ev);
194 ASSERT(EVENT_VALID(iep));
196 if (!FMEV_API_ENTER(iep, 1))
202 } else if (iep->ei_nvl == NULL) {
207 return (iep->ei_nvl);
213 fmev_impl_t *iep = FMEV2IMPL(ev);
216 ASSERT(EVENT_VALID(iep));
218 if (!FMEV_API_ENTER(iep, 1))
226 if (nvlist_lookup_string(iep->ei_nvl, FM_CLASS, (char **)&class) != 0 ||
238 fmev_impl_t *iep = FMEV2IMPL(ev);
241 ASSERT(EVENT_VALID(iep));
242 if (!FMEV_API_ENTER(iep, 1))
251 if (iep->ei_fmtime[FM_TIME_SEC] > timetlimit)
254 tp->tv_sec = (time_t)iep->ei_fmtime[FM_TIME_SEC];
255 tp->tv_nsec = (long)iep->ei_fmtime[FM_TIME_NSEC];
284 fmev_impl_t *iep = FMEV2IMPL(ev);
286 if (!FMEV_API_ENTER(iep, 2))
289 return (iep->ei_hdl);