--------------------------------------------------------------------------- | Facility : libnform | Function : FORM *new_form( FIELD **fields ) | | Description : Create new form with given array of fields. | | Return Values : Pointer to form. NULL if error occurred. +--------------------------------------------------------------------------*/
| 274 | | |
| 275 | | Return Values : Pointer to form. NULL if error occurred. |
| 276 | +--------------------------------------------------------------------------*/ |
| 277 | FORM *new_form(FIELD ** fields) |
| 278 | { |
| 279 | int err = E_SYSTEM_ERROR; |
| 280 | |
| 281 | FORM *form = (FORM *)malloc(sizeof(FORM)); |
| 282 | |
| 283 | if (form) |
| 284 | { |
| 285 | *form = *_nc_Default_Form; |
| 286 | if ((err=Associate_Fields(form,fields))!=E_OK) |
| 287 | { |
| 288 | free_form(form); |
| 289 | form = (FORM *)0; |
| 290 | } |
| 291 | } |
| 292 | |
| 293 | if (!form) |
| 294 | SET_ERROR(err); |
| 295 | |
| 296 | return(form); |
| 297 | } |
| 298 | |
| 299 | /*--------------------------------------------------------------------------- |
no test coverage detected
searching dependent graphs…