Exemple #1
0
int SelectInterfaceDirEntry(const char *pszName, const char *pszNamespaces, const CLSModule *pModule)
{
    int n;

    assert(pModule != NULL);
    assert(pszName != NULL);

    for (n = 0; n < pModule->mInterfaceCount; n++) {
        if (!strcmp(pszName, pModule->mInterfaceDirs[n]->mName)) {
            if (pModule->mInterfaceDirs[n]->mNameSpace == NULL) _ReturnOK (n);
            //temp
            if (!strcmp("systypes", pModule->mInterfaceDirs[n]->mNameSpace)) _ReturnOK (n);

            const char *begin, *semicolon;
            begin = pszNamespaces;
            while (begin != NULL) {
                semicolon = strchr(begin, ';');
                if (semicolon != NULL) { *const_cast<char*>(semicolon) = '\0'; }
                if (!strcmp(begin, pModule->mInterfaceDirs[n]->mNameSpace)) _ReturnOK (n);
                if (semicolon != NULL) { *const_cast<char*>(semicolon) = ';'; begin = semicolon + 1; }
                else begin = NULL;
            }
        }
    }

    _ReturnError (CLSError_NotFound);
}
Exemple #2
0
int SelectStructDirEntry(const char *pszName, const CLSModule *pModule)
{
    int n;

    assert(pModule != NULL);
    assert(pszName != NULL);

    for (n = 0; n < pModule->mStructCount; n++) {
        if (!strcmp(pszName, pModule->mStructDirs[n]->mName))
            _ReturnOK (n);
    }

    _ReturnError (CLSError_NotFound);
}
Exemple #3
0
int SelectClassInterface(USHORT index, const ClassDescriptor *pDesc)
{
    int n;

    assert(pDesc != NULL);

    for (n = 0; n < pDesc->mInterfaceCount; n++) {
        if (pDesc->mInterfaces[n]->mIndex == index) {
            _ReturnOK (n);
        }
    }

    _ReturnError (CLSError_NotFound);
}
Exemple #4
0
int SelectFileDirEntry(const char *pszPath, const CLSModule *pModule)
{
    int n;

    assert(pszPath != NULL);

    for (n = 1; n < pModule->mFileCount; n++) {
        if (!strcmp(pszPath, pModule->mFileDirs[n]->mPath)) {
            _ReturnOK (n);
        }
    }

    _ReturnError (CLSError_NotFound);
}
Exemple #5
0
int GetArrayBaseType(
    /* [in] */ const CLSModule* module,
    /* [in] */ const TypeDescriptor* srcDescriptor,
    /* [in] */ TypeDescriptor* destDescriptor)
{
    TypeDescriptor* type = (TypeDescriptor *)srcDescriptor;

    while (Type_Array == type->mType) {
        type = &module->mArrayDirs[type->mIndex]->type;
    }

    memcpy(destDescriptor, type, sizeof(TypeDescriptor));

    _ReturnOK(CLS_NoError);
}
Exemple #6
0
int SelectArrayDirEntry(unsigned short nElems, const TypeDescriptor &desp,
    const CLSModule *pModule)
{
    int n;
    assert(nElems > 0);
    assert(pModule != NULL);

    for (n = 0; n < pModule->mArrayCount; n++) {
        if (nElems == pModule->mArrayDirs[n]->mElementCount
            && 0 == memcmp(&desp, &(pModule->mArrayDirs[n]->mType), sizeof(TypeDescriptor)))
            _ReturnOK (n);
    }

    _ReturnError (CLSError_NotFound);
}
Exemple #7
0
int SelectEnumElement(const char *pszName, const EnumDescriptor *pDesc)
{
    int n;

    assert(pDesc != NULL);
    assert(pszName != NULL);

    for (n = 0; n < pDesc->mElementCount; n++) {
        if (!strcmp(pszName, pDesc->mElements[n]->mName)) {
            _ReturnOK (n);
        }
    }

    _ReturnError (CLSError_NotFound);
}
Exemple #8
0
int SelectMethodParam(const char *pszName, const MethodDescriptor *pDesc)
{
    int n;

    assert(pDesc != NULL);
    assert(pszName != NULL);

    for (n = 0; n < pDesc->mParamCount; n++) {
        if (!strcmp(pszName, pDesc->mParams[n]->mName)) {
            _ReturnOK (n);
        }
    }

    _ReturnError (CLSError_NotFound);
}
Exemple #9
0
int SelectInterfaceMethod(
    const char *pszName, const InterfaceDescriptor *pDesc)
{
    int n;

    assert(pDesc != NULL);
    assert(pszName != NULL);

    for (n = 0; n < pDesc->mMethodCount; n++) {
        if (!strcmp(pszName, pDesc->mMethods[n]->mName)) {
            _ReturnOK (n);
        }
    }

    _ReturnError (CLSError_NotFound);
}
Exemple #10
0
int SelectStructElement(
    const char *pszName, const StructDescriptor *pDesc)
{
    int n;

    assert(pDesc != NULL);
    assert(pszName != NULL);

    for (n = 0; n < pDesc->cElems; n++) {
        if (!strcmp(pszName, pDesc->ppElems[n]->mName)) {
            _ReturnOK (n);
        }
    }

    _ReturnError (CLSError_NotFound);
}
Exemple #11
0
int GetOriginalType(
    /* [in] */ const CLSModule* module,
    /* [in] */ const TypeDescriptor* srcDescriptor,
    /* [in] */ TypeDescriptor* destDescriptor)
{
    destDescriptor->mPointer = srcDescriptor->mPointer;
    destDescriptor->mUnsigned = srcDescriptor->mUnsigned;

    while (srcDescriptor->mType == Type_alias) {
        srcDescriptor = &module->mAliasDirs[srcDescriptor->mIndex]->type;
        destDescriptor->mPointer += srcDescriptor->mPointer;
        destDescriptor->mUnsigned |= srcDescriptor->mUnsigned;
    }

    destDescriptor->mType = srcDescriptor->mType;
    destDescriptor->mIndex = srcDescriptor->mIndex;
    destDescriptor->mNestedType = srcDescriptor->mNestedType;

    _ReturnOK(CLS_NoError);
}