Esempio n. 1
0
        public OffsetTable(ushort numOfTables)
        {
            this.sfntversion = (FIXED)0x00010000;
            this.numTables   = (USHORT)numOfTables;

            // searchRange, entrySelector の計算
            numOfTables >>= 1;
            ushort srange  = 0x10;
            ushort eselect = 0;

            while (numOfTables != 0)
            {
                numOfTables >>= 1;
                srange      <<= 1;
                eselect++;
            }
            this.searchRange   = (USHORT)srange;
            this.entrySelector = (USHORT)eselect;

            this.rangeShift = (USHORT)((ushort)this.numTables * (int)16 - srange);
        }
Esempio n. 2
0
 public static extern USHORT htons([In] USHORT hostshort);