Ejemplo n.º 1
0
Archivo: service.c Proyecto: wido/libs3
static S3Status dataCallback(int bufferSize, const char *buffer,
                             void *callbackData)
{
    XmlCallbackData *cbData = (XmlCallbackData *) callbackData;

    return simplexml_add(&(cbData->simpleXml), buffer, bufferSize);
}
Ejemplo n.º 2
0
static S3Status convert_bls(char *blsXml, char *targetBucketReturn,
                            char *targetPrefixReturn, int *aclGrantCountReturn,
                            S3AclGrant *aclGrants)
{
    ConvertBlsData data;

    data.targetBucketReturn = targetBucketReturn;
    data.targetBucketReturn[0] = 0;
    data.targetBucketReturnLen = 0;
    data.targetPrefixReturn = targetPrefixReturn;
    data.targetPrefixReturn[0] = 0;
    data.targetPrefixReturnLen = 0;
    data.aclGrantCountReturn = aclGrantCountReturn;
    data.aclGrants = aclGrants;
    *aclGrantCountReturn = 0;
    string_buffer_initialize(data.emailAddress);
    string_buffer_initialize(data.userId);
    string_buffer_initialize(data.userDisplayName);
    string_buffer_initialize(data.groupUri);
    string_buffer_initialize(data.permission);

    // Use a simplexml parser
    SimpleXml simpleXml;
    simplexml_initialize(&simpleXml, &convertBlsXmlCallback, &data);

    S3Status status = simplexml_add(&simpleXml, blsXml, strlen(blsXml));

    simplexml_deinitialize(&simpleXml);
                                          
    return status;
}
Ejemplo n.º 3
0
S3Status S3_convert_acl(char *aclXml, char *ownerId, char *ownerDisplayName,
                        int *aclGrantCountReturn, S3AclGrant *aclGrants)
{
    ConvertAclData data;

    data.ownerId = ownerId;
    data.ownerIdLen = 0;
    data.ownerId[0] = 0;
    data.ownerDisplayName = ownerDisplayName;
    data.ownerDisplayNameLen = 0;
    data.ownerDisplayName[0] = 0;
    data.aclGrantCountReturn = aclGrantCountReturn;
    data.aclGrants = aclGrants;
    *aclGrantCountReturn = 0;
    string_buffer_initialize(data.emailAddress);
    string_buffer_initialize(data.userId);
    string_buffer_initialize(data.userDisplayName);
    string_buffer_initialize(data.groupUri);
    string_buffer_initialize(data.permission);

    // Use a simplexml parser
    SimpleXml simpleXml;
    simplexml_initialize(&simpleXml, &convertAclXmlCallback, &data);

    S3Status status = simplexml_add(&simpleXml, aclXml, strlen(aclXml));

    simplexml_deinitialize(&simpleXml);
                                          
    return status;
}
Ejemplo n.º 4
0
static S3Status copyObjectDataCallback(int bufferSize, const char *buffer,
                                       void *callbackData)
{
    CopyObjectData *coData = (CopyObjectData *) callbackData;

    return simplexml_add(&(coData->simpleXml), buffer, bufferSize);
}
Ejemplo n.º 5
0
static S3Status testBucketDataCallback(int bufferSize, const char *buffer,
                                       void *callbackData)
{
    TestBucketData *tbData = (TestBucketData *) callbackData;

    return simplexml_add(&(tbData->simpleXml), buffer, bufferSize);
}
Ejemplo n.º 6
0
static S3Status listPartsDataCallback(int bufferSize, const char *buffer, 
                                       void *callbackData)
{
    ListPartsData *lpData = (ListPartsData *) callbackData;
    
    return simplexml_add(&(lpData->simpleXml), buffer, bufferSize);
}
Ejemplo n.º 7
0
static S3Status InitialMultipartCallback(int bufferSize, const char *buffer, 
                                         void *callbackData) 
{
    InitialMultipartData *mdata = (InitialMultipartData *) callbackData;
    return simplexml_add(&(mdata->simpleXml), buffer, bufferSize);
}
Ejemplo n.º 8
0
static S3Status commitMultipartCallback(int bufferSize, const char *buffer, 
                                        void *callbackData) 
{
    CommitMultiPartData *data = (CommitMultiPartData *) callbackData;
    return simplexml_add(&(data->simplexml), buffer, bufferSize);
}