Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages


home | help
cdk_util(3)		   Library Functions Manual		   cdk_util(3)

       cdk_util	- Cdk utility functions

       cc [ flag ... ] file ...	 -lcdk [ library ... ]

       #include	<cdk.h>

       int CDKgetDirectoryContents (
		      const char *directory,
		      char ***list);

       int CDKreadFile (
		      const char *filename,
		      char ***info);

       void alignxy ( WINDOW *window,
		      int *xpos,
		      int *ypos,
		      int boxWidth,
		      int boxHeight);

       chtype *char2Chtype (
		      const char *string,
		      int *length,
		      int *align);

       EDisplayType char2DisplayType (
		      const char *string);

       int checkForLink	(
		      const char *line,
		      char *filename);

       char *chtype2String (
		      const chtype *string);

       void deleteCursesWindow (
		      WINDOW *window);

       void eraseCursesWindow (
		      WINDOW *window);

       int getListIndex	(
		      CDKSCREEN	*screen,
		      const char *title,
		      CDK_CONST	char **list,
		      int listSize,
		      boolean numbers);

       char *getString ("
		      CDKSCREEN	*screen,
		      const char *title,
		      const char *label,
		      const char *init);

       int justifyString (
		      int fieldWidth,
		      int mesglen,
		      int justify);

       int mode2Filetype (
		      mode_t fileMode);

       void moveCursesWindow (
		      WINDOW *window,
		      int xdiff,
		      int ydiff);

       int popupDialog (
		      CDKSCREEN	*screen,
		      CDK_CONST	char **mesg,
		      int mesgCount,
		      CDK_CONST	char **buttons,
		      int buttonCount);

       void popupLabel (
		      CDKSCREEN	*win,
		      CDK_CONST	char **mesg,
		      int count);

       void popupLabelAttrib (
		      CDKSCREEN	*win,
		      CDK_CONST	char **mesg,
		      int count,
		      chtype attribute);

       char *selectFile	(
		      CDKSCREEN	*screen,
		      const char *title);

       int setWidgetDimension (
		      int parentDim,
		      int proposedDim,
		      int adjustment);

       void stripWhiteSpace (
		      EStripType stripType,
		      char *string);

       int viewFile ( CDKSCREEN	*screen,
		      const char *title,
		      const char *filename,
		      CDK_CONST	char **buttons,
		      int buttonCount);

       int viewInfo ( CDKSCREEN	*screen,
		      const char *title,
		      CDK_CONST	char **info,
		      int size,
		      CDK_CONST	char **buttons,
		      int buttonCount,
		      boolean interpret);

       These  are  utility  functions that one may use to initialize, build or
       customize widgets.

	    opens and reads the	contents of the	given directory,  filling  the
	    array  list	with the sorted	contents of the	directory.  If the di-
	    rectory cannot be opened then it returns a value of	-1.

	    Read the file filename, load the contents into a dynamically allo-
	    cated  array, storing its address via info.	 It returns the	number
	    of lines read if the file could be opened, -1 otherwise.

	    Aligns a box on the	given window with the height and width	given.
	    See	 cdk_position  (3)  for	 the interpretation of the xpos, ypos,
	    boxWidth and boxHeight, parameters.

	    Translate a	character string with embedded format  markers	(e.g.,
	    "</X/Y>Blah	Blah") to a null-terminated array of chtype's.

	    o	The length of the array	is stored via the length parameter.

	    o	The  align parameter contains justification information	(LEFT,

		The caller is responsible for freeing the result.

	    Lookup the given name in string and	return the equivalent  display
	    type.  See also cdk_display	(3).

	    Check if the given line is of the form

	    If so, extract the filename	from the line, storing it in the file-
	    name buffer	(which must hold  at  least  CDK_PATHMAX  characters).
	    Return nonzero if a	filename is extracted.

	    Extract the	characters and formatting information from a null-ter-
	    minated array of chtype's string.  A dynamically allocated	string
	    is returned.

	    Safely  delete a given window, i.e., first check if	the window pa-
	    rameter is nonnull.

	    Safely erase a given window, i.e., first check if the  window  pa-
	    rameter is nonnull.

	    Display  a	scrollable list	of strings in a	dialog,	allow the user
	    to select one.  Return the index in	the  list  of  the  value  se-

	    o	The  list parameter contains the strings to display; there are
		listSize strings in the	list.

	    o	If numbers is true, the	displayed list items will be numbered.

	    pops up an entry widget with

	    o	a title	supplied by the	value of the title parameter,

	    o	a label	supplied by the	label parameter, and

	    o	an initial value supplied by the initialValue parameter.

	    It returns a pointer to the	value typed in or NULL if  the	widget
	    was	exited early.

	    Given  a  string  length mesglen, the available field width	field-
	    Width and a	justification type justify, return the number of char-
	    acters by which to shift the string.

	    Given  a  file protection mode fileMode, return ignoring the file-
	    type bits, i.e., ignoring the corresponding	permissions data.

	    Move a given window	by the amounts in xdiff	and ydiff.

	    creates a quick pop-up dialog box.	Pass in

	    o	the message in the mesg	parameter,

	    o	the size of the	message	in the mesgCount parameter,

	    o	the button labels in the buttons parameter and

	    o	the number of buttons in the buttonCount parameter.

	    The	dialog box will	be centered on the screen.

	    creates a quick pop-up label widget.

	    The	message	and the	size of	the message are	passed in via the mesg
	    and	count parameters respectively.

	    The	label widget waits until the user hits a character and is cen-
	    tered on the screen.

	    Display a simple dialog with a list	of count message strings mesg.
	    Use	the given attribute for	the background of the dialog.

	    Display a file-selection dialog.  Return the selected filename, or
	    null if none is selected.  The  caller  should  free  the  return-

	    This  is  a	helper function	used to	set the	height/width of	a wid-

	    o	If the proposed	dimension proposedDim is FULL or zero, the re-
		turn value will	be parentDim.

	    o	If the proposed	dimension proposedDim is positive,

		o   and	it is larger than parentDim, return proposedDim,

		o   otherwise return proposedDim plus adjustment.

	    o	If  the	proposed dimension proposedDim is negative, the	return
		value will be parentDim	plus proposedDim.

	    o	Otherwise, the return value will be proposedDim.

	    Strip whitespace from the front and/or back	of the given string.

	    The	stripType parameter  controls  the  type  of  stripping	 done:
	    vFRONT, vBACK or vBOTH.

	    Read  the file specified by	filename and display it	in a CDKVIEWER
	    window.  The title,	buttons	and buttonCount	are applied to the CD-
	    KVIEWER window.

	    o	The  viewer  shows  the	 contents  of the file supplied	by the
		filename value.

	    o	The buttons on the file	viewer are supplied by the buttons pa-

	    It	returns	 the  index  of	the button selected, or	-1 if the file
	    does not exist or if the widget was	exited early.

	       |Strip_Type	| Result			      |
	       |vFRONT		| This tells the function  to  remove |
	       |		| all  of  the	white  space from the |
	       |		| front	of the given string.	      |
	       |vBACK		| This tells the function  to  remove |
	       |		| all  of  the	white  space from the |
	       |		| back of the given string.	      |
	       |vBOTH		| This tells the function  to  remove |
	       |		| all  of  the	white space from both |
	       |		| the front and	the back of the	given |
	       |		| string.			      |
	    Display  the  list	of strings in info in a	CDKVIEWER window.  The
	    number of strings is given by size.	 The title, buttons  and  but-
	    tonCount are applied to the	CDKVIEWER window.

       cdk_dialog (3), cdk_display (3),	cdk_position (3), cdk_misc (3).



Want to link to this manual page? Use this URL:

home | help