AcePerl
view release on metacpan or search on metacpan
=head2 auto_save()
Sets or queries the I<auto_save> variable. If true, the "save"
command will be issued automatically before the connection to the
database is severed. The default is true.
Examples:
$db->auto_save(1);
$flag = $db->auto_save;
=head2 error() method
Ace->error;
This returns the last error message. Like UNIX errno, this variable
is not reset between calls, so its contents are only valid after a
method call has returned a result value indicating a failure.
For your convenience, you can call error() in any of several ways:
Ace/Browser/AceSubs.pm view on Meta::CPAN
$object_count The number of objects that opening the section will reveal
$add_plural If true, the label will be pluralized when
appropriate
$add_count If true, the label will have the object count added
when appropriate
In a scalar context, Toggle() prints the link HTML and returns a
boolean flag. A true result indicates that the section is expanded
and should be generated. A false result indicates that the section is
collapsed.
In a list context, Toggle() returns a two-element list. The first
element is the HTML link that expands and contracts the section. The
second element is a boolean that indicates whether the section is
currently open or closed.
This example indicates typical usage:
Ace/Local.pm view on Meta::CPAN
=head2 auto_save()
Sets or queries the I<auto_save> variable. If true, the "save"
command will be issued automatically before the connection to the
database is severed. The default is true.
Examples:
$accessor->auto_save(1);
$flag = $accessor->auto_save;
=head1 SEE ALSO
L<Ace>, L<Ace::Object>, L<Ace::Iterator>, L<Ace::Model>
=head1 AUTHOR
Lincoln Stein <lstein@w3.org> with extensive help from Jean
Thierry-Mieg <mieg@kaa.crbm.cnrs-mop.fr>
acelib/arraysub.c view on Meta::CPAN
/* perfmeters */
int assBounce = 0, assFound = 0, assNotFound = 0, assInserted = 0, assRemoved = 0 ;
/* Associator package is for associating pairs of pointers.
Assumes that an "in" item is non-zero and non -1.
Implemented as a hash table of size 2^m.
Originally grabbed from Steve Om's sather code by Richard Durbin.
Entirelly rewritten by mieg, using bouncing by relative primes
and deletion flagging.
User has access to structure member ->n = # of pairs
*/
#define VSIZE (sizeof(void*))
#define VS5 (VSIZE/5)
#define VS7 (VSIZE/7)
#define moins_un ((void*) (-1))
#define HASH(_xin) { register long z = VS5, x = (char*)(_xin) - (char*)0 ; \
acelib/menu.c view on Meta::CPAN
messfree (item) ;
return TRUE ;
}
BOOL menuSelectItem (MENUITEM item)
{
BOOL changed = FALSE ;
if (item->flags & (MENUFLAG_DISABLED | MENUFLAG_SPACER))
return FALSE ;
if (item->func) /* call back user with old flags state */
(*item->func)(item) ;
else if (item->call)
call (item->call, item) ;
if (item->flags & MENUFLAG_TOGGLE)
{ item->flags ^= MENUFLAG_TOGGLE_STATE ;
changed = TRUE ;
}
else if (!(item->flags & MENUFLAG_RADIO_STATE))
{ MENUITEM first, last ;
for (first = item ;
first && !(first->flags & MENUFLAG_START_RADIO) ;
first = first->up) ;
for (last = item ;
last && !(last->flags & MENUFLAG_END_RADIO) ;
last = last->down) ;
if (first && last)
{ while (first != last)
{ first->flags &= ~MENUFLAG_RADIO_STATE ;
first = first->down ;
}
item->flags |= MENUFLAG_RADIO_STATE ;
changed = TRUE ;
}
}
return changed ;
}
/***************** set item properties *******************/
BOOL menuSetCall (MENUITEM item, char *callName)
{ if (!item || !callExists (callName)) return FALSE ;
item->call = callName ; return TRUE ;
}
BOOL menuSetFunc (MENUITEM item, MENUFUNCTION func)
{ if (!item) return FALSE ;
item->func = func ; return TRUE ;
}
BOOL menuSetFlags (MENUITEM item, unsigned int flags)
{ if (!item) return FALSE ;
item->flags |= flags ; return TRUE ;
}
BOOL menuUnsetFlags (MENUITEM item, unsigned int flags)
{ if (!item) return FALSE ;
item->flags &= ~flags ; return TRUE ;
}
BOOL menuSetValue (MENUITEM item, int value)
{ if (!item) return FALSE ;
item->value = value ; return TRUE ;
}
BOOL menuSetPtr (MENUITEM item, void *ptr)
{ if (!item) return FALSE ;
item->ptr = ptr ; return TRUE ;
acelib/menu.c view on Meta::CPAN
BOOL menuSetMenu (MENUITEM item, MENU menu)
{ if (!item || !menu) return FALSE ;
item->submenu = menu ; return TRUE ;
}
/***************** get item properties *******************/
unsigned int menuGetFlags (MENUITEM item)
{ if (!item) return 0 ;
return item->flags ;
}
int menuGetValue (MENUITEM item)
{ if (!item) return 0 ;
return item->value ;
}
void* menuGetPtr (MENUITEM item)
{ if (!item) return 0 ;
return item->ptr ;
acelib/menu.c view on Meta::CPAN
void menuSuppress (MENU menu, char *string)
{
BOOL inBlock = FALSE ;
BOOL hide = FALSE ;
MENUITEM item ;
for (item = menu->items ; item ; item = item->down)
{ if (!inBlock && !strcmp (item->label, string))
hide = TRUE ;
if (hide)
item->flags |= MENUFLAG_HIDE ;
if (item->flags & MENUFLAG_SPACER)
{ inBlock = FALSE ;
hide = FALSE ;
}
else
inBlock = TRUE ;
}
}
void menuRestore (MENU menu, char *string)
{
BOOL inBlock = FALSE ;
BOOL unHide = FALSE ;
MENUITEM item ;
for (item = menu->items ; item ; item = item->down)
{ if (!inBlock && !strcmp (item->label, string))
unHide = TRUE ;
if (unHide)
item->flags &= ~MENUFLAG_HIDE ;
if (item->flags & MENUFLAG_SPACER)
{ inBlock = FALSE ;
unHide = FALSE ;
}
else
inBlock = TRUE ;
}
}
#if !defined(MACINTOSH)
void menuSpacer (void) { return ; }
acelib/wh/menu.h view on Meta::CPAN
#define MENU_DEFINED
typedef void *MENU, *MENUITEM ; /* public handles */
typedef void (*MENUFUNCTION)(MENUITEM) ;
#endif
typedef struct menuspec
{ MENUFUNCTION f ; /* NB can be 0 if using menuSetCall() below */
char *text ;
} MENUSPEC ;
/********** MENUITEM flags ***********/
#define MENUFLAG_DISABLED 0x01
#define MENUFLAG_TOGGLE 0x02
#define MENUFLAG_TOGGLE_STATE 0x04
#define MENUFLAG_START_RADIO 0x08
#define MENUFLAG_END_RADIO 0x10
#define MENUFLAG_RADIO_STATE 0x20
#define MENUFLAG_SPACER 0x40
#define MENUFLAG_HIDE 0x80
acelib/wh/menu.h view on Meta::CPAN
BOOL menuDeleteItem (MENU menu, char *label) ;
/* also destroys item */
BOOL menuSelectItem (MENUITEM item) ;
/* triggers a call back and adjusts toggle/radio states */
/* returns true if states changed - mostly for graph library to use */
/* calls to set properties of items */
/* can use by name e.g. menuSetValue (menuItem (menu, "Frame 3"), 3) */
BOOL menuSetCall (MENUITEM item, char *callName) ;
BOOL menuSetFunc (MENUITEM item, MENUFUNCTION func) ;
BOOL menuSetFlags (MENUITEM item, unsigned int flags) ;
BOOL menuUnsetFlags (MENUITEM item, unsigned int flags) ;
BOOL menuSetValue (MENUITEM item, int value) ;
BOOL menuSetPtr (MENUITEM item, void *ptr) ;
BOOL menuSetMenu (MENUITEM item, MENU menu) ; /* pulldown for boxes */
/* and to get properties */
unsigned int menuGetFlags (MENUITEM item) ;
int menuGetValue (MENUITEM item) ;
void* menuGetPtr (MENUITEM item) ;
/* extra routines */
acelib/wh/menu_.h view on Meta::CPAN
#ifndef DEF_MENU_H
typedef struct MenuStruct *MENU ;
typedef struct MenuItemStruct *MENUITEM ;
typedef void (*MENUFUNCTION)(MENUITEM) ;
#define MENU_DEFINED
struct MenuItemStruct {
char* label ;
MENUFUNCTION func ;
unsigned int flags ;
char* call ;
int value ;
void* ptr ;
MENU submenu ;
MENUITEM up, down ;
} ;
struct MenuStruct {
char *title ;
MENUITEM items ;
acelib/wmake/IBM_4_DEF view on Meta::CPAN
NAME = IBM
COMPILER = xlc -DACEDB4 -D_ALL_SOURCE
LINKER = xlc
LIBS = -lm
.c.o:
$(CC) -c $*.c
# -D_ALL_SOURCE: flag needed by xlc compiler in /usr/include
#################################################################
#################################################################
docs/ACEDB.HOWTO view on Meta::CPAN
the service chosen in (a) containing these contents:
# file: elegans
# default: on
# description: C. elegans acedb database
service elegans
{
disable = no
protocol = tcp
socket_type = stream
flags = REUSE
wait = yes
user = acedb
group = acedb
log_on_success += USERID DURATION
log_on_failure += USERID HOST
server = /usr/local/acedb/bin/saceserver
server_args = /usr/local/acedb/elegans
}
Change the line "service elegans" to be the symbolic name chosen
( run in 0.769 second using v1.01-cache-2.11-cpan-94b05bcf43c )