Exemplo n.º 1
0
		public virtual bool Validate ()
		{
			if (!parms.Validate ()) {
				Console.Write("in " + CName + " ");
				Statistics.ThrottledCount++;
				return false;
			}

			return true;
		}
Exemplo n.º 2
0
        public void Generate(StreamWriter sw)
        {
            string lname, call;

            if (parms != null)
            {
                parms.Validate();
                call  = "(" + parms.CallString + ")";
                lname = "(" + parms.NameString + ")";
            }
            else
            {
                call  = "(BUG);";
                lname = "THIS_IS_A_BUG";
            }

            string rettype = elem.GetAttribute("type");
            string name    = elem.GetAttribute("name");
            string s_ret   = SymbolTable.GetCSType(rettype);

            if (parms.UnknownTypes || s_ret == "_ERROR_")
            {
                Console.WriteLine("skipped: " + name);
                Statistics.IgnoreCount++;
                return;
            }

            if (s_ret == "void[]")
            {
                s_ret = "IntPtr";
            }

            sw.WriteLine("\t\t[DllImport(\"" + SymbolTable.GetDllName(ns) +
                         "\", CallingConvention=CallingConvention.Cdecl)]");
            sw.WriteLine("\t\tstatic extern " + s_ret + " " + name + " " + call + ";");

            sw.Write("\t\tpublic static " + s_ret + " ");
            sw.Write(name.TrimStart(ns.ToCharArray()) + " ");
            sw.WriteLine(call);
            sw.WriteLine("\t\t{");

            if (s_ret == "void")
            {
                sw.WriteLine("\t\t\t" + name + lname + ";");
            }
            else
            {
                sw.WriteLine("\t\t\treturn " + name + lname + ";");
            }

            sw.WriteLine("\t\t}");
            sw.WriteLine("");

            Statistics.FuncsCount++;
        }
Exemplo n.º 3
0
        public virtual bool Validate(LogWriter log)
        {
            log.Member = Name;
            if (!parms.Validate(log))
            {
                Statistics.ThrottledCount++;
                return(false);
            }

            return(true);
        }
Exemplo n.º 4
0
        public virtual bool Validate()
        {
            if (!Parameters.Validate())
            {
                Console.Write("in " + CName + " ");
                Statistics.ThrottledCount++;
                return(false);
            }

            return(true);
        }
Exemplo n.º 5
0
        public override bool Validate()
        {
            if (!parms.Validate() || !retval.Validate())
            {
                Console.Write("in virtual method " + Name + " ");
                vstate = ValidState.Invalid;
                return(false);
            }

            vstate = ValidState.Valid;
            return(true);
        }
Exemplo n.º 6
0
        public override bool Validate()
        {
            valid = true;
            LogWriter log = new LogWriter();

            log.Type = QualifiedName;
            if (!retval.Validate(log) || !parms.Validate(log))
            {
                Statistics.ThrottledCount++;
                valid = false;
            }

            return(valid);
        }
Exemplo n.º 7
0
 public bool Validate(LogWriter log)
 {
     log.Member = Name;
     if (Name == "")
     {
         log.Warn("Nameless signal found. Add name attribute with fixup.");
         Statistics.ThrottledCount++;
         return(false);
     }
     else if (!parms.Validate(log) || !retval.Validate(log))
     {
         Statistics.ThrottledCount++;
         return(false);
     }
     return(true);
 }
        public bool Validate()
        {
            if (Name == "")
            {
                Console.Write("Nameless signal ");
                Statistics.ThrottledCount++;
                return(false);
            }

            if (!parms.Validate() || !retval.Validate())
            {
                Console.Write(" in signal " + Name + " ");
                Statistics.ThrottledCount++;
                return(false);
            }

            return(true);
        }
Exemplo n.º 9
0
        public override bool Validate()
        {
            valid = true;
            LogWriter log = new LogWriter();

            log.Type = QualifiedName;
            if (!retval.Validate(log) || !parms.Validate(log))
            {
                Statistics.ThrottledCount++;
                valid = false;
            }

            if (!String.IsNullOrEmpty(retval.CountParameterName))
            {
                retval.CountParameter = parms.GetCountParameter(retval.CountParameterName);
            }

            return(valid);
        }
        public override bool Validate()
        {
            if (!retval.Validate())
            {
                Console.WriteLine("rettype: " + retval.CType + " in callback " + CName);
                Statistics.ThrottledCount++;
                valid = false;
                return(false);
            }

            if (!parms.Validate())
            {
                Console.WriteLine(" in callback " + CName);
                Statistics.ThrottledCount++;
                valid = false;
                return(false);
            }

            valid = true;
            return(true);
        }