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

📄 ldap_entry2text.3

📁 开放源码的ldap系统
💻 3
字号:
.TH LDAP_ENTRY2TEXT 3 "22 September 1998" "OpenLDAP LDVERSION".\" $OpenLDAP: pkg/ldap/doc/man/man3/ldap_entry2text.3,v 1.2.12.1 2000/06/13 17:57:12 kurt Exp $.\" Copyright 1998-2000 The OpenLDAP Foundation All Rights Reserved..\" Copying restrictions apply.  See COPYRIGHT/LICENSE..SH NAMEldap_entry2text, ldap_entry2text_search, ldap_vals2text \- LDAP entry display routines.SH SYNOPSIS.nf.ft B#include <ldap.h>#include <disptmpl.h>.ft.LP.ft Bint ldap_entry2text( ld, buf, entry, tmpl, defattrs, defvals, writeproc,    writeparm, eol, rdncount, opts ).ft	LDAP			*ld;	char			*buf;	LDAPMessage		*entry;	struct ldap_disptmpl	*tmpl;	char			**defattrs;	char			***defvals;	int			(*writeproc)();	void			*writeparm;	char			*eol;	int			rdncount;	unsigned long		opts;.LP.ft Bint ldap_entry2text_search( ld, entry, tmpllist, defattrs, defvals,    writeproc, writeparm, eol, rdncount, opts ).ft	LDAP			*ld;	char			*dn;	char			*base;	LDAPMessage		*entry;	struct ldap_disptmpl	*tmpllist;	char			**defattrs;	char			***defvals;	int			(*writeproc)();	void			*writeparm;	char			*eol;	int			rdncount;	unsigned long		opts;.LP.ft Bint ldap_vals2text( ld, buf, vals, label, labelwidth, syntaxid, writeproc,    writeparm, eol, rdncount ).ft	LDAP			*ld;	char			*buf;	char			**vals;	char			*label;	int			labelwidth;	unsigned long		syntaxid;	int			(*writeproc)();	void			*writeparm;	char			*eol;	int			rdncount;.LP.ft Bint ldap_entry2html( ld, buf, entry, tmpl, defattrs, defvals, writeproc,    writeparm, eol, rdncount, opts ).ft	LDAP			*ld;	char			*buf;	LDAPMessage		*entry;	struct ldap_disptmpl	*tmpl;	char			**defattrs;	char			***defvals;	int			(*writeproc)();	void			*writeparm;	char			*eol;	int			rdncount;	unsigned long		opts;	char			*urlprefix;	char			*base;.LP.ft Bint ldap_entry2html_search( ld, entry, tmpllist, defattrs, defvals,    writeproc, writeparm, eol, rdncount, opts ).ft	LDAP			*ld;	char			*dn;	LDAPMessage		*entry;	struct ldap_disptmpl	*tmpllist;	char			**defattrs;	char			***defvals;	int			(*writeproc)();	void			*writeparm;	char			*eol;	int			rdncount;	unsigned long		opts;	char			*urlprefix;.LP.ft Bint ldap_vals2html( ld, buf, vals, label, labelwidth, syntaxid, writeproc,    writeparm, eol, rdncount ).ft	LDAP			*ld;	char			*buf;	char			**vals;	char			*label;	int			labelwidth;	unsigned long		syntaxid;	int			(*writeproc)();	void			*writeparm;	char			*eol;	int			rdncount;	char			*urlprefix;.LP.ft B#define LDAP_DISP_OPT_AUTOLABELWIDTH	0x00000001#define LDAP_DISP_OPT_HTMLBODYONLY      0x00000002#define LDAP_DTMPL_BUFSIZ		2048.ft.fi.SH DESCRIPTIONThese functions use the LDAP display template routines (seeldap_disptmpl(3) and ldap_templates.conf(5)) to produce a plain textor an HyperText Markup Language (HTML) display of an entry or a set ofvalues.  Typical plain text output produced for an entry might look like:.nf    "Barbara J Jensen, Information Technology Division"     Also Known As:		   Babs Jensen		   Barbara Jensen		   Barbara J Jensen     E-Mail Address:		   bjensen@terminator.rs.itd.umich.edu     Work Address: 		   535 W. William 		   Ann Arbor, MI 48103     Title:        		   Mythical Manager, Research Systems     ....fiThe exact output produced will depend on the display template configuration.HTML output is similar to the plain text output, but more richly formatted..LP.B ldap_entry2text(\|)produces a text representation of.I entryand writes the text by calling the.I writeprocfunction.  All of the attributes values to be displayed must be presentin.I entry;no interaction with the LDAP server will be performed within.B ldap_entry2text..I ld is the LDAP pointer obtained by a previous call to.B ldap_open..I writeprocshould be declared as:.LP.ft B.nfint writeproc( writeparm, p, len ).ft	void		*writeparm;	char		*p;	int		len;.fi.LPwhere.I pis a pointer to text to be written and.I lenis the length of the text..I pis guaranteed to be zero-terminated.  Lines of text are terminatedwith the string.I eol..I bufis a pointer to a buffer of size.B LDAP_DTMPL_BUFSIZor larger.  If.I buf is.B NULLthen a buffer is allocated and freed internally..I tmplis a pointer to the display template to be used (usually obtained by calling.B ldap_oc2template).If.I tmplis NULL,no template is used and a generic display is produced..I defattrsis a NULL-terminated array of LDAP attribute names which you wish toprovide default values for (only used if.I entrycontains no values for the attribute).  An array of NULL-terminated arrays ofdefault values corresponding to the attributes should be passed in.I defvals.  The.I rdncountparameter is used to limit the number of Distinguished Name (DN) componentsthat are actually displayed for DN attributes.  If.I rdncountis zero, all components are shown..I optsis used to specify output options.  The only values currently allowedare zero (default output),.B LDAP_DISP_OPT_AUTOLABELWIDTHwhich causes the width for labels to be determined based on the longestlabel in.I tmpl, and.B LDAP_DISP_OPT_HTMLBODYONLY.The .B LDAP_DISP_OPT_HTMLBODYONLYoption instructs the library not to include <HTML>, <HEAD>, <TITLE>, and<BODY> tags.  In other words, an HTML fragment is generated, and thecaller is responsible for prepending and appending the appropriate HTMLtags to construct a correct HTML document..LP.B ldap_entry2text_search(\|)is similar to.B ldap_entry2text,and all of the like-named parameters have the same meaning except as notedbelow.  If.I baseis not NULL, it is the search base to use when executing search actions.  Ifit is NULL, search action template items are ignored.  If.I entryis not NULL, it should contain the.I objectClassattribute values for the entry to be displayed.  If.I entryis NULL,.I dnmust not be NULL, and .B ldap_entry2text_searchwill retrieve the objectClass values itself by calling.B ldap_search_s..B ldap_entry2text_searchwill determine the appropriate display template to use by calling.B ldap_oc2template,and will call.B ldap_search_sto retrieve any attribute values to be displayed.  The.I tmpllistparameter is a pointer to the entire list of templates available (usuallyobtained by calling.B ldap_init_templatesor.B ldap_init_templates_buf).If.I tmpllistis NULL,.B ldap_entry2text_searchwill attempt to read a load templates from the default template configurationfile ETCDIR/ldaptemplates.conf..LP.B ldap_vals2textproduces a text representation of a single set of LDAP attribute values.  The.I ld,.I buf,.I writeproc,.I writeparm,.I eol,and.I rdncountparameters are the same as the like-named parameters for.B ldap_entry2text..I valsis a NULL-terminated list of values, usually obtained by a call to.B ldap_get_values..I labelis a string shown next to the values (usually a friendly form of anLDAP attribute name)..I labelwidthspecifies the label margin, which is the number of blank spaces displayedto the left of the values.  If zero is passed, a default label width isused..I syntaxidis a display template attribute syntax identifier (see ldap_disptmpl(3)for a list of the pre-defined .B LDAP_SYN_...values)..LP.B ldap_entry2htmlproduces an HTML representation of .I entry.It behaves exactly like ldap_entry2text(3), except for the formatted outputand the addition of two parameters..I urlprefixis the starting text to use when constructing an LDAP URL.  The default isthe string.I ldap:///The second additional parameter,.I base,the search base to use when executing search actions.  If it is NULL, searchaction template items are ignored..LP.B ldap_entry2html_searchbehaves exactly like ldap_entry2text_search(3), except HTML output is producedand one additional parameter is required..I urlprefixis the starting text to use when constructing an LDAP URL.  The default isthe string.I ldap:///.LP.B ldap_vals2htmlbehaves exactly like ldap_vals2text, except HTML output is producedand one additional parameter is required..I urlprefixis the starting text to use when constructing an LDAP URL.  The default isthe string.I ldap:///.SH ERRORSThese routines all return an LDAP error code (LDAP_SUCCESS is returnedif no error occurs).  See ldap_error(3) for details. The.I ld_errnofield of the.I ldparameter is also set to indicate the error..SH FILESETCDIR/ldaptemplates.conf.SH SEE ALSO.BR ldap (3),.BR ldap_disptmpl (3),.BR ldaptemplates.conf (5).SH ACKNOWLEDGEMENTS.B	OpenLDAPis developed and maintained by The OpenLDAP Project (http://www.openldap.org/)..B	OpenLDAPis derived from University of Michigan LDAP 3.3 Release.  

⌨️ 快捷键说明

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