[Chicken-users] Sendfile Broken on Leopard

2008-03-26 Thread Joshua Griffith

Hello,

Attempting to install the sendfile egg on Leopard yields the following  
error (it appears Leopard uses a different version of sendfile):


  gzip -d -c /tmp/chicken-setup-3-root/downloads/sendfile.egg | tar  
xf -
  /usr/local/bin/csc -feature compiling-extension -s -d0 -O2  
sendfile.scm sendfile-implementation.c
Warning: local assignment to unused variable `*sendfile:last- 
selected-implementation*' may be unintended

sendfile-implementation.c: In function ‘sendfile_implementation’:
sendfile-implementation.c:62: warning: passing argument 4 of  
‘sendfile’ makes pointer from integer without a cast
sendfile-implementation.c:62: warning: passing argument 6 of  
‘sendfile’ makes integer from pointer without a cast
sendfile-implementation.c:62: error: too many arguments to function  
‘sendfile’
*** Shell command terminated with exit status 1: gcc sendfile- 
implementation.c -o sendfile-implementation.o -c -no-cpp-precomp - 
fno-strict-aliasing -fno-common -DHAVE_CHICKEN_CONFIG_H -Os -fomit- 
frame-pointer -fPIC -DPIC -DC_SHARED -I /usr/local/include

Error: shell invocation failed with non-zero return status
"/usr/local/bin/csc -feature compiling-extension -s -d0 -O2  
sendfile.scm sendfil...

256
Error: executing shell command failed: chicken-setup  -dont-ask  
sendfile


Is it possible to change os-dep.h to not use the sendfile command when  
installing on OS 10.5?  Ref: http://trac.callcc.org/ticket/401


Thanks,

Josh

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] Spiffy cgi usage

2008-03-26 Thread Matthew Welland
How to set up spiffy to directly execute cgi scripts. I.e. NOT by applying 
the interperter to the script:

Spiffy seems to want this:

/bin/perl script.pl

vs 

script.pl with #!/bin/perl in the first line.

;; the cgi-handler part is *not* obvious from the documentation
;; I recomend putting a line like the following in one of the examples
(use spiffy cgi-handler)
 
(spiffy-debug-mode #t)
(spiffy-file-ext-handlers 
 `(("cgi" . ,(cgi-handler* "/nfs/blah/stmlrun.cgi"

;; the "script" I want to run is actually a compiled binary
;; I couldn't figure out how to run it directly so I wrote a wrapper :-(
;; from looking at the code it isn't obvious to me if it is even possible

(spiffy-root-path "mcos")
(start-server location: (get-host-name)
init: noop)
-=-


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Patch to add Sony PSP support

2008-03-26 Thread Adam King
Hi Felix - thanks for the reply!

I had another look at the difference between posixunix.scm and posixpsp.scm and
they are pretty much the same except:

 - the psp has no concept of users and groups
 - no posix memory mapped I/O functions
 - some minor timezone stuff (there are psp specifc functions I can use)
 - some uts stuff (again, there are psp specific functions I can use
that come close)

So in total, there's about 22 functions that are different.  I'll update
posixunix.scm instead with cond-expand's with psp specific functions and make
those other changes you suggested :)   I'll have another patch in a
day or two.
Cheers,

   Adam

On Wed, Mar 26, 2008 at 5:31 AM, felix winkelmann <[EMAIL PROTECTED]> wrote:
>
>  Hey, cool! Looks very good. Would it be possible to reuse posixunix.scm
>  (probably using some cond-expand's to conditionally compile certain
>  sections), or are the differences so large that a separate posix*.scm
>  is required?
>
>  A few more suggestions:
>
>  - don't use "//" style comments
>  - add "psp" to C_software_type (generally whatever is right
>   for software-type, machine-type, build-platform, etc.)
>
>
>  cheers,
>  felix
>


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] eval of (0) crashes app

2008-03-26 Thread Heinrich Taube

Have you run CHICKEN_run once before this call happens?



yes, an thak you for the reply! i call CHICKEN_run(NULL) just after  
CHICKEN_initialize(...);

here is my init sequence in case you see anything:

i also get a crash if i type something like (car {1 2 3}) im not sure  
why some types of errors are cause but others crash.



-

  GracePreferences* prefs=GracePreferences::getInstance();
  int hsize=prefs->getSchemeHeapSize();
  int ssize=prefs->getSchemeStackSize();

  res = CHICKEN_initialize(hsize, ssize, 0, (void*)C_grace_toplevel);
  if (res==0) {
reportChickenError( T(">>> Error: Chicken failed to initialize. 
\n") );

return false;
  }

  res = CHICKEN_run(NULL);
  if (res==0) {
reportChickenError( T(">>> Error: Chicken failed to initialize. 
\n") );

return false;
  }

  res = CHICKEN_eval_string_to_string( (char*)"(chicken-version)",
   buffer, 8192);
  if (res>0)
text = text + T(", version ") + String(buffer).unquoted();
  text += T("\n(c) 2000-2007 Felix L. Winkelmann\n");
  console->postConsoleTextMessage(text);
  memset(buffer, 0,8192);
  if (res==0) {
reportChickenError( T(">>> Error: Chicken failed to initialize. 
\n") );

return false;
  }
  CHICKEN_eval_string("(require-extension srfi-18)", &r);
  CHICKEN_eval_string("(require-extension srfi-1)", &r);
  CHICKEN_eval_string("(define *grace-std-out* (make-output-port  
print-message (lambda () #f)))", NULL);
  res = CHICKEN_eval_string("(current-output-port *grace-std-out*)",  
NULL);

  if ( res==0 )
reportChickenError();

  res = CHICKEN_eval_string("(define *grace-err-out* (make-output- 
port print-error (lambda () #f)))", NULL);

  if ( res==0 )
reportChickenError();

  res = CHICKEN_eval_string("(current-error-port *grace-err-out*)",  
NULL);

  if ( res==0 )
reportChickenError();


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Patch to add Sony PSP support

2008-03-26 Thread felix winkelmann
On Wed, Mar 26, 2008 at 2:16 AM, Adam King <[EMAIL PROTECTED]> wrote:
>
>   I needed to add a scheme compiler/interpreter to a psp project I'm
>  working on, and after trying a few, Chicken seemed to offer the best
>  set of features I was looking for.  So, I've attached a patch against
>  the latest svn version to add psp support.  It makes a few minor
>  changes to some scm files and adds a new posixpsp.scm file (which is
>  mostly a copy of posixunix.scm for now.  The free, open source psp dev
>  toolkit ( http://pspdev.org ) is mostly posix compatible - though I'll
>  need to add some psp specific stuff).   To test it, I compiled
>  r4rstest.scm as embedded and included it in a simple psp specific
>  main.c(attached), the output of which I've also attached for anyone
>  curious (it ran directly on my psp through psplink).   It is cross
>  compiled under gentoo linux.
>

Hey, cool! Looks very good. Would it be possible to reuse posixunix.scm
(probably using some cond-expand's to conditionally compile certain
sections), or are the differences so large that a separate posix*.scm
is required?

A few more suggestions:

- don't use "//" style comments
- add "psp" to C_software_type (generally whatever is right
  for software-type, machine-type, build-platform, etc.)


cheers,
felix


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] eval of (0) crashes app

2008-03-26 Thread felix winkelmann
On Tue, Mar 25, 2008 at 2:30 PM, Heinrich Taube <[EMAIL PROTECTED]> wrote:
>
>  but if i do the same in my app via CHICKEN_eval_string_to_string then
>  the (foo) case gets caught but the (0) case crashes my app :/
>
>  calling eval node 2, input '(0)'
>  [1]+  Bus error   exec build/Release/Grace.app/Contents/
>  MacOS/grace
>
>
>  i know from tracing that this call never returns:
>
>   res = CHICKEN_eval_string_to_string( (char *)expr.toUTF8(),
>schemeThread->evalBuffer,
> 8192);
>
>  does anyone have an idea about what might make the (foo) error get
>  trapped but (0) crash the app?
>

Have you run CHICKEN_run once before this call happens?


cheers,
felix


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users