diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2010-01-12 23:22:15 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2010-01-12 23:22:15 +0000 |
commit | 6ee254699bf787d78835419be2b3241fb037d444 (patch) | |
tree | 07fe67dab517e4990f344fe2c00e65cef4d25b81 /lib/libmenu/m_spacing.c | |
parent | 0b62f5dc36fc7203a74cdc812c4234ae188fdfd2 (diff) |
Update to ncurses 5.7, with local changes reapplied.
This is around eight years worth of changes (previously we were around ncurses
5.2), too many to list - many bug fixes and also a few new functions.
A major bump for libcurses, libpanel, libform and libmenu.
ok deraadt
Diffstat (limited to 'lib/libmenu/m_spacing.c')
-rw-r--r-- | lib/libmenu/m_spacing.c | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/lib/libmenu/m_spacing.c b/lib/libmenu/m_spacing.c index f31f928d3ae..d1ba795ddbe 100644 --- a/lib/libmenu/m_spacing.c +++ b/lib/libmenu/m_spacing.c @@ -1,7 +1,7 @@ -/* $OpenBSD: m_spacing.c,v 1.5 2001/01/22 18:02:06 millert Exp $ */ +/* $OpenBSD: m_spacing.c,v 1.6 2010/01/12 23:22:08 nicm Exp $ */ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,7 +29,7 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * ****************************************************************************/ /*************************************************************************** @@ -39,7 +39,7 @@ #include "menu.priv.h" -MODULE_ID("$From: m_spacing.c,v 1.12 2000/12/10 02:16:48 tom Exp $") +MODULE_ID("$Id: m_spacing.c,v 1.6 2010/01/12 23:22:08 nicm Exp $") #define MAX_SPC_DESC ((TABSIZE) ? (TABSIZE) : 8) #define MAX_SPC_COLS ((TABSIZE) ? (TABSIZE) : 8) @@ -49,15 +49,17 @@ MODULE_ID("$From: m_spacing.c,v 1.12 2000/12/10 02:16:48 tom Exp $") | Facility : libnmenu | Function : int set_menu_spacing(MENU *menu,int desc, int r, int c); | -| Description : Set the spacing between entried +| Description : Set the spacing between entries | | Return Values : E_OK - on success +--------------------------------------------------------------------------*/ NCURSES_EXPORT(int) -set_menu_spacing -(MENU *menu, int s_desc, int s_row, int s_col ) +set_menu_spacing(MENU * menu, int s_desc, int s_row, int s_col) { - MENU *m; /* split for ATAC workaround */ + MENU *m; /* split for ATAC workaround */ + + T((T_CALLED("set_menu_spacing(%p,%d,%d,%d)"), menu, s_desc, s_row, s_col)); + m = Normalize_Menu(menu); assert(m); @@ -65,19 +67,18 @@ set_menu_spacing RETURN(E_POSTED); if (((s_desc < 0) || (s_desc > MAX_SPC_DESC)) || - ((s_row < 0) || (s_row > MAX_SPC_ROWS)) || - ((s_col < 0) || (s_col > MAX_SPC_COLS))) + ((s_row < 0) || (s_row > MAX_SPC_ROWS)) || + ((s_col < 0) || (s_col > MAX_SPC_COLS))) RETURN(E_BAD_ARGUMENT); m->spc_desc = s_desc ? s_desc : 1; - m->spc_rows = s_row ? s_row : 1; - m->spc_cols = s_col ? s_col : 1; + m->spc_rows = s_row ? s_row : 1; + m->spc_cols = s_col ? s_col : 1; _nc_Calculate_Item_Length_and_Width(m); RETURN(E_OK); } - /*--------------------------------------------------------------------------- | Facility : libnmenu | Function : int menu_spacing (const MENU *,int *,int *,int *); @@ -87,15 +88,21 @@ set_menu_spacing | Return Values : E_OK - on success +--------------------------------------------------------------------------*/ NCURSES_EXPORT(int) -menu_spacing ( const MENU *menu, int* s_desc, int* s_row, int* s_col) +menu_spacing(const MENU * menu, int *s_desc, int *s_row, int *s_col) { - const MENU *m; /* split for ATAC workaround */ + const MENU *m; /* split for ATAC workaround */ + + T((T_CALLED("menu_spacing(%p,%p,%p,%p)"), menu, s_desc, s_row, s_col)); + m = Normalize_Menu(menu); assert(m); - if (s_desc) *s_desc = m->spc_desc; - if (s_row) *s_row = m->spc_rows; - if (s_col) *s_col = m->spc_cols; + if (s_desc) + *s_desc = m->spc_desc; + if (s_row) + *s_row = m->spc_rows; + if (s_col) + *s_col = m->spc_cols; RETURN(E_OK); } |