⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jwawinber.pas

📁 比较全面的win32api开发包
💻 PAS
📖 第 1 页 / 共 2 页
字号:
{******************************************************************************}
{                                                       	               }
{ Basic Encoding Rules API interface Unit for Object Pascal                    }
{                                                       	               }
{ Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft          }
{ Corporation. All Rights Reserved.                                            }
{ 								               }
{ The original file is: winber.h, released August 2001. The original Pascal    }
{ code is: WinBer.pas, released December 2000. The initial developer of the    }
{ Pascal code is Marcel van Brakel (brakelm@chello.nl).                        }
{                                                                              }
{ Portions created by Marcel van Brakel are Copyright (C) 1999-2001            }
{ Marcel van Brakel. All Rights Reserved.                                      }
{ 								               }
{ Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI)        }
{								               }
{ You may retrieve the latest version of this file at the Project JEDI home    }
{ page, located at http://delphi-jedi.org or my personal homepage located at   }
{ http://members.chello.nl/m.vanbrakel2                                        }
{								               }
{ The contents of this file are used with permission, subject to the Mozilla   }
{ Public License Version 1.1 (the "License"); you may not use this file except }
{ in compliance with the License. You may obtain a copy of the License at      }
{ http://www.mozilla.org/MPL/MPL-1.1.html                                      }
{                                                                              }
{ Software distributed under the License is distributed on an "AS IS" basis,   }
{ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
{ the specific language governing rights and limitations under the License.    }
{                                                                              }
{ Alternatively, the contents of this file may be used under the terms of the  }
{ GNU Lesser General Public License (the  "LGPL License"), in which case the   }
{ provisions of the LGPL License are applicable instead of those above.        }
{ If you wish to allow use of your version of this file only under the terms   }
{ of the LGPL License and not to allow others to use your version of this file }
{ under the MPL, indicate your decision by deleting  the provisions above and  }
{ replace  them with the notice and other provisions required by the LGPL      }
{ License.  If you do not delete the provisions above, a recipient may use     }
{ your version of this file under either the MPL or the LGPL License.          }
{ 								               }
{ For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
{ 								               }
{******************************************************************************}

unit JwaWinBer;

{$WEAKPACKAGEUNIT}

{$HPPEMIT ''}
{$HPPEMIT '#include "WinBer.h"'}
{$HPPEMIT ''}

{$I WINDEFINES.INC}

interface

uses
  JwaWinLDAP, JwaWinType;

const
  LBER_ERROR   = DWORD($ffffffff);
  {$EXTERNALSYM LBER_ERROR}
  LBER_DEFAULT = DWORD($ffffffff);
  {$EXTERNALSYM LBER_DEFAULT}

type
  ber_tag_t = Cardinal;   // for BER tags
  {$EXTERNALSYM ber_tag_t}
  ber_int_t = Integer;    // for BER ints, enums, and Booleans
  {$EXTERNALSYM ber_int_t}
  ber_uint_t = Cardinal;  // unsigned equivalent of ber_int_t
  {$EXTERNALSYM ber_uint_t}
  ber_slen_t = Integer;   // signed equivalent of ber_len_t
  {$EXTERNALSYM ber_slen_t}

//
// This constructs a new BerElement structure containing a copy of the
// data in the supplied berval structure.
//

function ber_init(pBerVal: PBerVal): PBerElement; cdecl;
{$EXTERNALSYM ber_init}

//
// This frees a BerElement which is returned from ber_alloc_t()
// or ber_init(). The second argument - fbuf should always be set
// to 1.
//
//

procedure ber_free(pBerElement: PBerElement; fbuf: Integer); cdecl;
{$EXTERNALSYM ber_free}

//
// Frees a BERVAL structure. Applications should not call
// this API to free BERVAL structures which they themselves
// have allocated
//

procedure ber_bvfree(pBerVal: PBerVal); cdecl;
{$EXTERNALSYM ber_bvfree}

//
// Frees an array of BERVAL structures.
//

procedure ber_bvecfree(pBerVal: PBerVal); cdecl;
{$EXTERNALSYM ber_bvecfree}

//
// Returns a copy of a the supplied berval structure
//

function ber_bvdup(pBerVal: PBerVal): PBerVal; cdecl;
{$EXTERNALSYM ber_bvdup}

//
// Constructs and returns a BerElement structure. The options field
// contains a bitwise-or of options which are to be used when generating
// the encoding of the BerElement
//
// The LBER_USE_DER options should always be specified.
//

function ber_alloc_t(options: Integer): PBerElement; cdecl;
{$EXTERNALSYM ber_alloc_t}

//
// This skips over the current tag and returns the tag of the next
// element in the supplied BerElement. The lenght of this element is
// stored in the pLen argument.
//
// LBER_DEFAULT is returned if there is no further data to be read
// else the tag of the next element is returned.
//
// The difference between ber_skip_tag() and ber_peek_tag() is that the
// state pointer is advanced past the first tag+lenght and is pointed to
// the value part of the next element
//

function ber_skip_tag(pBerElement: PBerElement; var pLen: ULONG): ULONG; cdecl;
{$EXTERNALSYM ber_skip_tag}

//
// This returns the tag of the next element to be parsed in the
// supplied BerElement. The length of this element is stored in the
// pLen argument.
//
// LBER_DEFAULT is returned if there is no further data to be read
// else the tag of the next element is returned.
//

function ber_peek_tag(pBerElement: PBerElement; var pLen: ULONG): ULONG; cdecl;
{$EXTERNALSYM ber_peek_tag}

//
// This returns the tag and length of the first element in a SET, SET OF
// or SEQUENCE OF data value.
//
// LBER_DEFAULT is returned if the constructed value is empty else, the tag
// is returned. It also returns an opaque cookie which has to be passed to
// subsequent invocations of ber_next_element().
//

function ber_first_element(pBerElement: PBerElement; var pLen: ULONG; var ppOpaque: PChar): ULONG; cdecl;
{$EXTERNALSYM ber_first_element}

//
// This positions the state at the start of the next element in the
// constructed type.
//
// LBER_DEFAULT is returned if the constructed value is empty else, the tag
// is returned.
//

function ber_next_element(pBerElement: PBerElement; var pLen: ULONG; opaque: PChar): ULONG; cdecl;
{$EXTERNALSYM ber_next_element}

//
// This allocates a BerVal structure whose contents are taken from the
// supplied BerElement structure.
//
// The return values are 0 on success and -1 on error.
//

function ber_flatten(pBerElement: PBerElement; var pBerVal: PBerVal): Integer; cdecl;
{$EXTERNALSYM ber_flatten}

(*
The ber_printf() routine is used to encode a BER element in much the
same way that sprintf() works.  One important difference, though, is
that state information is kept in the ber argument so that multiple
calls can be made to ber_printf() to append to the end of the BER ele-

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -