AcePerl

 view release on metacpan or  search on metacpan

Freesubs/Freesubs.xs  view on Meta::CPAN

	*a++ = '"';
	cp = string;
	for (cp = string; *cp; *a++ = *cp++) {
	   if (metachar(*cp)) *a++ = '\\';
	   if (*cp == '\n') { *a++ = 'n' ; cp++ ; }
	}
	*a++ = '"';
	*a++ = '\0';
	RETVAL = newSVpv("",0);
	sv_usepvn(RETVAL,new,count);
OUTPUT:
	RETVAL

void
split(CLASS,string)
     char*  CLASS
     char*  string
PREINIT:
	char *class,*name,*cp,*dest,*timestamp;
	SV* c,n;
	int class_size,name_size,timestamp_size,total_size;

RPC/RPC.xs  view on Meta::CPAN

	RETVAL->status = STATUS_WAITING;
	RETVAL->answer = NULL;
	RETVAL->errcode = 0;
	ace = openServer(host,rpc_port,timeOut);
	if (ace == NULL) {
		safefree(RETVAL);
		XSRETURN_UNDEF;
	} else {
		RETVAL->database = ace;
	}
OUTPUT:
	RETVAL

void
DESTROY(self)
	AceDB* self
CODE:
	if (self->answer != NULL)
	   free((void*) self->answer);
	if (self->database != NULL)
	   closeServer(self->database);
	safefree((char*)self);

ace_handle*
handle(self)
	AceDB* self
CODE:
	RETVAL = self->database;
OUTPUT:
	RETVAL

int
encore(self)
	AceDB* self
CODE:
	RETVAL = self->encoring;
OUTPUT:
	RETVAL

int
error(self)
	AceDB* self
CODE:
	RETVAL = self->errcode;
OUTPUT:
	RETVAL

int
status(self)
	AceDB* self
CODE:
	RETVAL = self->status;
OUTPUT:
	RETVAL

int
query(self,request, type=0)
	AceDB* self
	char*  request
	int    type
PREINIT:
	unsigned char* answer = NULL;
	int retval,length,isWrite=0,isEncore=0;

RPC/RPC.xs  view on Meta::CPAN

	if ((retval > 0) || (answer == NULL) ) {
	   self->status = STATUS_ERROR;
	   RETVAL = 0;
	} else {
	   self->answer = answer;
	   self->length = length;
           self->status = STATUS_PENDING;
	   self->encoring = isEncore && !isWrite;
	   RETVAL = 1;
        }
OUTPUT:
	RETVAL

SV*
read(self)
	AceDB* self
PREINIT:
	unsigned char* answer = NULL;
	int retval,length,encore=0;
CODE:
	if (self->status != STATUS_PENDING)

RPC/RPC.xs  view on Meta::CPAN

	  if ((retval > 0) || (answer == NULL) ) {
	    self->status = STATUS_ERROR;
	    XSRETURN_UNDEF;
	  }
	  self->answer = answer;
	  self->length = length;
	}
        if (!self->encoring) 
           self->status = STATUS_WAITING;
	RETVAL = newSVpv((char*)self->answer,self->length);
OUTPUT:
	RETVAL
CLEANUP:
	if (self->answer != NULL) {
	   free((void*) self->answer);
	   self->length = 0;
	   self->answer = NULL;
	}

acebrowser/htdocs/stylesheets/aceperl.css  view on Meta::CPAN

                  }
H2                { color: #3366FF; 
                    font-family: sans-serif; 
                  }
H3                { color: #3366FF; 
                    font-family: sans-serif; 
                  }
H4                { color: #3366FF; 
                    font-family: sans-serif; 
                  }
INPUT             { background-color: white; }
OL                { font-family: sans-serif; }
UL                { font-family: sans-serif; }
LI                { font-family: sans-serif; 
                    list-style: url(/images/reddot.jpg) outside;
                  }
DL                { font-family: sans-serif; }
DT                { font-family: sans-serif; }
DD                { font-family: sans-serif; }

LI.new            { font-family: sans-serif; 

acebrowser/htdocs/stylesheets/elegans.css  view on Meta::CPAN


.acetree {
   font-size: 10pt;
}
P.caption {
   font-size: 10pt;
}
P.note {
   font-size: 10pt;
}
INPUT {
    font-family: sans-serif;
    background-color: #EEEEE0
}
SELECT {
    font-family: sans-serif;
    background-color: #EEEEE0
}
H1 {
    font-size: 18pt;
    color: red;

acebrowser/htdocs/stylesheets/moviedb.css  view on Meta::CPAN

    border-top: 0px;
    padding-top: 0px;
    margin-top: 0px;
}
.acetree {
   font-size: 10pt;
}
P.caption {
   font-size: 10pt;
}
INPUT {
    font-family: sans-serif;
    background-color: #EEEEE0
}
SELECT {
    font-family: sans-serif;
    background-color: #EEEEE0
}
H1 {
    font-size: 18pt;
    color: red;

acelib/aceclientlib.c  view on Meta::CPAN

#ifdef DEEP_DEBUG
    printf ("// magic1=%d, magic2=%d, magic3=%d, magic=%d\n", 
	     magic1, magic2, magic3, magic) ;
#endif

  return magic ;
}

/*************************************************************
Open RPC connection to server
INPUT
 char *host    hostname running server 
 int  timeOut  maximum peroid to wait for answer

OUTPUT
 return value:
 ace_handle *  pointer to structure containing open connection
               and client identification information
*/
ace_handle *openServer(char *host, u_long rpc_port, int timeOut)
{
  struct timeval tv;
  char *answer;
  int length,
      clientId = 0, n,

acelib/aceclientlib.c  view on Meta::CPAN

  handle->clnt = clnt;

  return handle ;
}

/*************************************************************
notify server of intent to close connection
close connection
free structures

INPUT 
 ace_handle *  pointer to structure containing open connection
               and client identification information
OUTPUT
none
*/

void closeServer(ace_handle *handle) {
ace_data question;
ace_reponse *reponse = 0;

  if (handle) {
    if ( (int *)handle && (CLIENT *)handle->clnt) { 
 /* JC not sure whether I should/need check (int *)handle */

acelib/aceclientlib.c  view on Meta::CPAN

	 memset (reponse,0, sizeof(ace_reponse)) ;
	 }
      clnt_destroy((CLIENT *)handle->clnt);
    }
    free((char *)handle);
  }
}

/*************************************************************
transfer request to server, and wait for binary answer
INPUT
 char * request  string containing request
 unsigned char ** answer  ptr to char ptr, that has to be filled with answer
 ace_handle *    pointer to structure containing open connection
                 and client identification information
 int chunkSize desired size (in kBytes) of returned data-block
            This is only a hint. The server can return more.
            The server splits on ace boundaries
            a chunkSize of 0 indicates a request for unbuffered answers

OUTPUT
 unsigned char ** answer  ptr to char ptr. Pointing to allocated memory containing 
                 answer string. This memory will be filled with the 
                 unmodified data handled as binary bytes.
 return value:
 int      error condition
  ESUCCESS  (0)  no error.
  EIO       (5)  no response received from server.
  ENOMEM   (12)  no memory available to store answer.
  or a server generated error 

acelib/aceclientlib.c  view on Meta::CPAN

  *answerPtr = answer;
  *answerLength = length;
  *encorep = encore ;
  return aceError ? aceError : - encore ; /* surcharge pour JD */
}

/***************************************************************
transfer request to server, and wait for binary answer. Convert answer 
to ASCII string

INPUT
 char * request  string containing request
 char ** answer  ptr to char ptr, that has to be filled with answer
 ace_handle *    pointer to structure containing open connection
                 and client identification information
 int chunkSize desired size (in kBytes) of returned data-block
            This is only a hint. The server can return more.
            The server splits on ace boundaries
            a chunkSize of 0 indicates a request for unbuffered answers

OUTPUT
 char ** answer  ptr to char ptr. Pointing to allocated memory containing 
                 answer string.
 return value:
 int      error condition
  ESUCCESS  (0)  no error.
  EIO       (5)  no response received from server.
  ENOMEM   (12)  no memory available to store answer.
  or a server generated error 
*/

acelib/messubs.c  view on Meta::CPAN

#endif


/* Mac has its own routine for crashing, see messcrash for usage.            */
#if !defined(MACINTOSH) 
extern void crashOut (char* text) ;
#endif



/* This buffer is used only by the routines that OUTPUT a message. Routines  */
/* that format messages into buffers (e.g. messprintf, messSysErrorText)     */
/* have their own buffers. Note that there is a problem here in that this    */
/* buffer can be overflowed, unfortunately because we use vsprintf to do     */
/* our formatting, this can only be detected after the event.                */
/*                                                                           */
/* Constraints on message buffer size - applicable to ALL routines that      */
/* format externally supplied strings.                                       */
/*                                                                           */
/* BUFSIZE:  size of message buffers (messbuf, a global buffer for general   */
/*           message stuff and a private ones in messdump & messprintf).     */

acelib/wh/version.h  view on Meta::CPAN

/* #define SOME_DESC    "brief description"  (purpose of library - one liner)*/
/* #define SOME_VERSION 1                    (major version)                 */
/* #define SOME_RELEASE 0                    (minor version)                 */
/* #define SOME_UPDATE  1                    (latest fix number)             */
/*                                                                           */

/* 1) Use UT_MAKESTRING to make strings out of #define'd numbers.            */
/*    (required because of the way ANSI preprocessor handles strings)        */
/*    e.g. UT_MAKESTRING(6)  produces "6"                                    */
/*                                                                           */
#define UT_PUTSTRING(x) #x
#define UT_MAKESTRING(x) UT_PUTSTRING(x)

/* 2) Make a single version number out of the version, release and update    */
/*    numbers.                                                               */
/* NOTE that there will be no more than 100 (i.e. 0 - 99) revisions per      */
/* version, or updates per revision, otherwise version will be wrong.        */
/*                                                                           */
#define UT_MAKE_VERSION_NUMBER(VERSION, RELEASE, UPDATE) \
((VERSION * 10000) + (RELEASE * 100) + UPDATE)

/* 3) Make a version string containing the title of the application/library  */

typemap  view on Meta::CPAN

TYPEMAP
ace_handle*			T_PTR
AceDB*				O_OBJECT
AceObject*	                O_OBJECT

OUTPUT

# The Perl object is blessed into 'CLASS', which should be a
# char* having the name of the package for the blessing.
O_OBJECT
        sv_setref_pv( $arg, CLASS, (void*)$var );

INPUT

O_OBJECT
        if( sv_isobject($arg) && (SvTYPE(SvRV($arg)) == SVt_PVMG) )
                $var = ($type)SvIV((SV*)SvRV( $arg ));
        else{
                warn( \"${Package}::$func_name() -- $var is not a blessed SV reference\" );
                XSRETURN_UNDEF;
        }



( run in 0.426 second using v1.01-cache-2.11-cpan-4e96b696675 )