Lines Matching refs:obj

118 xmlXPathFreeValueTree(xmlNodeSetPtr obj);
120 xmlXPathReleaseObject(xmlXPathContextPtr ctxt, xmlXPathObjectPtr obj);
1815 xmlXPathObjectPtr obj;
1821 obj = list->items[i];
1826 if (obj->nodesetval != NULL) {
1827 if (obj->nodesetval->nodeTab != NULL)
1828 xmlFree(obj->nodesetval->nodeTab);
1829 xmlFree(obj->nodesetval);
1831 xmlFree(obj);
2470 xmlXPathObjectPtr obj;
2473 obj = valuePop(ctxt);
2474 if (obj == NULL) {
2478 if (obj->type != XPATH_BOOLEAN)
2479 ret = xmlXPathCastToBoolean(obj);
2481 ret = obj->boolval;
2482 xmlXPathReleaseObject(ctxt->context, obj);
2497 xmlXPathObjectPtr obj;
2500 obj = valuePop(ctxt);
2501 if (obj == NULL) {
2505 if (obj->type != XPATH_NUMBER)
2506 ret = xmlXPathCastToNumber(obj);
2508 ret = obj->floatval;
2509 xmlXPathReleaseObject(ctxt->context, obj);
2524 xmlXPathObjectPtr obj;
2527 obj = valuePop(ctxt);
2528 if (obj == NULL) {
2532 ret = xmlXPathCastToString(obj); /* this does required strdup */
2534 if (obj->stringval == ret)
2535 obj->stringval = NULL;
2536 xmlXPathReleaseObject(ctxt->context, obj);
2551 xmlXPathObjectPtr obj;
2563 obj = valuePop(ctxt);
2564 ret = obj->nodesetval;
2566 /* to fix memory leak of not clearing obj->user */
2567 if (obj->boolval && obj->user != NULL)
2568 xmlFreeNodeList((xmlNodePtr) obj->user);
2570 obj->nodesetval = NULL;
2571 xmlXPathReleaseObject(ctxt->context, obj);
2586 xmlXPathObjectPtr obj;
2597 obj = valuePop(ctxt);
2598 ret = obj->user;
2599 obj->user = NULL;
2600 xmlXPathReleaseObject(ctxt->context, obj);
3838 * @obj: the xmlNodeSetPtr to free
3843 xmlXPathFreeNodeSet(xmlNodeSetPtr obj) {
3844 if (obj == NULL) return;
3845 if (obj->nodeTab != NULL) {
3849 for (i = 0;i < obj->nodeNr;i++)
3850 if ((obj->nodeTab[i] != NULL) &&
3851 (obj->nodeTab[i]->type == XML_NAMESPACE_DECL))
3852 xmlXPathNodeSetFreeNs((xmlNsPtr) obj->nodeTab[i]);
3853 xmlFree(obj->nodeTab);
3855 xmlFree(obj);
3888 * @obj: the xmlNodeSetPtr to free
3894 xmlXPathFreeValueTree(xmlNodeSetPtr obj) {
3897 if (obj == NULL) return;
3899 if (obj->nodeTab != NULL) {
3900 for (i = 0;i < obj->nodeNr;i++) {
3901 if (obj->nodeTab[i] != NULL) {
3902 if (obj->nodeTab[i]->type == XML_NAMESPACE_DECL) {
3903 xmlXPathNodeSetFreeNs((xmlNsPtr) obj->nodeTab[i]);
3905 xmlFreeNodeList(obj->nodeTab[i]);
3909 xmlFree(obj->nodeTab);
3911 xmlFree(obj);
3918 * @obj: the xmlNodeSetPtr to display
3923 xmlGenericErrorContextNodeSet(FILE *output, xmlNodeSetPtr obj) {
3927 if (obj == NULL) {
3931 if (obj->nodeNr == 0) {
3935 if (obj->nodeTab == NULL) {
3939 for (i = 0; i < obj->nodeNr; i++) {
3940 if (obj->nodeTab[i] == NULL) {
3944 if ((obj->nodeTab[i]->type == XML_DOCUMENT_NODE) ||
3945 (obj->nodeTab[i]->type == XML_HTML_DOCUMENT_NODE))
3947 else if (obj->nodeTab[i]->name == NULL)
3949 else fprintf(output, " %s", obj->nodeTab[i]->name);
4069 * @obj: an existing NodeSetList object
4071 * Free up the xmlXPathObjectPtr @obj but don't deallocate the objects in
4075 xmlXPathFreeNodeSetList(xmlXPathObjectPtr obj) {
4076 if (obj == NULL) return;
4078 xmlXPathDebugObjUsageReleased(NULL, obj->type);
4080 xmlFree(obj);
5088 * @obj: the object to free
5093 xmlXPathFreeObject(xmlXPathObjectPtr obj) {
5094 if (obj == NULL) return;
5095 if ((obj->type == XPATH_NODESET) || (obj->type == XPATH_XSLT_TREE)) {
5096 if (obj->boolval) {
5098 if (obj->user != NULL) {
5099 xmlXPathFreeNodeSet(obj->nodesetval);
5100 xmlFreeNodeList((xmlNodePtr) obj->user);
5103 obj->type = XPATH_XSLT_TREE; /* TODO: Just for debugging. */
5104 if (obj->nodesetval != NULL)
5105 xmlXPathFreeValueTree(obj->nodesetval);
5107 if (obj->nodesetval != NULL)
5108 xmlXPathFreeNodeSet(obj->nodesetval);
5111 } else if (obj->type == XPATH_LOCATIONSET) {
5112 if (obj->user != NULL)
5113 xmlXPtrFreeLocationSet(obj->user);
5115 } else if (obj->type == XPATH_STRING) {
5116 if (obj->stringval != NULL)
5117 xmlFree(obj->stringval);
5120 xmlXPathDebugObjUsageReleased(NULL, obj->type);
5122 xmlFree(obj);
5127 * @obj: the xmlXPathObjectPtr to free or to cache
5133 xmlXPathReleaseObject(xmlXPathContextPtr ctxt, xmlXPathObjectPtr obj)
5137 if (xmlPointerListAddSize(sl, obj, 0) == -1) goto free_obj;
5141 if (obj == NULL)
5144 xmlXPathFreeObject(obj);
5149 switch (obj->type) {
5152 if (obj->nodesetval != NULL) {
5153 if (obj->boolval) {
5159 obj->type = XPATH_XSLT_TREE; /* just for debugging */
5160 xmlXPathFreeValueTree(obj->nodesetval);
5161 obj->nodesetval = NULL;
5162 } else if ((obj->nodesetval->nodeMax <= 40) &&
5166 XP_CACHE_ADD(cache->nodesetObjs, obj);
5169 xmlXPathFreeNodeSet(obj->nodesetval);
5170 obj->nodesetval = NULL;
5175 if (obj->stringval != NULL)
5176 xmlFree(obj->stringval);
5179 XP_CACHE_ADD(cache->stringObjs, obj);
5185 XP_CACHE_ADD(cache->booleanObjs, obj);
5191 XP_CACHE_ADD(cache->numberObjs, obj);
5197 if (obj->user != NULL) {
5198 xmlXPtrFreeLocationSet(obj->user);
5210 XP_CACHE_ADD(cache->miscObjs, obj);
5217 xmlXPathDebugObjUsageReleased(ctxt, obj->type);
5220 if (obj->nodesetval != NULL) {
5221 xmlNodeSetPtr tmpset = obj->nodesetval;
5247 memset(obj, 0, sizeof(xmlXPathObject));
5248 obj->nodesetval = tmpset;
5250 memset(obj, 0, sizeof(xmlXPathObject));
5258 if (obj->nodesetval != NULL)
5259 xmlXPathFreeNodeSet(obj->nodesetval);
5261 xmlXPathDebugObjUsageReleased(NULL, obj->type);
5263 xmlFree(obj);
8221 xmlXPathObjectPtr obj;
8224 obj = valuePop(ctxt);
8225 if (obj == NULL) XP_ERROR(XPATH_INVALID_OPERAND);
8226 if ((obj->type == XPATH_NODESET) || (obj->type == XPATH_XSLT_TREE)) {
8232 if (obj->nodesetval != NULL) {
8233 for (i = 0; i < obj->nodesetval->nodeNr; i++) {
8235 xmlXPathCastNodeToString(obj->nodesetval->nodeTab[i]);
8243 xmlXPathReleaseObject(ctxt->context, obj);
8247 obj = xmlXPathCacheConvertString(ctxt->context, obj);
8248 ret = xmlXPathGetElementsByIds(ctxt->context->doc, obj->stringval);
8250 xmlXPathReleaseObject(ctxt->context, obj);
8879 xmlXPathObjectPtr obj = NULL;
8896 obj = valuePop(ctxt);
8897 source = obj->stringval;
8924 xmlXPathReleaseObject(ctxt->context, obj);
11132 xmlXPathObjectPtr obj;
11136 obj = valuePop(ctxt);
11144 xmlXPathFreeObject(obj);
11276 xmlXPathReleaseObject(xpctxt, obj);
11280 inputList = obj->nodesetval;
11282 xmlXPathReleaseObject(xpctxt, obj);
11621 if ((obj->boolval) && (obj->user != NULL)) {
11626 ctxt->value->user = obj->user;
11627 obj->user = NULL;
11628 obj->boolval = 0;
11630 xmlXPathReleaseObject(xpctxt, obj);
11635 xmlXPathReleaseObject(xpctxt, obj);
11678 xmlXPathObjectPtr obj;
11683 obj = valuePop(ctxt);
11689 xmlXPathFreeObject(obj);
11825 xmlXPathReleaseObject(xpctxt, obj);
11829 inputList = obj->nodesetval;
11831 xmlXPathReleaseObject(xpctxt, obj);
12090 if ((obj->boolval) && (obj->user != NULL)) {
12092 ctxt->value->user = obj->user;
12093 obj->user = NULL;
12094 obj->boolval = 0;
12096 xmlXPathReleaseObject(xpctxt, obj);
12101 xmlXPathReleaseObject(xpctxt, obj);
12419 xmlXPathObjectPtr obj;
12495 obj = valuePop(ctxt);
12496 oldlocset = obj->user;
12508 valuePush(ctxt, obj);
12533 xmlXPathFreeObject(obj);
12577 xmlXPathReleaseObject(ctxt->context, obj);
12593 obj = valuePop(ctxt);
12594 oldset = obj->nodesetval;
12613 valuePush(ctxt, obj);
12649 xmlXPathFreeObject(obj);
12691 xmlXPathReleaseObject(ctxt->context, obj);
13067 xmlXPathObjectPtr obj, tmp;
13196 obj = valuePop(ctxt);
13197 oldlocset = obj->user;
13211 valuePush(ctxt, obj);
13234 xmlXPathFreeObject(obj);
13266 xmlXPathReleaseObject(ctxt->context, obj);
13282 obj = valuePop(ctxt);
13283 oldset = obj->nodesetval;
13302 valuePush(ctxt, obj);
13369 xmlXPathFreeObject(obj);
13409 xmlXPathReleaseObject(ctxt->context, obj);
13436 xmlXPathObjectPtr res, obj;
13456 obj = valuePop(ctxt);
13457 oldlocset = obj->user;
13468 valuePush(ctxt, obj);
13491 xmlXPathFreeObject(obj);
13532 obj = valuePop(ctxt);
13533 oldset = obj->nodesetval;
13557 xmlXPathFreeObject(obj);
13588 xmlXPathReleaseObject(ctxt->context, obj);