public void Define(CodeGen code_gen)
        {
            if (is_defined)
            {
                return;
            }

            typeref.Resolve(code_gen);

            peapi_param = new PEAPI.Param(attr,
                                          name, typeref.PeapiType);
            if (defval != null)
            {
                peapi_param.AddDefaultValue(defval);
            }

            if (customattr_list != null)
            {
                foreach (CustomAttr customattr in customattr_list)
                {
                    customattr.AddTo(code_gen, peapi_param);
                }
            }

            if (native_type != null)
            {
                peapi_param.AddMarshallInfo(native_type);
            }

            is_defined = true;
        }
Exemplo n.º 2
0
        private PEAPI.Param [] GenerateParams(CodeGen code_gen)
        {
            PEAPI.Param[] param_array;

            if (param_list != null && param_list.Count > 0)
            {
                int param_count = param_list.Count;

                // Remove the last param if its the sentinel, not sure what
                // should happen with more then one sentinel
                ParamDef last = (ParamDef)param_list [param_count - 1];
                if (last.IsSentinel())
                {
                    param_count--;
                }

                param_array = new PEAPI.Param [param_count];
                for (int i = 0; i < param_count; i++)
                {
                    ParamDef paramdef = (ParamDef)param_list [i];
                    paramdef.Define(code_gen);
                    param_array [i] = paramdef.PeapiParam;
                }
            }
            else
            {
                param_array = new PEAPI.Param [0];
            }

            return(param_array);
        }
Exemplo n.º 3
0
                private PEAPI.Param [] GenerateParams (CodeGen code_gen)
                {
                        PEAPI.Param[] param_array;

                        if (param_list != null && param_list.Count > 0) {
                                 int param_count = param_list.Count;

                                 // Remove the last param if its the sentinel, not sure what
                                // should happen with more then one sentinel
                                ParamDef last = (ParamDef) param_list [param_count-1];
                                if (last.IsSentinel ())
                                        param_count--;

                                param_array = new PEAPI.Param [param_count];
                                for (int i = 0; i < param_count; i++) {
                                        ParamDef paramdef = (ParamDef) param_list [i];
                                        paramdef.Define (code_gen);
                                        param_array [i] = paramdef.PeapiParam;
                                }

                        } else {
                                param_array = new PEAPI.Param [0];
                        }

                        return param_array;
                }
Exemplo n.º 4
0
                public void Define (CodeGen code_gen)
                {
                        if (is_defined)
                                return;

                        typeref.Resolve (code_gen);

                        peapi_param = new PEAPI.Param (attr,
                                        name, typeref.PeapiType);
                        if (defval != null) {
                                peapi_param.AddDefaultValue (defval);
                        }

                        if (customattr_list != null)
                                foreach (CustomAttr customattr in customattr_list)
                                        customattr.AddTo (code_gen, peapi_param);

                        if (native_type != null)
                                peapi_param.AddMarshallInfo (native_type);

                        is_defined = true;
                }