view release on metacpan or search on metacpan
PREINIT:
d_LN_XSVARS;
LN_Acl_Impl * a_impl;
int i;
LN_RoleName role_name;
int len;
char* role;
ALIAS:
acl = 0
get_acl = 1
PPCODE:
Newz( 1, a_impl, sizeof(LN_Acl_Impl), LN_Acl_Impl );
if (a_impl==A_NO_MEM) { LN_SET_NOT_OK(db); XSRETURN_NOT_OK; }
LN_STAT(db) = NSFDbReadACL( (DBHANDLE) LN_H(db), &(a_impl->h) );
if ( LN_IS_NOT_OK ) { Safefree(a_impl); XSRETURN_NOT_OK; }
/* get all privilege _and_ role names */
for ( i = 0; i < ACL_PRIVCOUNT; i++) {
PROTOTYPES: DISABLE
void
DESTROY( a )
LN_Acl * a;
PREINIT:
d_LN_XSVARS;
LN_Acl_Impl* a_impl;
HANDLE a_h;
PPCODE:
a_impl = (LN_Acl_Impl*) LN_H(a);
a_h = a_impl->h;
OSMemFree( a_h ); /* OSMemFree() _always_ returns NO_ERROR */
Safefree( a_impl );
XSRETURN( 0 );
void
save( a )
LN_Acl * a;
PREINIT:
d_LN_XSVARS;
LN_Acl_Impl* a_impl;
HANDLE a_h;
PPCODE:
a_impl = (LN_Acl_Impl*) LN_H(a);
a_h = a_impl->h;
LN_STAT(a) = NSFDbStoreACL( (DBHANDLE)
LN_PARENT_H(a),
a_h,
0L, /* reserved: not yet used */
0L /* store existing ACL */
);
XSRETURN( 0 );
void
has_entryname( a, name )
LN_Acl * a;
char * name;
PREINIT:
d_LN_XSVARS;
LN_Acl_Impl* a_impl;
HANDLE a_h;
LN_Acl_EnumEntry ln_e;
PPCODE:
a_impl = (LN_Acl_Impl*) LN_H(a);
a_h = a_impl->h;
LN_STAT(a) =
DNCanonicalize( 0L, NULL, name, ln_e.name, MAXUSERNAME, NULL );
if ( LN_IS_NOT_OK ) { XSRETURN_NOT_OK; }
ln_e.found = LN_NOT_OK;
ln_e.stat = LN_OK;
void
all_entrynames( a )
LN_Acl * a;
PREINIT:
d_LN_XSVARS;
LN_Acl_Impl* a_impl;
HANDLE a_h;
int sp_i;
LN_Acl_EnumEntry ln_e;
PPCODE:
a_impl = (LN_Acl_Impl*) LN_H(a);
a_h = a_impl->h;
sp_i = 0;
ln_stat = LN_OK;
ln_e.sp = SP; /* we avoid using PUTBACK instead, */
ln_e.items = sp_i; /* cause it adjusts _global_ stack ptr*/
ln_e.stat = ln_stat;
ln_e.obj = a;
LN_Acl_Impl* a_impl;
HANDLE a_h;
int i = 0;
int sp_i = 0;
LN_RoleName role;
int min_role;
int max_role;
ALIAS:
all_roles = 0
all_privs = 1
PPCODE:
a_impl = (LN_Acl_Impl*) LN_H(a);
a_h = a_impl->h;
switch ( ix ) {
case 0: min_role=a_impl->r1;max_role=a_impl->rn + 1; break;
case 1: min_role=0; max_role=ACL_BITPRIVCOUNT;break;
default: min_role=a_impl->r1;max_role=a_impl->rn + 1; break;
}
for ( LN_SET_OK(a), i = min_role; i < max_role; i++ ) {
d_LN_XSVARS;
LN_Acl_Impl * a_impl;
HANDLE a_h;
int i;
int len;
LN_RoleName role;
int is_role;
int is_priv;
int found;
int not_found;
PPCODE:
a_impl = (LN_Acl_Impl*) LN_H(a);
a_h = a_impl->h;
len = strlen( name );
len = ( len < ACL_PRIVNAMEMAX ) ? len : ACL_PRIVNAMEMAX - 1;
strncpy( role, name, len );
role[ len ] = '\0'; /* truncate to len */
role[ ACL_PRIVNAMEMAX-1 ] = '\0'; /* safeguard */
i = ln_role_exists( a_impl, role, is_role, is_priv );
int is_priv;
int found;
int not_found;
ALIAS:
has_all_roles = 0
has_any_roles = 1
has_no_roles = 2
has_all_privs = 3
has_any_privs = 4
has_no_privs = 5
PPCODE:
a_impl = (LN_Acl_Impl*) LN_H(a);
a_h = a_impl->h;
if ( items <= 1 ) { XSRETURN( 0 ); }
for ( LN_SET_OK(a), j = 1; j < items; j++ ) {
name = SvPV( ST( j ), a );
len = strlen( name );
len = ( len < ACL_PRIVNAMEMAX ) ? len : ACL_PRIVNAMEMAX - 1;
char * name;
int len;
LN_RoleName role;
int is_role;
int is_priv;
ALIAS:
add_roles = 0
add_privs = 1
remove_roles = 2
remove_privs = 3
PPCODE:
a_impl = (LN_Acl_Impl*) LN_H(a);
a_h = a_impl->h;
if ( items <= 1 ) { XSRETURN( 0 ); }
for ( LN_SET_OK(a), j = 1; j < items; j++ ) {
name = SvPV( ST( j ), na );
len = strlen( name );
len = ( len < ACL_PRIVNAMEMAX ) ? len : ACL_PRIVNAMEMAX - 1;
int j;
char * name;
int len;
LN_RoleName old_role;
LN_RoleName new_role;
int is_role;
int is_priv;
ALIAS:
rename_roles = 0
rename_privs = 1
PPCODE:
a_impl = (LN_Acl_Impl*) LN_H(a);
a_h = a_impl->h;
if ( items <= 2 ) { XSRETURN(0); }
if ( items % 2 == 0 ) { items -= 1; } /*old/new pairs!*/
for ( LN_SET_OK(a), j = 1; j < items; j += 2 ) {
name = SvPV( ST( j + 1 ), na );
len = strlen( name );
LN_RoleName role;
int min_role;
int max_role;
ALIAS:
dbg_all_privroles = 0
dbg_all_privrolebits = 1
dbg_roles_r1 = 2
dbg_roles_rn = 3
dbg_roles_r1_free = 4
dbg_roles_rn_free = 5
PPCODE:
a_impl = (LN_Acl_Impl*) LN_H(a);
a_h = a_impl->h;
switch ( ix ) {
case 5: XSRETURN_IV( a_impl->rn_free ); break;
case 4: XSRETURN_IV( a_impl->r1_free ); break;
case 3: XSRETURN_IV( a_impl->rn ); break;
case 2: XSRETURN_IV( a_impl->r1 ); break;
case 1: XPUSHs(sv_2mortal(newSVpv(
(char *)&(a_impl->rolebits),
Acl/acl_head.txt view on Meta::CPAN
PREINIT:
d_LN_XSVARS;
LN_Acl_Impl * a_impl;
int i;
LN_RoleName role_name;
int len;
char* role;
ALIAS:
acl = 0
get_acl = 1
PPCODE:
Acl/aclremov.txt view on Meta::CPAN
PREINIT:
d_LN_XSVARS;
LN_Acl_Impl* a_impl;
HANDLE a_h;
int i;
char name[ MAXUSERNAME ];
ALIAS:
remove = 0
remove_entries = 1
remove_entries_by_name = 2
PPCODE:
a_impl = (LN_Acl_Impl*) LN_H(a);
a_h = a_impl->h;
if ( items <= 1 ) { XSRETURN( 0 ); }
for ( LN_SET_OK(a), i = 1; i < items; i++ ) { /* i=0 skipped */
ln_stat =
DNCanonicalize(0L,NULL,SvPV(ST(i),na),name,MAXUSERNAME,NULL);
if ( LN_IS_OK ) { ln_stat = ACLDeleteEntry(a_h, name); }
AclEntry/AclEntry.xs view on Meta::CPAN
d_LN_XSVARS;
LN_Acl_Impl* a_impl;
HANDLE a_h;
int i;
int sp_i;
LN_Acl_EnumEntry ae;
char * ae_name;
ALIAS:
entries = 0
entries_by_name = 1
PPCODE:
if ( items == 1 ) { XSRETURN( 0 ); }
a_impl = (LN_Acl_Impl*) LN_H(a);
a_h = a_impl->h;
for ( LN_SET_OK(a), i = 1, sp_i = 0; i < items; i++ ) {
ln_stat = DNCanonicalize(
0L,
NULL,
AclEntry/AclEntry.xs view on Meta::CPAN
LN_Acl * a;
PREINIT:
d_LN_XSVARS;
LN_Acl_Impl* a_impl;
HANDLE a_h;
int sp_i;
LN_Acl_EnumEntry ae;
ALIAS:
all_entries = 0
all_entryobjects = 1
PPCODE:
a_impl = (LN_Acl_Impl*) LN_H(a);
a_h = a_impl->h;
sp_i = 0;
ln_stat = LN_OK;
ae.sp = SP; /* we avoid using PUTBACK instead, */
ae.items= sp_i; /* cause it adjusts _global_ stack ptr*/
ae.stat = ln_stat;
ae.obj = a;
AclEntry/AclEntry.xs view on Meta::CPAN
add_fullaccess_entries_by_name = 8
add_fullaccess_entries = 9
# note: convenience alias with _same_ index
add_with_fullaccess = 9
add_fullaccess_persons_by_name = 10
add_fullaccess_persons = 11
add_fullaccess_servers_by_name = 12
add_fullaccess_servers = 13
add_fullaccess_groups_by_name = 14
add_fullaccess_groups = 15
PPCODE:
if ( items == 1 ) { XSRETURN_NOT_OK; }
/*
* list of all access level detail flags
* we have found in the Notes C API 4.61 docs;
* Note: ordering is with falling power/relevance
* Note: we miss the flags for person groups and server groups
*
* ACL_FLAG_NODELETE
* ACL_FLAG_AUTHOR_NOCREATE
AclEntry/AclEntry.xs view on Meta::CPAN
PREINIT:
d_LN_XSVARS;
LN_Acl_Impl* a_impl;
HANDLE a_h;
int i;
char name[ MAXUSERNAME ];
ALIAS:
remove = 0
remove_entries = 1
remove_entries_by_name = 2
PPCODE:
a_impl = (LN_Acl_Impl*) LN_H(a);
a_h = a_impl->h;
if ( items <= 1 ) { XSRETURN( 0 ); }
for ( LN_SET_OK(a), i = 1; i < items; i++ ) { /* i=0 skipped */
ln_stat =
DNCanonicalize(0L,NULL,SvPV(ST(i),na),name,MAXUSERNAME,NULL);
if ( LN_IS_OK ) { ln_stat = ACLDeleteEntry(a_h, name); }
AclEntry/AclEntry.xs view on Meta::CPAN
int i;
int sp_i;
LN_Acl_EnumEntry ae;
char new_name[ MAXUSERNAME ];
char * ae_name;
ALIAS:
rename = 0
rename_entries = 1
rename_entries_by_name = 2
PPCODE:
if ( (items % 2) == 0 ) { items -= 1; } /*enforce name pairs*/
if ( items <= 1 ) { XSRETURN( 0 ); }
a_impl = (LN_Acl_Impl*) LN_H(a);
a_h = a_impl->h;
/* skip Notes::ACL obj */
for ( LN_STAT(a) = LN_OK, i = 1, sp_i = 0; i < items; i += 2 ) {
/*
* Note: the Notes C API docs say nothing about length
AclEntry/AclEntry.xs view on Meta::CPAN
PROTOTYPES: DISABLE
void
DESTROY( e )
LN_AclEntry * e;
PREINIT:
d_LN_XSVARS;
PPCODE:
Safefree( (char*) LN_H(e) );
XSRETURN( 0 );
void
name( e )
LN_AclEntry * e;
PREINIT:
d_LN_XSVARS;
PPCODE:
XPUSHs( sv_2mortal( newSVpv( (char*) LN_H(e), 0 ) ) );
XSRETURN( 1 );
Database/Database.xs view on Meta::CPAN
char * ln_network_port;
PREINIT:
d_LN_XSVARS;
DBHANDLE ln_db_handle;
char ln_db_path_canonical[ MAXPATH ];
STATUS ln_rc;
ALIAS:
get_database = 0
open_database = 0
database = 0
PPCODE:
ln_rc = OSPathNetConstruct(
ln_network_port,
ln_server,
ln_db_path,
ln_db_path_canonical
);
if ( LN_IS_NOT_OK(s) )
{
XSRETURN_NOT_OK;
}
Database/Database.xs view on Meta::CPAN
char * ln_db_path;
char * ln_server;
BOOL bForceCreation;
PREINIT:
d_LN_XSVARS;
DBHANDLE ln_db_handle;
char ln_db_path_canonical[ MAXPATH ];
STATUS ln_rc;
ALIAS:
createdatabase = 0
PPCODE:
if ( LN_IS_NOT_OK(s) )
{
DEBUG(("Notes::Session object was not OK at line %d", __LINE__));
XSRETURN_NOT_OK;
}
ln_rc = OSPathNetConstruct(
NULL,
ln_server,
ln_db_path,
ln_db_path_canonical
Database/Database.xs view on Meta::CPAN
char ln_src_db_path[ MAXPATH ];
char ln_dst_can_server[ MAXUSERNAME ];
char ln_db_path_canonical[ MAXPATH ];
STATUS ln_rc;
ALIAS:
createcopy = 0
createfromtemplate = 1
create_from_template = 1
createreplica = 2
create_replica = 2
PPCODE:
if ( LN_IS_NOT_OK(db) )
{
DEBUG(("Notes::Database object was not OK at line %d", __LINE__));
XSRETURN_NOT_OK;
}
ln_rc = DNCanonicalize( 0L, NULL, ln_server, (char FAR*)ln_dst_can_server,
MAXUSERNAME, NULL);
ln_rc = OSPathNetConstruct(
NULL,
ln_dst_can_server,
Database/Database.xs view on Meta::CPAN
//printf("STORED DBHANDLE: %ld\n", (long)LN_DB_HANDLE(NOTESDATABASE,ln_obj));
LN_SET_OK ( ln_obj );
XSRETURN ( 1 );
void
DESTROY( db )
LN_Database * db;
PREINIT:
STATUS ln_rc;
PPCODE:
//printf("CLOSING DBHANDLE: %ld\n", LN_DB_HANDLE(NOTESDATABASE, db));
ln_rc = NSFDbClose( LN_DB_HANDLE(NOTESDATABASE, db) );
LN_FREE_OBJ_STRUCT(NOTESDATABASE, db);
//LN_SET_PARENT_IVX( db, ln_rc );
XSRETURN( 0 );
void
filename( db )
LN_Database * db;
PREINIT:
char ln_canonical_path[ MAXPATH ];
char ln_expanded_path [ MAXPATH ];
STATUS ln_rc;
ALIAS:
filename = 0
canonical_path = 0
expanded_path = 1
path = 1
filepath = 1
PPCODE:
ln_rc = NSFDbPathGet( LN_DB_HANDLE(NOTESDATABASE,db), ln_canonical_path, ln_expanded_path );
LN_SET_IVX(db, ln_rc);
if ( LN_IS_OK(db) )
{
switch( ix )
{
case 0: XPUSHs(sv_2mortal(newSVpv(ln_canonical_path, 0)));
XSRETURN( 1 );
break;
case 1: XPUSHs(sv_2mortal(newSVpv(ln_expanded_path, 0)));
Database/Database.xs view on Meta::CPAN
LN_Database * db;
PREINIT:
char ln_buffer[NSF_INFO_SIZE]; /* database info buffer */
char ln_value[NSF_INFO_SIZE]; /* database title */
STATUS ln_rc;
ALIAS:
title = 0
categories = 1
template = 2
inherited_template = 3
PPCODE:
/* Get the database buffer. */
ln_rc = NSFDbInfoGet (LN_DB_HANDLE(NOTESDATABASE,db), ln_buffer);
LN_SET_IVX(db, ln_rc);
if ( LN_IS_NOT_OK(db) )
{
DEBUG(("Notes::Database object was not OK at line %d", __LINE__));
XSRETURN_NOT_OK;
}
switch( ix )
Database/Database.xs view on Meta::CPAN
void
is_public_address_book( db )
LN_Database * db;
PREINIT:
char ln_buffer[NSF_INFO_SIZE]; /* database info buffer */
char ln_value[NSF_INFO_SIZE]; /* database title */
STATUS ln_rc;
ALIAS:
is_public_address_book = 0
is_personal_address_book = 1
PPCODE:
/* Get the database buffer. */
ln_rc = NSFDbInfoGet (LN_DB_HANDLE(NOTESDATABASE,db), ln_buffer);
LN_SET_IVX(db, ln_rc);
if ( LN_IS_NOT_OK(db) )
{
DEBUG(("Notes::Database object was not OK at line %d", __LINE__));
XSRETURN_NOT_OK;
}
NSFDbInfoParse (ln_buffer, INFOPARSE_DESIGN_CLASS, ln_value, NSF_INFO_SIZE - 1);
Database/Database.xs view on Meta::CPAN
void
compact( db )
LN_Database * db;
PREINIT:
char ln_db_path[MAXPATH];
DWORD stats[2]; /* status return code */
STATUS ln_rc;
ALIAS:
compact_mailbox = 1
compactmailbox = 1
PPCODE:
if ( LN_IS_NOT_OK(db) )
{
DEBUG(("Notes::Database object was not OK at line %d", __LINE__));
XSRETURN_NOT_OK;
}
/* Get the database path. */
if(ln_rc = NSFDbPathGet(LN_DB_HANDLE(NOTESDATABASE,db), NULL, ln_db_path))
{
DEBUG(("Notes::Database object returning error %d at line %d", ln_rc, __LINE__));
Database/Database.xs view on Meta::CPAN
void
current_access_level( db )
LN_Database * db;
PREINIT:
WORD wAccessLevel;
WORD wAccessFlag;
ALIAS:
currentaccess = 0
currentaccesslevel = 0
PPCODE:
if ( LN_IS_NOT_OK(db) )
{
DEBUG(("Notes::Database object was not OK at line %d", __LINE__));
XSRETURN_NOT_OK;
}
NSFDbAccessGet( LN_DB_HANDLE(NOTESDATABASE,db), &wAccessLevel, &wAccessFlag);
/* Return a perl array of the ACCESS_LEVEL and
ACCESS_FLAGS respectively. */
Database/Database.xs view on Meta::CPAN
server( db )
LN_Database * db;
PREINIT:
STATUS ln_rc;
char ln_db_path[ MAXPATH ];
char ln_server[ MAXUSERNAME ];
char ln_server_canonical[ MAXUSERNAME ];
ALIAS:
server_name = 0
servername = 0
PPCODE:
if ( LN_IS_NOT_OK(db) )
{
DEBUG(("Notes::Database object was not OK at line %d", __LINE__));
XSRETURN_NOT_OK;
}
if(ln_rc = NSFDbPathGet(LN_DB_HANDLE(NOTESDATABASE,db), NULL, ln_db_path ))
{
DEBUG(("Notes::Database object returning error %d at line %d", ln_rc, __LINE__));
XSRETURN_NOT_OK;
Database/Database.xs view on Meta::CPAN
void
is_encrypted(db)
LN_Database * db;
PREINIT:
int ln_is_encrypted;
STATUS ln_rc;
ALIAS:
isencrypted = 0
is_locally_encrypted = 0
PPCODE:
if(ln_rc = NSFDbIsLocallyEncrypted(LN_DB_HANDLE(NOTESDATABASE,db),&ln_is_encrypted))
{
DEBUG(("Notes::Database object returning error %d at line %d", ln_rc, __LINE__));
XSRETURN_NOT_OK;
}
if (ln_is_encrypted)
XSRETURN_YES;
else
XSRETURN_NO;
Document/Document.xs view on Meta::CPAN
COLLECTIONPOSITION CollPosition; /* position within collection */
HANDLE hBuffer; /* handle to buffer of note ids */
NOTEID * IdList; /* pointer to a note id */
DWORD EntriesFound; /* number of entries found */
DWORD NotesRead = 0; /* number of documents found */
WORD SignalFlag; /* signal and share warning flags */
HCOLLECTION hCollection; /* collection handle */
STATUS ln_rc;
ALIAS:
GetFirstDocument = 0
PPCODE:
if ( LN_IS_NOT_OK(view) )
{
DEBUG(("Notes::View object is not OK at line %d\n", __LINE__));
XSRETURN_NOT_OK;
}
hCollection = LN_HCOLLECTION(NOTESVIEW, view);
/* Set up the data structure, COLLECTIONPOSITION, that controls where in
the collection we will begin when we read the collection. Specify that we
want to start at the beginning. */
Document/Document.xs view on Meta::CPAN
HANDLE hBuffer; /* handle to buffer of note ids */
NOTEID * IdList; /* pointer to a note id */
DWORD EntriesFound; /* number of entries found */
DWORD NotesRead = 0; /* number of documents found */
DWORD SkipCount; /* number of documents to skip */
WORD SignalFlag; /* signal and share warning flags */
HCOLLECTION hCollection; /* collection handle */
STATUS ln_rc;
ALIAS:
GetFirstDocument = 0
PPCODE:
if ( LN_IS_NOT_OK(view) )
{
DEBUG(("Notes::View object is not OK at line %d\n", __LINE__));
XSRETURN_NOT_OK;
}
hCollection = LN_HCOLLECTION(NOTESVIEW, view);
SkipCount = (DWORD) LN_NOTE_PTR(NOTESVIEW, view);
DEBUG(("Current Notes::View Pointer = %ld\n", SkipCount));
Document/Document.xs view on Meta::CPAN
COLLECTIONPOSITION CollPosition; /* position within collection */
HANDLE hBuffer; /* handle to buffer of note ids */
NOTEID * IdList; /* pointer to a note id */
DWORD EntriesFound; /* number of entries found */
DWORD NotesRead = 0; /* number of documents found */
WORD SignalFlag; /* signal and share warning flags */
HCOLLECTION hCollection; /* collection handle */
STATUS ln_rc;
ALIAS:
GetFirstDocument = 0
PPCODE:
if ( LN_IS_NOT_OK(view) )
{
DEBUG(("Notes::View object is not OK at line %d\n", __LINE__));
XSRETURN_NOT_OK;
}
hCollection = LN_HCOLLECTION(NOTESVIEW, view);
/* Set up the data structure, COLLECTIONPOSITION, that controls where in
the collection we will begin when we read the collection. Specify that we
Document/Document.xs view on Meta::CPAN
NOTEHANDLE hNote = NULLHANDLE;
COLLECTIONPOSITION CollPosition; /* position within collection */
HANDLE hBuffer; /* handle to buffer of note ids */
NOTEID * IdList; /* pointer to a note id */
DWORD EntriesSkipped; /* number of entries skipped */
WORD SignalFlag; /* signal and share warning flags */
HCOLLECTION hCollection; /* collection handle */
STATUS ln_rc;
ALIAS:
GetFirstDocument = 0
PPCODE:
if ( LN_IS_NOT_OK(view) )
{
DEBUG(("Notes::View object is not OK at line %d\n", __LINE__));
XSRETURN_NOT_OK;
}
hCollection = LN_HCOLLECTION(NOTESVIEW, view);
/* Set up the data structure, COLLECTIONPOSITION, that controls where in
the collection we will begin when we read the collection. Specify that we
Document/Document.xs view on Meta::CPAN
void
new ( CLASS, db )
char * CLASS;
LN_Database * db;
PREINIT:
d_LN_XSVARS;
NOTEHANDLE hNote = NULLHANDLE;
DBHANDLE hDb = NULLHANDLE;
STATUS ln_rc = NOERROR;
PPCODE:
hDb = LN_DB_HANDLE(NOTESDATABASE,db);
if (ln_rc = NSFNoteCreate(hDb, &hNote))
{
DEBUG(("Notes::Document object returning error %d at line %d\n", ln_rc, __LINE__));
XSRETURN_NOT_OK;
}
LN_PUSH_NEW_OBJ( "Notes::Document", db );
LN_INIT_OBJ_STRUCT(NOTESDOCUMENT, ln_obj);
DEBUG(("Setting Notes::Document NOTEHANDLE to %ld\n", hNote));
LN_SET_NOTE_HANDLE(NOTESDOCUMENT, ln_obj, hNote);
LN_SET_OK( ln_obj );
XSRETURN( 1 );
void
DESTROY( doc )
LN_Document * doc;
PPCODE:
NSFNoteClose(LN_NOTE_HANDLE(NOTESDOCUMENT, doc));
LN_FREE_OBJ_STRUCT(NOTESDOCUMENT, doc);
//LN_SET_PARENT_IVX( db, ln_rc );
XSRETURN( 0 );
void
has_item( doc, itemname )
LN_Document * doc;
char * itemname;
PREINIT:
NOTEHANDLE hNote = NULLHANDLE;
PPCODE:
if ( LN_IS_NOT_OK(doc) )
{
DEBUG(("Notes::Document object was not OK at line %d\n", __LINE__));
XSRETURN_NOT_OK;
}
if (itemname == NULL)
{
XSRETURN_NOT_OK;
}
hNote = LN_NOTE_HANDLE(NOTESDOCUMENT, doc);
Document/Document.xs view on Meta::CPAN
char far * pData;
HANDLE text_buffer;
char * text_ptr;
WORD counter;
WORD num_entries;
WORD field_len;
WORD i;
NUMBER number_value;
TIMEDATE timedate_value;
STATUS ln_rc = NOERROR;
PPCODE:
if ( LN_IS_NOT_OK(doc) )
{
DEBUG(("Notes::Document object was not OK at line %d\n", __LINE__));
XSRETURN_NOT_OK;
}
if (itemname == NULL)
{
XSRETURN_NOT_OK;
}
hNote = LN_NOTE_HANDLE(NOTESDOCUMENT, doc);
Document/Document.xs view on Meta::CPAN
char temp[MAXALPHANUMBER];
BLOCKID field_block;
WORD field_type;
DWORD field_length;
I32 num_entries;
WORD i = 0, cnt;
NUMBER * number_list;
NUMBER number_value;
TIMEDATE timedate_value;
STATUS ln_rc = NOERROR;
PPCODE:
if( LN_IS_NOT_OK(doc) )
{
DEBUG(("Notes::Document object was not OK at line %d\n", __LINE__));
XSRETURN_NOT_OK;
}
if(itemname == NULL)
{
XSRETURN_NOT_OK;
}
if(!SvOK(value))
Document/Document.xs view on Meta::CPAN
}*/
XSRETURN_NOT_OK;
void
remove_item( doc, itemname )
LN_Document * doc;
char * itemname;
PREINIT:
NOTEHANDLE hNote = NULLHANDLE;
STATUS ln_rc = NOERROR;
PPCODE:
if ( LN_IS_NOT_OK(doc) )
{
DEBUG(("Notes::Document object was not OK at line %d\n", __LINE__));
XSRETURN_NOT_OK;
}
if (itemname == NULL)
{
XSRETURN_NOT_OK;
}
hNote = LN_NOTE_HANDLE(NOTESDOCUMENT, doc);
Document/Document.xs view on Meta::CPAN
}
void
save( doc, force = FALSE )
LN_Document * doc;
BOOL force;
PREINIT:
NOTEHANDLE hNote = NULLHANDLE;
STATUS ln_rc = NOERROR;
WORD update_flags = 0;
PPCODE:
if ( LN_IS_NOT_OK(doc) )
{
DEBUG(("Notes::Document object was not OK at line %d\n", __LINE__));
XSRETURN_NOT_OK;
}
hNote = LN_NOTE_HANDLE(NOTESDOCUMENT, doc);
if(force)
update_flags = UPDATE_FORCE;
Name/Name.xs view on Meta::CPAN
HV * ln_hash = (HV *) NULL;
AV * ln_OU_array = (AV *) NULL;
AV * ln_CMT_array = (AV *) NULL;
SV * sv = (SV *) NULL;
short i;
char tmp[MAXUSERNAME];
char ln_abbrev_name[MAXUSERNAME];
char ln_canonical_name[MAXUSERNAME];
ALIAS:
createname = 0
PPCODE:
if(ln_rc = DNParse(0L, NULL, ln_in_name, &DNComp, sizeof(DNComp)))
{
LN_SET_IVX(s, ln_rc);
XSRETURN_NOT_OK;
}
if(ln_rc = DNCanonicalize(0L, NULL, ln_in_name, (char FAR *)ln_canonical_name,
MAXUSERNAME, NULL))
{
LN_SET_IVX(s, ln_rc);
XSRETURN_NOT_OK;
Name/Name.xs view on Meta::CPAN
LN_PUSH_NEW_HASH_OBJ( "Notes::Name", s );
LN_SET_OK( s );
XSRETURN ( 1 );
MODULE = Notes::Name PACKAGE = Notes::Name
void
DESTROY( name )
LN_Name * name;
PPCODE:
XSRETURN( 0 );
Object/Object.xs view on Meta::CPAN
MODULE = Notes::Object PACKAGE = Notes::Object
PROTOTYPES: DISABLE
void
is_ok( o )
LN_Object * o;
PREINIT:
d_LN_XSVARS;
PPCODE:
if ( LN_IS_OK(o) )
{
XSRETURN_OK;
}
else
{
XSRETURN_NOT_OK;
}
void
is_not_ok( o )
LN_Object * o;
PREINIT:
d_LN_XSVARS;
PPCODE:
if ( LN_IS_NOT_OK(o) )
{
XSRETURN_OK;
}
else
{
XSRETURN_NOT_OK;
}
void
status( o )
LN_Object * o;
PREINIT:
d_LN_XSVARS;
PPCODE:
XSRETURN_IV( (IV) LN_IVX( o ) );
void
set_status( o, ln_stat_value )
LN_Object * o;
int ln_stat_value;
PREINIT:
d_LN_XSVARS;
PPCODE:
LN_SET_IVX( o, ln_stat_value );
XSRETURN( 0 );
void
status_text( o )
LN_Object * o;
PREINIT:
d_LN_XSVARS;
char * ln_stat_text_lmbcs;
char * ln_stat_text_native;
WORD ln_stat_text_length;
PPCODE:
/* Dynamically allocate our two status text buffers */
Newz(1,ln_stat_text_lmbcs, LN_STAT_TEXT_LMBCS_LENGTH, char);
if(ln_stat_text_lmbcs == (char *) NULL)
{
XSRETURN_NOT_OK;
}
/* Fetch Notes' status string in LMBCS, i.e.
* MIXED Multi-Byte charstring format.
*/
Replication/Copy of Replication.xs view on Meta::CPAN
void
replication_info( db )
LN_Database * db;
PREINIT:
d_LN_XSVARS;
STATUS ln_rc;
DBREPLICAINFO * ri;
ALIAS:
ReplicationInfo = 0
PPCODE:
Newz(1, ri, 1, DBREPLICAINFO);
ln_rc = NSFDbReplicaInfoGet( (DBHANDLE) LN_NVX(db), ri );
LN_PUSH_NEW_OBJ( "Notes::Replication", db );
LN_SET_IVX ( ln_obj, (long) ri);
LN_SET_NVX ( ln_obj, (long)(DBHANDLE) LN_NVX(db));
//LN_SET_OK ( ln_obj );
XSRETURN ( 1 );
MODULE = Notes::Replication PACKAGE = Notes::Replication
void
DESTROY( repl )
LN_Replication * repl;
PPCODE:
Safefree( (DBREPLICAINFO *)LN_IVX( repl ) );
//LN_SET_PARENT_IVX( repl, ln_rc );
XSRETURN( 0 );
void
is_browsable( repl )
LN_Replication * repl;
PREINIT:
int ln_query;
DBREPLICAINFO * ri;
ALIAS:
is_browsable = 0
is_catalogable = 1
is_replicating = 2
is_never_replicating = 3
is_receiving_deletions = 4
is_sending_deletions = 5
is_using_cutoff_interval = 6
is_running_scheduled_agents = 7
PPCODE:
//if ( LN_IS_OK(repl) )
//{
ri = (DBREPLICAINFO *) LN_IVX( repl );
switch( ix )
{
case 0: ln_query = !(ri->Flags & REPLFLG_DO_NOT_BROWSE);
break;
case 1: ln_query = !(ri->Flags & REPLFLG_DO_NOT_CATALOG);
break;
break;
Replication/Copy of Replication.xs view on Meta::CPAN
never_replicate_again = 6
replicate_again = 7
receive_deletions = 8
do_not_receive_deletions = 9
send_deletions = 10
do_not_send_deletions = 11
keep_docs_not_in_cutoff_interval = 12
delete_docs_not_in_cutoff_interval = 13
run_scheduled_agents = 14
do_not_run_scheduled_agents = 15
PPCODE:
//if ( LN_IS_OK(repl) )
//{
ri = (DBREPLICAINFO *) LN_IVX( repl );
switch( ix )
{
case 0: ri->Flags &= ~REPLFLG_DO_NOT_BROWSE;
break;
case 1: ri->Flags |= REPLFLG_DO_NOT_BROWSE;
break;
case 2: ri->Flags &= ~REPLFLG_DO_NOT_CATALOG;
Replication/Copy of Replication.xs view on Meta::CPAN
NSFDbReplicaInfoSet((DBHANDLE) LN_NVX(repl), ri );
//}
XSRETURN_OK;
void
cutoff_interval_days( repl )
LN_Replication * repl;
PREINIT:
DBREPLICAINFO * ri;
PPCODE:
//if (LN_IS_OK(repl))
//{
ri = (DBREPLICAINFO *) LN_IVX( repl );
XSRETURN_IV( (IV) ri->CutoffInterval );
//}
//else
//{
// XSRETURN_NOT_OK;
//}
void
set_cutoff_interval_days( repl, ln_cutoff_interval_days )
LN_Replication * repl;
IV ln_cutoff_interval_days;
PREINIT:
DBREPLICAINFO * ri;
PPCODE:
//if ( LN_IS_OK(repl) )
//{
ri = (DBREPLICAINFO *) LN_IVX( repl );
ri->CutoffInterval = (WORD) ln_cutoff_interval_days;
NSFDbReplicaInfoSet((DBHANDLE) LN_NVX(repl), ri );
//}
XSRETURN_OK;
void
gethistory( repl )
Replication/Copy of Replication.xs view on Meta::CPAN
HANDLE hReplHist;
REPLHIST_SUMMARY ReplHist;
REPLHIST_SUMMARY * pReplHist;
char szTimedate[MAXALPHATIMEDATE + 1];
WORD wLen;
DWORD dwNumEntries, i;
char * pServerName; /* terminating NULL not included */
char szServerName[MAXUSERNAME + 1];
char * pFileName; /* includes terminating NULL */
char szDirection[10]; /* NEVER, SEND, RECEIVE */
PPCODE:
/* Get the Replication History Summary */
error = NSFDbGetReplHistorySummary ((DBHANDLE) LN_NVX(repl), 0, &hReplHist, &dwNumEntries);
if (error)
{
//LN_SET_IVX(repl, error);
XSRETURN_NOT_OK;
}
/* Obtain a pointer to the first member of the Replication History Summary array */
pReplHist = OSLock (REPLHIST_SUMMARY, hReplHist);
for (i = 0; i < dwNumEntries; i++)
Replication/Copy of Replication.xs view on Meta::CPAN
}
OSUnlock (hReplHist);
OSMemFree (hReplHist);
void
clearhistory( repl )
LN_Replication * repl;
PREINIT:
STATUS error = NOERROR;
PPCODE:
//if ( LN_IS_OK(repl) )
//{
error = NSFDbClearReplHistory((DBHANDLE) LN_NVX(repl), 0);
//}
XSRETURN_OK;
Replication/Replication.xs view on Meta::CPAN
void
replication_info( db )
LN_Database * db;
PREINIT:
d_LN_XSVARS;
STATUS ln_rc;
DBREPLICAINFO * ri;
ALIAS:
ReplicationInfo = 0
PPCODE:
Newz(1, ri, 1, DBREPLICAINFO);
ln_rc = NSFDbReplicaInfoGet( LN_DB_HANDLE(NOTESDATABASE,db), ri );
LN_PUSH_NEW_OBJ( "Notes::Replication", db );
LN_INIT_OBJ_STRUCT(NOTESREPLICATION, ln_obj);
//printf("SETTING DBHANDLE = %ld\n", LN_DB_HANDLE(NOTESDATABASE,db));
LN_SET_DB_HANDLE(NOTESREPLICATION, ln_obj, LN_DB_HANDLE(NOTESDATABASE,db));
//printf("STORED DBHANDLE = %ld\n", LN_DB_HANDLE(NOTESREPLICATION,ln_obj));
//printf("SETTING DBREPLICAINFO = %ld\n", ri);
LN_SET_DB_REPL_INFO(NOTESREPLICATION, ln_obj, ri);
//printf("STORED DBREPLICAINFO = %ld\n", LN_DB_REPL_INFO(NOTESREPLICATION,ln_obj));
LN_SET_OK ( ln_obj );
XSRETURN ( 1 );
MODULE = Notes::Replication PACKAGE = Notes::Replication
void
DESTROY( repl )
LN_Replication * repl;
PPCODE:
Safefree( LN_DB_REPL_INFO(NOTESREPLICATION, repl) );
LN_FREE_OBJ_STRUCT(NOTESREPLICATION, repl);
//LN_SET_PARENT_IVX( repl, ln_rc );
XSRETURN( 0 );
void
is_browsable( repl )
LN_Replication * repl;
PREINIT:
Replication/Replication.xs view on Meta::CPAN
DBREPLICAINFO * ri;
ALIAS:
is_browsable = 0
is_catalogable = 1
is_replicating = 2
is_never_replicating = 3
is_receiving_deletions = 4
is_sending_deletions = 5
is_using_cutoff_interval = 6
is_running_scheduled_agents = 7
PPCODE:
if ( LN_IS_OK(repl) )
{
ri = LN_DB_REPL_INFO(NOTESREPLICATION, repl);
switch( ix )
{
case 0: ln_query = !(ri->Flags & REPLFLG_DO_NOT_BROWSE);
break;
case 1: ln_query = !(ri->Flags & REPLFLG_DO_NOT_CATALOG);
break;
break;
Replication/Replication.xs view on Meta::CPAN
never_replicate_again = 6
replicate_again = 7
receive_deletions = 8
do_not_receive_deletions = 9
send_deletions = 10
do_not_send_deletions = 11
keep_docs_not_in_cutoff_interval = 12
delete_docs_not_in_cutoff_interval = 13
run_scheduled_agents = 14
do_not_run_scheduled_agents = 15
PPCODE:
if ( LN_IS_OK(repl) )
{
ri = LN_DB_REPL_INFO(NOTESREPLICATION, repl);
switch( ix )
{
case 0: ri->Flags &= ~REPLFLG_DO_NOT_BROWSE;
break;
case 1: ri->Flags |= REPLFLG_DO_NOT_BROWSE;
break;
case 2: ri->Flags &= ~REPLFLG_DO_NOT_CATALOG;
Replication/Replication.xs view on Meta::CPAN
NSFDbReplicaInfoSet(LN_DB_HANDLE(NOTESREPLICATION,repl), ri );
}
XSRETURN_OK;
void
cutoff_interval_days( repl )
LN_Replication * repl;
PREINIT:
DBREPLICAINFO * ri;
PPCODE:
if (LN_IS_OK(repl))
{
ri = LN_DB_REPL_INFO(NOTESREPLICATION, repl);
XSRETURN_IV( (IV) ri->CutoffInterval );
}
else
{
DEBUG(("Notes::Database object is not OK at line %d", __LINE__));
XSRETURN_NOT_OK;
}
void
set_cutoff_interval_days( repl, ln_cutoff_interval_days )
LN_Replication * repl;
IV ln_cutoff_interval_days;
PREINIT:
DBREPLICAINFO * ri;
PPCODE:
if ( LN_IS_OK(repl) )
{
ri = LN_DB_REPL_INFO(NOTESREPLICATION, repl);
ri->CutoffInterval = (WORD) ln_cutoff_interval_days;
NSFDbReplicaInfoSet(LN_DB_HANDLE(NOTESREPLICATION,repl), ri );
}
XSRETURN_OK;
void
gethistory( repl )
Replication/Replication.xs view on Meta::CPAN
HANDLE hReplHist;
REPLHIST_SUMMARY ReplHist;
REPLHIST_SUMMARY * pReplHist;
char szTimedate[MAXALPHATIMEDATE + 1];
WORD wLen;
DWORD dwNumEntries, i;
char * pServerName; /* terminating NULL not included */
char szServerName[MAXUSERNAME + 1];
char * pFileName; /* includes terminating NULL */
char szDirection[10]; /* NEVER, SEND, RECEIVE */
PPCODE:
/* Get the Replication History Summary */
error = NSFDbGetReplHistorySummary (LN_DB_HANDLE(NOTESREPLICATION,repl),
0,
&hReplHist,
&dwNumEntries);
if (error)
{
LN_SET_IVX(repl, error);
DEBUG(("Notes::Replication object returning error %d at line %d", error, __LINE__));
XSRETURN_NOT_OK;
Replication/Replication.xs view on Meta::CPAN
}
OSUnlock (hReplHist);
OSMemFree (hReplHist);
void
clearhistory( repl )
LN_Replication * repl;
PREINIT:
STATUS error = NOERROR;
PPCODE:
if ( LN_IS_OK(repl) )
{
error = NSFDbClearReplHistory(LN_DB_HANDLE(NOTESREPLICATION,repl), 0);
}
XSRETURN_OK;
Session/Session.xs view on Meta::CPAN
void
new( CLASS )
char * CLASS;
PREINIT:
int ln_stat_save;
char * ln_warning;
int ln_rc;
d_LN_XSVARS;
PPCODE:
LN_PUSH_NEW_OBJ(CLASS, &PL_sv_undef);
ln_global_session_count += 1; /* NOT threadsafe ! */
LN_SET_NVX(ln_obj, 0);
LN_SET_OK(ln_obj);
if(ln_global_session_count > 1)
{
XSRETURN(1);
}
else if(ln_global_session_count == 1)
Session/Session.xs view on Meta::CPAN
}
XSRETURN_NOT_OK;
void
DESTROY( s )
LN_Session * s;
PREINIT:
d_LN_XSVARS;
PPCODE:
ln_global_session_count -= 1; /* NOT threadsafe ! */
if(ln_global_session_count > 0) /* NOT threadsafe ! */
{
LN_SET_OK(s);
}
else
{
session_destroy();
}
XSRETURN( 0 );
void
session_count( s )
LN_Session * s;
PPCODE:
XSRETURN_IV((long) ln_global_session_count);
void
set_session_count( s, ln_session_count )
LN_Session * s;
int ln_session_count;
PREINIT:
d_LN_XSVARS;
PPCODE:
ln_global_session_count = ln_session_count;
XSRETURN(0);
void
effective_user_name ( s )
LN_Session * s;
PREINIT:
char szUserName[MAXUSERNAME+1];
STATUS ln_rc = NOERROR;
PPCODE:
if (ln_rc = SECKFMGetUserName (szUserName))
{
DEBUG(("Notes::Session object returning error %d at line %d", ln_rc, __LINE__));
XSRETURN_NOT_OK;
}
else
XPUSHs( sv_2mortal( newSVpv( szUserName, 0 )));
void
data_directory ( s )
LN_Session * s;
PREINIT:
char szPathname[MAXPATH];
ALIAS:
data_directory = 0
exec_directory = 1
PPCODE:
if ( LN_IS_OK(s) )
{
switch( ix )
{
case 0: OSGetDataDirectory(szPathname);
break;
case 1: OSGetExecutableDirectory(szPathname);
break;
default: XSRETURN_NOT_OK;
break;
Session/Session.xs view on Meta::CPAN
void
get_environment_value ( s, ln_name )
LN_Session * s;
char * ln_name;
PREINIT:
long ln_value;
char ln_str_value[MAXENVVALUE];
ALIAS:
get_environment_value = 0
get_environment_string = 1
PPCODE:
if(ln_name != NULL)
{
switch(ix)
{
case 0: ln_value = OSGetEnvironmentLong(ln_name);
if(ln_value)
{
XPUSHs( sv_2mortal( newSViv( ln_value )));
}
else
Session/Session.xs view on Meta::CPAN
break;
}
}
XSRETURN( 1 );
void
set_environment_var ( s, ln_name, ln_value )
LN_Session * s;
char * ln_name;
char * ln_value;
PPCODE:
if (ln_name != NULL && ln_value != NULL)
{
OSSetEnvironmentVariable(ln_name, ln_value);
XSRETURN_YES;
}
else
{
XSRETURN_NOT_OK;
}
Session/Session.xs view on Meta::CPAN
WORD wLength;
WORD wEntry;
WORD wEntryLen;
HANDLE hReturn;
char * pszReturn;
char achServer[MAXPATH];
char achPort[MAXPATH];
char achFile[MAXPATH];
PPCODE:
if(ln_rc = NAMEGetAddressBooks(ln_server,
0,
&wCount,
&wLength,
&hReturn))
{
DEBUG(("Notes::Session object returning error %d at line %d", ln_rc, __LINE__));
LN_SET_IVX(s, ln_rc);
XSRETURN_NOT_OK;
}
Session/Session.xs view on Meta::CPAN
XPUSHs(sv_2mortal(newSVpv(achPort, 0)));
pszReturn += wEntryLen+1;
}
OSUnlock(hReturn);
OSMemFree(hReturn);
void
notes_api_version( s )
LN_Session * s;
PPCODE:
XPUSHs(sv_2mortal(newSVpv(NOTESAPI_VERSION, 0)));
XSRETURN( 1 );
void
notes_build_version( s )
LN_Session * s;
PREINIT:
STATUS ln_rc = NOERROR;
DBHANDLE hdb = NULLHANDLE;
WORD wbuild;
PPCODE:
if(ln_rc = NSFDbOpen("names.nsf", &hdb))
{
DEBUG(("Notes::Session object returning error %d at line %d", ln_rc, __LINE__));
LN_SET_IVX(s, ln_rc);
XSRETURN_NOT_OK;
}
if(ln_rc = NSFDbGetBuildVersion(hdb, &wbuild))
{
DEBUG(("Notes::Session object returning error %d at line %d", ln_rc, __LINE__));
NSFDbClose(hdb);
Session/Session.xs.bak2 view on Meta::CPAN
void
new( CLASS )
char * CLASS;
PREINIT:
int ln_stat_save;
char * ln_warning;
int ln_rc;
d_LN_XSVARS;
PPCODE:
LN_PUSH_NEW_OBJ(CLASS, &PL_sv_undef);
LN_INIT_OBJ_STRUCT(NOTESSESSION, ln_obj);
ln_global_session_count += 1; /* NOT threadsafe ! */
LN_SET_STATUS(NOTESSESSION,ln_obj,0);
if(ln_global_session_count > 1)
{
XSRETURN(1);
}
else if(ln_global_session_count == 1)
Session/Session.xs.bak2 view on Meta::CPAN
}
XSRETURN_NOT_OK;
void
DESTROY( s )
LN_Session * s;
PREINIT:
d_LN_XSVARS;
PPCODE:
LN_FREE_OBJ_STRUCT(NOTESSESSION, s)
ln_global_session_count -= 1; /* NOT threadsafe ! */
if(ln_global_session_count > 0) /* NOT threadsafe ! */
{
LN_SET_OK(NOTESSESSION, s);
}
else
{
session_destroy();
}
XSRETURN( 0 );
void
session_count( s )
LN_Session * s;
PPCODE:
XSRETURN_IV((long) ln_global_session_count);
void
set_session_count( s, ln_session_count )
LN_Session * s;
int ln_session_count;
PPCODE:
ln_global_session_count = ln_session_count;
XSRETURN(0);
void
effective_user_name ( s )
LN_Session * s;
PREINIT:
char szUserName[MAXUSERNAME+1];
STATUS ln_rc = NOERROR;
PPCODE:
if (ln_rc = SECKFMGetUserName (szUserName))
{
XSRETURN_NOT_OK;
}
else
XPUSHs( sv_2mortal( newSVpv( szUserName, 0 )));
void
data_directory ( s )
LN_Session * s;
PREINIT:
char szPathname[MAXPATH];
ALIAS:
data_directory = 0
exec_directory = 1
PPCODE:
if ( LN_IS_OK(NOTESSESSION, s) )
{
switch( ix )
{
case 0: OSGetDataDirectory(szPathname);
break;
case 1: OSGetExecutableDirectory(szPathname);
break;
default: XSRETURN_NOT_OK;
break;
Session/Session.xs.bak2 view on Meta::CPAN
void
get_environment_value ( s, ln_name )
LN_Session * s;
char * ln_name;
PREINIT:
long ln_value;
char ln_str_value[MAXENVVALUE];
ALIAS:
get_environment_value = 0
get_environment_string = 1
PPCODE:
if(ln_name != NULL)
{
switch(ix)
{
case 0: ln_value = OSGetEnvironmentLong(ln_name);
if(ln_value)
{
XPUSHs( sv_2mortal( newSViv( ln_value )));
}
else
Session/Session.xs.bak2 view on Meta::CPAN
break;
}
}
XSRETURN( 1 );
void
set_environment_var ( s, ln_name, ln_value )
LN_Session * s;
char * ln_name;
char * ln_value;
PPCODE:
if (ln_name != NULL && ln_value != NULL)
{
OSSetEnvironmentVariable(ln_name, ln_value);
XSRETURN_YES;
}
else
{
XSRETURN_NOT_OK;
}
Session/Session.xs.bak2 view on Meta::CPAN
WORD wLength;
WORD wEntry;
WORD wEntryLen;
HANDLE hReturn;
char * pszReturn;
char achServer[MAXPATH];
char achPort[MAXPATH];
char achFile[MAXPATH];
PPCODE:
if(ln_rc = NAMEGetAddressBooks(ln_server,
0,
&wCount,
&wLength,
&hReturn))
{
LN_SET_STATUS(NOTESSESSION, s, ln_rc);
XSRETURN_NOT_OK;
}
if (!wCount)
Session/Session.xs.bak2 view on Meta::CPAN
XPUSHs(sv_2mortal(newSVpv(achPort, 0)));
pszReturn += wEntryLen+1;
}
OSUnlock(hReturn);
OSMemFree(hReturn);
void
notes_api_version( s )
LN_Session * s;
PPCODE:
XPUSHs(sv_2mortal(newSVpv(NOTESAPI_VERSION, 0)));
XSRETURN( 1 );
void
notes_build_version( s )
LN_Session * s;
PREINIT:
STATUS ln_rc = NOERROR;
DBHANDLE hdb = NULLHANDLE;
WORD wbuild;
PPCODE:
if(ln_rc = NSFDbOpen("names.nsf", &hdb))
{
LN_SET_STATUS(NOTESSESSION, s, ln_rc);
XSRETURN_NOT_OK;
}
if(ln_rc = NSFDbGetBuildVersion(hdb, &wbuild))
{
NSFDbClose(hdb);
LN_SET_STATUS(NOTESSESSION, s, ln_rc);
XSRETURN_NOT_OK;
View/View.xs view on Meta::CPAN
char * ln_view_name;
PREINIT:
d_LN_XSVARS;
NOTEID ln_view_id; /* note id of the view */
HCOLLECTION hCollection; /* collection handle */
STATUS ln_rc;
ALIAS:
get_view = 0
open_view = 0
view = 0
PPCODE:
if ( LN_IS_NOT_OK(db) )
{
XSRETURN_NOT_OK;
}
/* Get the note id of the view we want. */
if (ln_rc = NIFFindView (LN_DB_HANDLE(NOTESDATABASE,db), ln_view_name, &ln_view_id))
{
LN_SET_IVX(db, ln_rc);
XSRETURN_NOT_OK;
}
View/View.xs view on Meta::CPAN
XSRETURN( 1 );
MODULE = Notes::View PACKAGE = Notes::View
void
DESTROY( view )
LN_View * view;
PREINIT:
STATUS ln_rc;
PPCODE:
ln_rc = NIFCloseCollection(LN_HCOLLECTION(NOTESVIEW, view));
LN_FREE_OBJ_STRUCT(NOTESVIEW, view);
//LN_SET_PARENT_IVX( db, ln_rc );
XSRETURN( 0 );
void
top_level_entry_count( view )
LN_View * view;
PREINIT:
NOTEHANDLE hNote = NULLHANDLE;
HCOLLECTION hCollection; /* collection handle */
COLLECTIONPOSITION CollPosition; /* position within collection */
HANDLE hBuffer; /* handle to buffer of note ids */
NOTEID * IdList; /* pointer to a note id */
DWORD EntriesFound; /* number of entries found */
DWORD NotesFound = 0; /* number of documents found */
WORD SignalFlag; /* signal and share warning flags */
DWORD i; /* a counter */
STATUS ln_rc = NOERROR; /* return status from API calls */
PPCODE:
hCollection = LN_HCOLLECTION(NOTESVIEW, view);
/* Set up the data structure, COLLECTIONPOSITION, that controls where in
the collection we will begin when we read the collection. Specify that we
want to start at the beginning. */
CollPosition.Level = 0;
CollPosition.Tumbler[0] = 0;
/* Get a buffer with information about each entry in the collection.
View/View.xs view on Meta::CPAN
name = 0
added = 1
last_modified = 2
last_accessed = 3
created = 4
has_date_formula = 5
universalid = 6
is_private = 7
is_default = 8
readers = 9
PPCODE:
if (ln_rc = NSFNoteOpen(LN_DB_HANDLE(NOTESVIEW,view), LN_NOTE_ID(NOTESVIEW,view), 0, &hNote))
{
DEBUG(("Notes::View object returning error %d at line %d", ln_rc, __LINE__));
LN_SET_IVX(view, ln_rc);
XSRETURN_NOT_OK;
}
switch(ix)
{
/*
* Read the title of the View from the View note.
View/View.xs view on Meta::CPAN
column_count = 0
column_names = 1
auto_update = 2
background_color = 3
row_lines = 4
header_lines = 5
spacing = 6
is_calendar = 7
is_conflict = 8
is_hierarchical = 9
PPCODE:
if (ln_rc = NSFNoteOpen(LN_DB_HANDLE(NOTESVIEW,view), LN_NOTE_ID(NOTESVIEW,view), 0, &hNote))
{
DEBUG(("Notes::View object returning error %d at line %d", ln_rc, __LINE__));
LN_SET_IVX(view, ln_rc);
XSRETURN_NOT_OK;
}
/*
* Get the number of column in the view
*/
ViewColumn/ViewColumn.xs view on Meta::CPAN
VIEW_TABLE_FORMAT tableFormat;
VIEW_TABLE_FORMAT2 tableFormat2;
VIEW_COLUMN_FORMAT viewColumn;
VIEW_COLUMN_FORMAT viewColumn2;
void * tempPtr;
WORD wColumn;
char far * pFormula;
char far * pFormulaText, *pTemp;
WORD wFormulaTextLen;
HANDLE hFormulaText;
PPCODE:
ln_hash = (HV *)sv_2mortal((SV *)newHV());
if (ln_rc = NSFNoteOpen(LN_DB_HANDLE(NOTESVIEW,view), LN_NOTE_ID(NOTESVIEW,view), 0, &hNote))
{
DEBUG(("Notes::ViewColumn object returning error %d at line %d", ln_rc, __LINE__));
DEBUG(("DBHANDLE = %ld, NOTEID = %ld", LN_DB_HANDLE(NOTESVIEW,view), LN_NOTE_ID(NOTESVIEW,view)));
LN_SET_IVX(view, ln_rc);
XSRETURN_NOT_OK;
}
ViewColumn/ViewColumn.xs view on Meta::CPAN
LN_PUSH_NEW_HASH_OBJ( "Notes::ViewColumn", view );
LN_SET_OK( view );
XSRETURN ( 1 );
MODULE = Notes::ViewColumn PACKAGE = Notes::ViewColumn
void
DESTROY( col )
LN_ViewColumn * col;
PPCODE:
XSRETURN( 0 );
LN_Replication * O_LN_OBJECT
LN_Acl * O_LN_OBJECT
LN_AclEntry * O_LN_OBJECT
LN_Name * O_LN_HASH
LN_ViewColumn * O_LN_HASH
#############################################################################
OUTPUT
O_LN_OBJECT
/* must NOT be used - ALWAYS use PPCODE-section for obj creation*/
/* enforce C compilation error to prevent unintentional use */
++**intentional_c_error;
die( \"${Package}::$func_name() -- $arg , $var MUST use PPCODE\" );
O_LN_HASH
/* must NOT be used - ALWAYS use PPCODE-section for obj creation*/
/* enforce C compilation error to prevent unintentional use */
++**intentional_c_error;
die( \"${Package}::$func_name() -- $arg , $var MUST use PPCODE\" );
#############################################################################
INPUT
O_LN_OBJECT
/* NOTE: ALL O_LN_OBJECT C-types MUST be typedef'ed to SV */
if ( sv_isobject( $arg ) && ( SvTYPE( SvRV( $arg ) ) == SVt_PVMG) ) {
$var = ($type) $arg;
} else {
warn( \"${Package}::$func_name() -- $var is not a blessed SV reference\" );
XSRETURN_UNDEF;