Show Changes Show Changes
Edit Edit
Print Print
Recent Changes Recent Changes
Subscriptions Subscriptions
Lost and Found Lost and Found
Find References Find References
Rename Rename
Administration Page Administration Page
Topic Locks Topic Locks

Search

History

2/22/2017 3:54:58 AM
-92.222.238.172
12/19/2008 11:19:37 AM
-71.112.6.89
12/18/2008 12:00:44 PM
-98.247.137.70
12/18/2008 11:47:00 AM
-98.247.137.70
7/8/2008 4:47:44 PM
-91.149.37.227
List all versions List all versions

RSS feed for the SquirrelWiki namespace

Patches
.
Summary

Suspend/break a long running script

This patch adds the ability to interrpt or suspend a long running script. If suspended, the script can be resumed with standard API at a later point.

One can also do some application work (like driving a C++ GUI) inside the app QuerySuspend function. (http://www.horoskop2015.org/)

Diff file (against Squirrel 2.5 work sources): QuerySuspend.p0

Source files: QuerySuspend.zip

How to use:

  int SQMyQuerySuspend( SQVM *vm ){ 
     if( /* too long time */ ){
       return SQ_QUERY_BREAK;
       // or return SQ_QUERY_SUSPEND; 
     }
     /* Do some processing / nothing */
     return SQ_QUERY_CONTINUE;
  }
  
  // In init section 
  SQVM *vm = /* from somewhere */;
  vm->SetQuerySuspendFn( SQMyQuerySuspend );
  // ... continue 

UTF8 encoded Squirrel strings

The patch modifies squirrel so that strings are stored with UTF8 encoding internally. This is useful particularly on Unix systems where sizeof(wchar_t)==4.

Apply to your sources and define SQUTF8 to activate it when building.

Patch file: squtf8.patch

Endian-Swapping Byte-Code While Saving

Allows you to perform endian-swapping to your byte-code. Primary benefit is for offline byte-code generation happening on a PC, and then loading on a console with a different endianness.

How to use:

  // store previous endian-swapping state
  SQBool savedState = sq_getendianswapenabled();

  // enable endian-swapping prior to calling sq_writeclosure
  sq_endianswapenable(SQTrue);

  // now write closure, as normal
  sq_writeclosure(...);
  
  // reset endian-swapping state to previous
  sq_endianswapenable(savedState);

Zip file with modified source files and corresponding diffs (Squirrel 2.2): EndianSwapping.zip

Not logged in. Log in

squirrel's community wiki

This is FlexWiki, an open source wiki engine.

Change Style

Recent Topics