Esempio n. 1
0
        /// <summary> Tcl_GetlongFromObj -> TclLong.get
        ///
        /// Returns the long value of the object.
        ///
        /// </summary>
        /// <param name="interp">current interpreter.
        /// </param>
        /// <param name="tobj">the object to operate on.
        /// </param>
        /// <returns> the long value of the object.
        /// </returns>

        public static long get(Interp interp, TclObject tobj)
        {
            setlongFromAny(interp, tobj);
            TclLong tlong = (TclLong)tobj.InternalRep;

            return(tlong.value);
        }
Esempio n. 2
0
 public static void Tcl_SetLongObj(TclObject to, long result)
 {
     while (to.Shared)
     {
         to.Release();
     }
     TclLong.set(to, result);
     to.Preserve();
 }
Esempio n. 3
0
 public static bool Tcl_GetLong(Interp interp, TclObject to, out i64 value)
 {
     try
     {
         value = (i64)TclLong.get(interp, to);
         return(false);
     }
     catch
     {
         value = 0;
         return(true);
     }
 }
Esempio n. 4
0
 public static bool Tcl_GetWideIntFromObj(Interp interp, TclObject to, out sqlite_int64 value)
 {
     try
     {
         if (to.ToString() == "NaN")
         {
             unchecked
             {
                 value = (long)Double.NaN;
             }
         }
         else
         {
             value = TclLong.get(interp, to);
         }
         return(false);
     }
     catch
     {
         value = 0;
         return(true);
     };
 }
Esempio n. 5
0
 public static TclObject Tcl_NewWideIntObj(long value)
 {
     return(TclLong.newInstance(value));
 }