MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / error

Function error

tests/licensedcode/data/perf/udll.cxx:160–184  ·  view source on GitHub ↗

Set and get the error string for use by dlerror */

Source from the content-addressed store, hash-verified

158
159/* Set and get the error string for use by dlerror */
160static const char *error(int setget, const char *str, ...)
161{
162 static char errstr[ERR_STR_LEN];
163 static int err_filled = 0;
164 const char *retval;
165 va_list arg;
166 if (setget == 0)
167 {
168 va_start(arg, str);
169 strncpy(errstr, "dlsimple: ", ERR_STR_LEN);
170 vsnprintf(errstr + 10, ERR_STR_LEN - 10, str, arg);
171 va_end(arg);
172 err_filled = 1;
173 retval = NULL;
174 }
175 else
176 {
177 if (!err_filled)
178 retval = NULL;
179 else
180 retval = errstr;
181 err_filled = 0;
182 }
183 return retval;
184}
185
186/* dlopen */
187static void *dlopen(const char *path, int mode)

Callers 10

dlopenFunction · 0.70
dlsymInternFunction · 0.70
dlerrorFunction · 0.70
dlcloseFunction · 0.70
dlsymFunction · 0.70
validateMethod · 0.50
mallocFunction · 0.50
inflate_dynamicFunction · 0.50
gunzipFunction · 0.50
unlzmaFunction · 0.50

Calls 1

vsnprintfFunction · 0.85

Tested by

no test coverage detected