示例#1
0
        private BDbcMethods(IntPtr pdbc, BDbOffsetOf offsetOf, BerkeleyDbType dbType)
        {
            _offsetOf = offsetOf;
            _dbType   = dbType;

            foreach (BDbOffsetOfItem offsetOfItem in offsetOf.Dbc)
            {
                IntPtr funcptr = Marshal.ReadIntPtr(pdbc + offsetOfItem.Offset);
                switch (offsetOfItem.Name)
                {
                case "close":
                    _close = (close)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(close));
                    break;

                case "del":
                    _del = (del)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(del));
                    break;

                case "get":
                    _get = (get)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(get));
                    break;

                case "put":
                    _put = (put)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(put));
                    break;
                }
            }
        }
示例#2
0
        private BDbcMethods(IntPtr pdbc, BDbOffsetOf offsetOf, BerkeleyDbType dbType)
        {
            _offsetOf = offsetOf;
            _dbType = dbType;

            foreach (BDbOffsetOfItem offsetOfItem in offsetOf.Dbc)
            {
                IntPtr funcptr = Marshal.ReadIntPtr(pdbc + offsetOfItem.Offset);
                switch (offsetOfItem.Name)
                {
                    case "close":
                        _close = (close)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(close));
                        break;
                    case "del":
                        _del = (del)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(del));
                        break;
                    case "get":
                        _get = (get)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(get));
                        break;
                    case "put":
                        _put = (put)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(put));
                        break;
                }
            }
        }
示例#3
0
        private BDbMethods(IntPtr pdb, BDbOffsetOf offsetOf, BerkeleyDbType dbType)
        {
            _dbType   = dbType;
            _offsetOf = offsetOf;

            foreach (BDbOffsetOfItem offsetOfItem in offsetOf.Db)
            {
                IntPtr funcptr = Marshal.ReadIntPtr(pdb + offsetOfItem.Offset);
                switch (offsetOfItem.Name)
                {
                case "close":
                    _close = (close)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(close));
                    break;

                case "cursor":
                    _cursor = (cursor)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(cursor));
                    break;

                case "del":
                    _del = (del)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(del));
                    break;

                case "get_pagesize":
                    _get_pagesize = (get_pagesize)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(get_pagesize));
                    break;

                case "open":
                    _open = (open)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(open));
                    break;

                case "put":
                    _put = (put)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(put));
                    break;

                case "set_flags":
                    _set_flags = (set_flags)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(set_flags));
                    break;
                }
            }
        }
示例#4
0
        private BDbMethods(IntPtr pdb, BDbOffsetOf offsetOf, BerkeleyDbType dbType)
        {
            _dbType = dbType;
            _offsetOf = offsetOf;

            foreach (BDbOffsetOfItem offsetOfItem in offsetOf.Db)
            {
                IntPtr funcptr = Marshal.ReadIntPtr(pdb + offsetOfItem.Offset);
                switch (offsetOfItem.Name)
                {
                    case "close":
                        _close = (close)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(close));
                        break;
                    case "cursor":
                        _cursor = (cursor)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(cursor));
                        break;
                    case "del":
                        _del = (del)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(del));
                        break;
                    case "get_pagesize":
                        _get_pagesize = (get_pagesize)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(get_pagesize));
                        break;
                    case "open":
                        _open = (open)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(open));
                        break;
                    case "put":
                        _put = (put)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(put));
                        break;
                    case "set_flags":
                        _set_flags = (set_flags)Marshal.GetDelegateForFunctionPointer(funcptr, typeof(set_flags));
                        break;
                }
            }
        }