Back to index

php5  5.3.10
Defines | Typedefs | Functions
xmlrpc_introspection.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define xi_token_params   "params"
#define xi_token_returns   "returns"
#define xi_token_related   "related"
#define xi_token_sub   "sub"

Typedefs

typedef void(* XMLRPC_IntrospectionCallback )(XMLRPC_SERVER server, void *userData)

Functions

XMLRPC_VALUE XMLRPC_IntrospectionCreateDescription (const char *xml, XMLRPC_ERROR error)
int XMLRPC_ServerAddIntrospectionData (XMLRPC_SERVER server, XMLRPC_VALUE desc)
int XMLRPC_ServerRegisterIntrospectionCallback (XMLRPC_SERVER server, XMLRPC_IntrospectionCallback cb)

Define Documentation

#define xi_token_params   "params"

Definition at line 57 of file xmlrpc_introspection.h.

#define xi_token_related   "related"

Definition at line 59 of file xmlrpc_introspection.h.

#define xi_token_returns   "returns"

Definition at line 58 of file xmlrpc_introspection.h.

#define xi_token_sub   "sub"

Definition at line 60 of file xmlrpc_introspection.h.


Typedef Documentation

typedef void(* XMLRPC_IntrospectionCallback)(XMLRPC_SERVER server, void *userData)

Definition at line 78 of file xmlrpc_introspection.h.


Function Documentation

Definition at line 458 of file xmlrpc_introspection.c.

                                                                                      {
   XMLRPC_VALUE xReturn = NULL;
   xml_element* root = xml_elem_parse_buf(xml, 0, 0, err ? &err->xml_elem_error : NULL);

   if(root) {
      xReturn = xml_element_to_method_description(root, err);

      xml_elem_free(root);
   }

   return xReturn;

}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 500 of file xmlrpc_introspection.c.

                                                                               {
   int bSuccess = 0;
   if(server && desc) {
      XMLRPC_VALUE xNewTypes = XMLRPC_VectorGetValueWithID(desc, "typeList");
      XMLRPC_VALUE xNewMethods = XMLRPC_VectorGetValueWithID(desc, "methodList");
      XMLRPC_VALUE xServerTypes = XMLRPC_VectorGetValueWithID(server->xIntrospection, "typeList");

      if(xNewMethods) {
         XMLRPC_VALUE xMethod = XMLRPC_VectorRewind(xNewMethods);

         while(xMethod) {
            const char* name = XMLRPC_VectorGetStringWithID(xMethod, xi_token_name);
            server_method* sm = find_method(server, name);

            if(sm) {
               if(sm->desc) {
                  XMLRPC_CleanupValue(sm->desc);
               }
               sm->desc = XMLRPC_CopyValue(xMethod);
               bSuccess = 1;
            }

            xMethod = XMLRPC_VectorNext(xNewMethods);
         }
      }
      if(xNewTypes) {
         if(!xServerTypes) {
            if(!server->xIntrospection) {
               server->xIntrospection = XMLRPC_CreateVector(NULL, xmlrpc_vector_struct);
            }

            XMLRPC_AddValueToVector(server->xIntrospection, xNewTypes);
            bSuccess = 1;
         }
         else {
            XMLRPC_VALUE xIter = XMLRPC_VectorRewind(xNewTypes);
            while(xIter) {
               /* get rid of old values */
               XMLRPC_VALUE xPrev = find_named_value(xServerTypes, XMLRPC_VectorGetStringWithID(xIter, xi_token_name));
               if(xPrev) {
                  XMLRPC_VectorRemoveValue(xServerTypes, xPrev);
               }
               XMLRPC_AddValueToVector(xServerTypes, xIter);
               bSuccess = 1;
               xIter = XMLRPC_VectorNext(xNewTypes);
            }
         }
      }
   }
   return bSuccess;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 577 of file xmlrpc_introspection.c.

                                                                                                      {
   int bSuccess = 0;
   if(server && cb) {

      doc_method* dm = calloc(1, sizeof(doc_method));
      
      if(dm) {
         dm->method = cb;
         dm->b_called = 0;

         if(Q_PushTail(&server->docslist, dm)) {
            bSuccess = 1;
         }
         else {
            my_free(dm);
         }
      }
   }
   return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function: