Showing the changes to src/core/ulib_machine.cpp (1 of 7 files). Show all
Unified · Split
| @@ -70,6 +70,7 @@ DLL_QUERY machine_query( Chuck_DL_Query * QUERY ) · 69 unmodified lines | |||
| 70 | //! returns the shred ID | 70 | //! returns the shred ID |
| 71 | //! (see example/machine.ck) | 71 | //! (see example/machine.ck) |
| 72 | QUERY->add_sfun( QUERY, machine_add_impl, "int", "add" ); | 72 | QUERY->add_sfun( QUERY, machine_add_impl, "int", "add" ); |
| 73 | QUERY->doc_func( QUERY, "add/run a new shred from file at 'path'." ); | ||
| 73 | QUERY->add_arg( QUERY, "string", "path" ); | 74 | QUERY->add_arg( QUERY, "string", "path" ); |
| 74 | 75 | ||
| 75 | // add spork | 76 | // add spork |
| @@ -80,32 +81,37 @@ DLL_QUERY machine_query( Chuck_DL_Query * QUERY ) · 4 unmodified lines | |||
| 80 | // add remove | 81 | // add remove |
| 81 | //! remove shred from VM by shred ID (returned by add/spork) | 82 | //! remove shred from VM by shred ID (returned by add/spork) |
| 82 | QUERY->add_sfun( QUERY, machine_remove_impl, "int", "remove" ); | 83 | QUERY->add_sfun( QUERY, machine_remove_impl, "int", "remove" ); |
| 84 | QUERY->doc_func( QUERY, "remove a running shred by 'id'." ); | ||
| 83 | QUERY->add_arg( QUERY, "int", "id" ); | 85 | QUERY->add_arg( QUERY, "int", "id" ); |
| 84 | 86 | ||
| 85 | // add replace | 87 | // add replace |
| 86 | //! replace shred with new shred from file | 88 | //! replace shred with new shred from file |
| 87 | //! returns shred ID , or 0 on error | 89 | //! returns shred ID , or 0 on error |
| 88 | QUERY->add_sfun( QUERY, machine_replace_impl, "int", "replace" ); | 90 | QUERY->add_sfun( QUERY, machine_replace_impl, "int", "replace" ); |
| 91 | QUERY->doc_func( QUERY, "replace running shred by 'id' with new shred at 'path'." ); | ||
| 89 | QUERY->add_arg( QUERY, "int", "id" ); | 92 | QUERY->add_arg( QUERY, "int", "id" ); |
| 90 | QUERY->add_arg( QUERY, "string", "path" ); | 93 | QUERY->add_arg( QUERY, "string", "path" ); |
| 91 | 94 | ||
| 92 | // add replace | 95 | // add crash |
| 93 | //! replace shred with new shred from file | 96 | //! explicitly crash the virtual machine |
| 94 | //! returns shred ID , or 0 on error | ||
| 95 | QUERY->add_sfun( QUERY, machine_crash_impl, "void", "crash" ); | 97 | QUERY->add_sfun( QUERY, machine_crash_impl, "void", "crash" ); |
| 98 | QUERY->doc_func( QUERY, "explicitly crash the virtual machine." ); | ||
| 96 | 99 | ||
| 97 | // add status | 100 | // add status |
| 98 | //! display current status of VM | 101 | //! display current status of VM |
| 99 | //! (see example/status.ck) | 102 | //! (see example/status.ck) |
| 100 | QUERY->add_sfun( QUERY, machine_status_impl, "int", "status" ); | 103 | QUERY->add_sfun( QUERY, machine_status_impl, "int", "status" ); |
| 101 | 104 | QUERY->doc_func( QUERY, "display current status of virtual machine." ); | |
| 105 | |||
| 102 | // add get intsize (width) | 106 | // add get intsize (width) |
| 103 | //! get the intsize in bits (e.g., 32 or 64) | 107 | //! get the intsize in bits (e.g., 32 or 64) |
| 104 | QUERY->add_sfun( QUERY, machine_intsize_impl, "int", "intsize" ); | 108 | QUERY->add_sfun( QUERY, machine_intsize_impl, "int", "intsize" ); |
| 109 | QUERY->doc_func( QUERY, "get size of int in bits (e.g., 32 or 64)." ); | ||
| 105 | 110 | ||
| 106 | // add shreds | 111 | // add shreds |
| 107 | //! get list of active shreds by id | 112 | //! get list of active shreds by id |
| 108 | QUERY->add_sfun( QUERY, machine_shreds_impl, "int[]", "shreds" ); | 113 | QUERY->add_sfun( QUERY, machine_shreds_impl, "int[]", "shreds" ); |
| 114 | QUERY->doc_func( QUERY, "get list of active shred ids." ); | ||
| 109 | 115 | ||
| 110 | // end class | 116 | // end class |
| 111 | QUERY->end_class( QUERY ); | 117 | QUERY->end_class( QUERY ); |