WinDom: Data Library

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

# Data Library
[Reference documentation]

To link data to windows. More...

## Functions
int | mt_DataAttach (APPvar *app, WINDOW *win, long magic, void *data)
| Insert a data into a window or into the application.
int | mt_DataDelete (APPvar *app, WINDOW *win, long magic)
| Remove a data linked into a window or into the application.
void * | mt_DataSearch (APPvar *app, WINDOW *win, long magic)
| Search data linked into a window or application.

## Detailed Description

To link data to windows.

## Function Documentation

int mt_DataAttach | ( | APPvar * | app,
|  | WINDOW * | win,
|  | long | magic,
|  | void * | data
| ) |

  | Insert a data into a window or into the application. Parameters:
  | app | application descriptor,
  | win | window descriptor or NULL,
  | magic | a unique magic number identifying data,
  | data | address of data to attach.
Returns: A value of 0 on success, or 1 in the replacement case. Negative error code. Insert data into the window data list or into the application if win is set to NULL. Data linked to application are globals. In case the magic data is already present its value is replaced and the function returns 1. Some magic number are reserved by WinDom (because some predefined windows, such as form, use data). See WinDom header file (they have a WD_ prefix). See also: mt_DataSearch(), mt_DataDelete().

int mt_DataDelete | ( | APPvar * | app,
|  | WINDOW * | win,
|  | long | magic
| ) |

  | Remove a data linked into a window or into the application. Parameters:
  | app | application descriptor,
  | win | window descriptor or NULL,
  | magic | magic number identifying data,
Returns: A value of 0 on success or E_NOTFOUND when the magic data item is not found. Remove the magic data item from the window data list or the application data list if win if set to NULL. See also: mt_DataAttach(), mt_DataSearch().

void* mt_DataSearch | ( | APPvar * | app,
|  | WINDOW * | win,
|  | long | magic
| ) |

  | Search data linked into a window or application. Parameters:
  | app | application descriptor,
  | win | window descriptor or NULL,
  | magic | a magic number identifying data,
Returns: the data attached for the magic id, or NULL if not found. Window magic value data search. If win is set to NULL, data will find into the application data list. See also: mt_DataAttach(), mt_DataDelete().