Lines Matching refs:value
185 static int date_from_ISO8601 (const char *text, time_t * value) { in date_from_ISO8601() argument
269 *value = mkgmtime(&tm); in date_from_ISO8601()
275 static int date_to_ISO8601 (time_t value, char *buf, int length) { in date_to_ISO8601() argument
277 tm = php_gmtime_r(&value, &tmbuf); in date_to_ISO8601()
899 const char *XMLRPC_SetValueID_Case(XMLRPC_VALUE value, const char* id, int len, XMLRPC_CASE id_case… in XMLRPC_SetValueID_Case() argument
901 if(value) { in XMLRPC_SetValueID_Case()
903 simplestring_clear(&value->id); in XMLRPC_SetValueID_Case()
904 (len > 0) ? simplestring_addn(&value->id, id, len) : in XMLRPC_SetValueID_Case()
905 simplestring_add(&value->id, id); in XMLRPC_SetValueID_Case()
910 for(i = 0; i < value->id.len; i++) { in XMLRPC_SetValueID_Case()
911 value->id.str[i] = in XMLRPC_SetValueID_Case()
913 xmlrpc_case_lower) ? tolower (value->id. in XMLRPC_SetValueID_Case()
914 str[i]) : toupper (value-> in XMLRPC_SetValueID_Case()
920 pRetval = value->id.str; in XMLRPC_SetValueID_Case()
953 const char *XMLRPC_SetValueString(XMLRPC_VALUE value, const char* val, int len) { in XMLRPC_SetValueString() argument
955 if(value && val) { in XMLRPC_SetValueString()
956 simplestring_clear(&value->str); in XMLRPC_SetValueString()
957 (len > 0) ? simplestring_addn(&value->str, val, len) : in XMLRPC_SetValueString()
958 simplestring_add(&value->str, val); in XMLRPC_SetValueString()
959 value->type = xmlrpc_string; in XMLRPC_SetValueString()
960 pRetval = (char *)value->str.str; in XMLRPC_SetValueString()
985 void XMLRPC_SetValueInt(XMLRPC_VALUE value, int val) { in XMLRPC_SetValueInt() argument
986 if(value) { in XMLRPC_SetValueInt()
987 value->type = xmlrpc_int; in XMLRPC_SetValueInt()
988 value->i = val; in XMLRPC_SetValueInt()
1011 void XMLRPC_SetValueBoolean(XMLRPC_VALUE value, int val) { in XMLRPC_SetValueBoolean() argument
1012 if(value) { in XMLRPC_SetValueBoolean()
1013 value->type = xmlrpc_boolean; in XMLRPC_SetValueBoolean()
1014 value->i = val ? 1 : 0; in XMLRPC_SetValueBoolean()
1043 int XMLRPC_SetIsVector(XMLRPC_VALUE value, XMLRPC_VECTOR_TYPE type) { in XMLRPC_SetIsVector() argument
1046 if (value) { in XMLRPC_SetIsVector()
1048 if(value->type == xmlrpc_vector) { in XMLRPC_SetIsVector()
1049 if(value->v) { in XMLRPC_SetIsVector()
1050 if(!Q_Size(value->v->q)) { in XMLRPC_SetIsVector()
1051 value->v->type = type; in XMLRPC_SetIsVector()
1056 value->v = calloc(1, sizeof(STRUCT_XMLRPC_VECTOR)); in XMLRPC_SetIsVector()
1057 if(value->v) { in XMLRPC_SetIsVector()
1058 value->v->q = (queue*)malloc(sizeof(queue)); in XMLRPC_SetIsVector()
1059 if(value->v->q) { in XMLRPC_SetIsVector()
1060 Q_Init(value->v->q); in XMLRPC_SetIsVector()
1061 value->v->type = type; in XMLRPC_SetIsVector()
1062 value->type = xmlrpc_vector; in XMLRPC_SetIsVector()
1299 int XMLRPC_VectorRemoveValue(XMLRPC_VALUE vector, XMLRPC_VALUE value) { in XMLRPC_VectorRemoveValue() argument
1300 if(vector && vector->v && vector->v->q && value) { in XMLRPC_VectorRemoveValue()
1305 if(xIter == value) { in XMLRPC_VectorRemoveValue()
1338 XMLRPC_VALUE value = NULL; in XMLRPC_CreateValueString() local
1340 value = XMLRPC_CreateValueEmpty(); in XMLRPC_CreateValueString()
1341 if(value) { in XMLRPC_CreateValueString()
1342 XMLRPC_SetValueString(value, val, len); in XMLRPC_CreateValueString()
1344 XMLRPC_SetValueID(value, id, 0); in XMLRPC_CreateValueString()
1348 return value; in XMLRPC_CreateValueString()
1444 void XMLRPC_CleanupValue(XMLRPC_VALUE value) { in XMLRPC_CleanupValue() argument
1445 if(value) { in XMLRPC_CleanupValue()
1446 if(value->iRefCount > 0) { in XMLRPC_CleanupValue()
1447 value->iRefCount --; in XMLRPC_CleanupValue()
1451 if(value->id.str) { in XMLRPC_CleanupValue()
1452 printf ("decremented refcount of %s, now %i\n", value->id.str, in XMLRPC_CleanupValue()
1453 value->iRefCount); in XMLRPC_CleanupValue()
1456 printf ("decremented refcount of 0x%x, now %i\n", value, in XMLRPC_CleanupValue()
1457 value->iRefCount); in XMLRPC_CleanupValue()
1461 if(value->type == xmlrpc_vector) { in XMLRPC_CleanupValue()
1462 if(value->v) { in XMLRPC_CleanupValue()
1463 if(value->iRefCount == 0) { in XMLRPC_CleanupValue()
1464 XMLRPC_VALUE cur = (XMLRPC_VALUE)Q_Head(value->v->q); in XMLRPC_CleanupValue()
1471 if(value->v && value->v->q) { in XMLRPC_CleanupValue()
1472 cur = Q_Next(value->v->q); in XMLRPC_CleanupValue()
1479 Q_Destroy(value->v->q); in XMLRPC_CleanupValue()
1480 my_free(value->v->q); in XMLRPC_CleanupValue()
1481 my_free(value->v); in XMLRPC_CleanupValue()
1487 if(value->iRefCount == 0) { in XMLRPC_CleanupValue()
1490 switch(value->type) { in XMLRPC_CleanupValue()
1500 if(value->id.str) { in XMLRPC_CleanupValue()
1501 printf("free'd %s\n", value->id.str); in XMLRPC_CleanupValue()
1504 printf("free'd 0x%x\n", value); in XMLRPC_CleanupValue()
1507 simplestring_free(&value->id); in XMLRPC_CleanupValue()
1508 simplestring_free(&value->str); in XMLRPC_CleanupValue()
1510 memset(value, 0, sizeof(STRUCT_XMLRPC_VALUE)); in XMLRPC_CleanupValue()
1511 my_free(value); in XMLRPC_CleanupValue()
1544 void XMLRPC_SetValueDateTime(XMLRPC_VALUE value, time_t time) { in XMLRPC_SetValueDateTime() argument
1545 if(value) { in XMLRPC_SetValueDateTime()
1547 value->type = xmlrpc_datetime; in XMLRPC_SetValueDateTime()
1548 value->i = time; in XMLRPC_SetValueDateTime()
1555 XMLRPC_SetValueDateTime_ISO8601 (value, timeBuf); in XMLRPC_SetValueDateTime()
1583 XMLRPC_VALUE XMLRPC_CopyValue(XMLRPC_VALUE value) { in XMLRPC_CopyValue() argument
1584 if(value) { in XMLRPC_CopyValue()
1585 value->iRefCount ++; in XMLRPC_CopyValue()
1587 if(value->id.str) { in XMLRPC_CopyValue()
1588 printf ("incremented refcount of %s, now %i\n", value->id.str, in XMLRPC_CopyValue()
1589 value->iRefCount); in XMLRPC_CopyValue()
1592 printf ("incremented refcount of 0x%x, now %i\n", value, in XMLRPC_CopyValue()
1593 value->iRefCount); in XMLRPC_CopyValue()
1597 return value; in XMLRPC_CopyValue()
1727 void XMLRPC_SetValueDateTime_ISO8601(XMLRPC_VALUE value, const char* s) { in XMLRPC_SetValueDateTime_ISO8601() argument
1728 if(value) { in XMLRPC_SetValueDateTime_ISO8601()
1731 value->type = xmlrpc_datetime; in XMLRPC_SetValueDateTime_ISO8601()
1733 value->i = time_val; in XMLRPC_SetValueDateTime_ISO8601()
1734 simplestring_clear(&value->str); in XMLRPC_SetValueDateTime_ISO8601()
1735 simplestring_add(&value->str, s); in XMLRPC_SetValueDateTime_ISO8601()
1799 void XMLRPC_SetValueBase64(XMLRPC_VALUE value, const char* s, int len) { in XMLRPC_SetValueBase64() argument
1800 if(value && s) { in XMLRPC_SetValueBase64()
1801 simplestring_clear(&value->str); in XMLRPC_SetValueBase64()
1802 (len > 0) ? simplestring_addn(&value->str, s, len) : in XMLRPC_SetValueBase64()
1803 simplestring_add(&value->str, s); in XMLRPC_SetValueBase64()
1804 value->type = xmlrpc_base64; in XMLRPC_SetValueBase64()
1863 void XMLRPC_SetValueDouble(XMLRPC_VALUE value, double val) { in XMLRPC_SetValueDouble() argument
1864 if(value) { in XMLRPC_SetValueDouble()
1865 value->type = xmlrpc_double; in XMLRPC_SetValueDouble()
1866 value->d = val; in XMLRPC_SetValueDouble()
1920 const char* XMLRPC_GetValueString(XMLRPC_VALUE value) { in XMLRPC_GetValueString() argument
1921 return ((value && value->type == xmlrpc_string) ? value->str.str : 0); in XMLRPC_GetValueString()
1943 int XMLRPC_GetValueStringLen(XMLRPC_VALUE value) { in XMLRPC_GetValueStringLen() argument
1944 return ((value) ? value->str.len : 0); in XMLRPC_GetValueStringLen()
1967 int XMLRPC_GetValueInt(XMLRPC_VALUE value) { in XMLRPC_GetValueInt() argument
1968 return ((value && value->type == xmlrpc_int) ? value->i : 0); in XMLRPC_GetValueInt()
1991 int XMLRPC_GetValueBoolean(XMLRPC_VALUE value) { in XMLRPC_GetValueBoolean() argument
1992 return ((value && value->type == xmlrpc_boolean) ? value->i : 0); in XMLRPC_GetValueBoolean()
2015 double XMLRPC_GetValueDouble(XMLRPC_VALUE value) { in XMLRPC_GetValueDouble() argument
2016 return ((value && value->type == xmlrpc_double) ? value->d : 0); in XMLRPC_GetValueDouble()
2040 const char* XMLRPC_GetValueBase64(XMLRPC_VALUE value) { in XMLRPC_GetValueBase64() argument
2041 return ((value && value->type == xmlrpc_base64) ? value->str.str : 0); in XMLRPC_GetValueBase64()
2065 time_t XMLRPC_GetValueDateTime(XMLRPC_VALUE value) { in XMLRPC_GetValueDateTime() argument
2066 return (time_t)((value && value->type == xmlrpc_datetime) ? value->i : 0); in XMLRPC_GetValueDateTime()
2088 const char* XMLRPC_GetValueDateTime_ISO8601(XMLRPC_VALUE value) { in XMLRPC_GetValueDateTime_ISO8601() argument
2089 return ((value && value->type == xmlrpc_datetime) ? value->str.str : 0); in XMLRPC_GetValueDateTime_ISO8601()
2112 const char* XMLRPC_GetValueID(XMLRPC_VALUE value) { in XMLRPC_GetValueID() argument
2113 return (const char*)((value && value->id.len) ? value->id.str : 0); in XMLRPC_GetValueID()
2137 int XMLRPC_VectorSize(XMLRPC_VALUE value) { in XMLRPC_VectorSize() argument
2139 if(value && value->type == xmlrpc_vector && value->v) { in XMLRPC_VectorSize()
2140 size = Q_Size(value->v->q); in XMLRPC_VectorSize()
2165 XMLRPC_VALUE XMLRPC_VectorRewind(XMLRPC_VALUE value) { in XMLRPC_VectorRewind() argument
2167 if(value && value->type == xmlrpc_vector && value->v) { in XMLRPC_VectorRewind()
2168 xReturn = (XMLRPC_VALUE)Q_Head(value->v->q); in XMLRPC_VectorRewind()
2191 XMLRPC_VALUE XMLRPC_VectorNext(XMLRPC_VALUE value) { in XMLRPC_VectorNext() argument
2193 if(value && value->type == xmlrpc_vector && value->v) { in XMLRPC_VectorNext()
2194 xReturn = (XMLRPC_VALUE)Q_Next(value->v->q); in XMLRPC_VectorNext()
2222 XMLRPC_VALUE_TYPE XMLRPC_GetValueType(XMLRPC_VALUE value) { in XMLRPC_GetValueType() argument
2223 return value ? value->type : xmlrpc_empty; in XMLRPC_GetValueType()
2250 XMLRPC_VECTOR_TYPE XMLRPC_GetVectorType(XMLRPC_VALUE value) { in XMLRPC_GetVectorType() argument
2251 return(value && value->v) ? value->v->type : xmlrpc_none; in XMLRPC_GetVectorType()
2276 XMLRPC_VALUE_TYPE_EASY XMLRPC_GetValueTypeEasy (XMLRPC_VALUE value) { in XMLRPC_GetValueTypeEasy() argument
2277 if (value) { in XMLRPC_GetValueTypeEasy()
2278 switch (value->type) { in XMLRPC_GetValueTypeEasy()
2280 switch (value->v->type) { in XMLRPC_GetValueTypeEasy()
2292 return(XMLRPC_VALUE_TYPE_EASY) value->type; in XMLRPC_GetValueTypeEasy()
2841 int XMLRPC_ValueIsFault (XMLRPC_VALUE value) { in XMLRPC_ValueIsFault() argument
2842 if( XMLRPC_VectorGetValueWithID(value, "faultCode") && in XMLRPC_ValueIsFault()
2843 XMLRPC_VectorGetValueWithID(value, "faultString") ) { in XMLRPC_ValueIsFault()
2889 int XMLRPC_GetValueFaultCode (XMLRPC_VALUE value) { in XMLRPC_GetValueFaultCode() argument
2890 return XMLRPC_VectorGetIntWithID(value, "faultCode"); in XMLRPC_GetValueFaultCode()
2934 const char* XMLRPC_GetValueFaultString (XMLRPC_VALUE value) { in XMLRPC_GetValueFaultString() argument
2935 return XMLRPC_VectorGetStringWithID(value, "faultString"); in XMLRPC_GetValueFaultString()