~ubuntu-branches/ubuntu/natty/ncurses/natty

« back to all changes in this revision

Viewing changes to form/frm_def.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-05-17 09:00:42 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070517090042-86fgxrr6j5jzagot
Tags: 5.6-0ubuntu1
* New upstream version.
  - Remove patches applied upstream: ncurses.upstream, signed-chars.
  - Update patches: debian-backspace.
* Build-depend on g++-multilib instead of lib{32,64}c*-dev-*.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/****************************************************************************
2
 
 * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc.              *
 
2
 * Copyright (c) 1998-2005,2006 Free Software Foundation, Inc.              *
3
3
 *                                                                          *
4
4
 * Permission is hereby granted, free of charge, to any person obtaining a  *
5
5
 * copy of this software and associated documentation files (the            *
32
32
 
33
33
#include "form.priv.h"
34
34
 
35
 
MODULE_ID("$Id: frm_def.c,v 1.17 2004/12/25 22:26:01 tom Exp $")
 
35
MODULE_ID("$Id: frm_def.c,v 1.20 2006/11/04 16:57:15 tom Exp $")
36
36
 
37
37
/* this can't be readonly */
38
38
static FORM default_form =
182
182
        page_nr++;
183
183
      fields[field_cnt]->form = form;
184
184
    }
185
 
  if (field_cnt == 0)
 
185
  if (field_cnt == 0 || (short)field_cnt < 0)
186
186
    RETURN(E_BAD_ARGUMENT);
187
187
 
188
188
  /* allocate page structures */
247
247
|                    If there are fields, position to first active field.
248
248
|
249
249
|   Return Values :  E_OK            - success
250
 
|                    any other       - error occurred
 
250
|                    E_BAD_ARGUMENT  - Invalid form pointer or field array
 
251
|                    E_CONNECTED     - a field is already connected
 
252
|                    E_SYSTEM_ERROR  - not enough memory
251
253
+--------------------------------------------------------------------------*/
252
 
INLINE static int
 
254
NCURSES_INLINE static int
253
255
Associate_Fields(FORM *form, FIELD **fields)
254
256
{
255
257
  int res = Connect_Fields(form, fields);
277
279
|   Description   :  Create new form with given array of fields.
278
280
|
279
281
|   Return Values :  Pointer to form. NULL if error occurred.
 
282
!                    Set errno:
 
283
|                    E_OK            - success
 
284
|                    E_BAD_ARGUMENT  - Invalid form pointer or field array
 
285
|                    E_CONNECTED     - a field is already connected
 
286
|                    E_SYSTEM_ERROR  - not enough memory
280
287
+--------------------------------------------------------------------------*/
281
288
NCURSES_EXPORT(FORM *)
282
289
new_form(FIELD **fields)
337
344
|   
338
345
|   Description   :  Set a new association of an array of fields to a form
339
346
|
340
 
|   Return Values :  E_OK              - no error
341
 
|                    E_BAD_ARGUMENT    - invalid form pointer
342
 
|                    E_POSTED          - form is posted
 
347
|   Return Values :  E_OK            - no error
 
348
|                    E_BAD_ARGUMENT  - Invalid form pointer or field array
 
349
|                    E_CONNECTED     - a field is already connected
 
350
|                    E_POSTED        - form is posted
 
351
|                    E_SYSTEM_ERROR  - not enough memory
343
352
+--------------------------------------------------------------------------*/
344
353
NCURSES_EXPORT(int)
345
354
set_form_fields(FORM *form, FIELD **fields)