riscos-throwback
Skill4 starsChanged 7 months agoMITView on GitHub
Use when adding, reviewing, or debugging RISC OS Throwback support through LibThrowback, DDEUtils_ThrowbackStart/Send/End, DDEUtils_ThrowbackRegister, or desktop editor error reporting from compilers, taskwindows, tools, and build processors.
We split this skill into the rules it gives an agent
18 rules. About 0 are common, 14 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈14
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Use Throwback when a RISC OS tool processes files and can report diagnostics with a filename, line number, message, and severity.
- Distinctive: line 21
Do not use Throwback for normal logging, progress output, or diagnostics that cannot be tied to a useful file location.
- Distinctive: line 28
If the project can link against the Throwback library, prefer its public header:
- Distinctive: line 61
Use the severity that matches how the desktop should present the message:
- Very specific: line 82
When writing a printf-style helper, format into a bounded buffer with vsnprintf() where the target compiler/library supports it.
- Distinctive: line 89
Use direct SWIs when the project cannot use LibThrowback, needs a precise protocol sequence, or is implementing a Throwback receiver.
- Very specific: line 98
Call DDEUtils_ThrowbackStart before sending records and DDEUtils_ThrowbackEnd before exiting or when processing is complete.
- Very specific: line 120
Start the session with DDEUtils_ThrowbackStart.
- Distinctive: line 126
Always pass full RISC OS pathnames when possible.
- Distinctive: line 137
Only one task can be registered.
- Distinctive: line 175
When implementing a receiver, be lenient.
- Distinctive: line 181
When adding Throwback support:
- Distinctive: line 183
Keep existing command-line diagnostics.
- Distinctive: line 185
Verify that the project links the Throwback library or includes the DDEUtils SWI definitions it uses.
- Very specific: line 190
Avoid sending diagnostics without a filename.
- Distinctive: line 192
Use line 0 for whole-file or unknown-line diagnostics.
- Distinctive: line 193
Keep messages concise and user-facing.
- Distinctive: line 195
Test both desktop and non-desktop cases.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
riscos-throwback
Throwback is the DDEUtils protocol used by command-line tools and taskwindow programs to report warnings, errors, and informational diagnostics to a desktop editor or other registered receiver. It lets the receiver present messages that can usually be clicked to open the affected source file and line.
When to use it
Use Throwback when a RISC OS tool processes files and can report diagnostics with a filename, line number, message, and severity. Common examples are compilers, assemblers, converters, validators, or application build front-ends.
Do not use Throwback for normal logging, progress output, or diagnostics that cannot be tied to a useful file location. Continue to print human-readable messages to stdout/stderr as well, because Throwback is only available when a desktop task has registered to receive it.
Preferred sender API
If the project can link against the Throwback library, prefer its public header:
#include "Throwback.h"The library exposes:
typedef enum {
s_warning = 0,
s_error,
s_seriouserror,
s_information
} seriousness_t;
void Throwback(seriousness_t seriousness,
const char *file,
int line,
const char *message);
void vThrowbackf(seriousness_t seriousness,
const char *file,
int line,
const char *format,
va_list args);Throwback() lazily starts a DDEUtils throwback session on the first call,
registers an atexit() shutdown handler, clamps line numbers below 1 to 0, and
sends either an error-detail or informational-detail record. Passing NULL for
file is ignored.
Use the severity that matches how the desktop should present the message:
s_warning: a warning.s_error: an error.s_seriouserror: a serious error.s_information: an informational note, not an error.
Example:
if (missing_field)
{
Throwback(s_error, source_path, line_number, "Missing field name");
}
if (deprecated_form)
{
Throwback(s_warning, source_path, line_number, "Deprecated form used");
}When writing a printf-style helper, format into a bounded buffer with
vsnprintf() where the target compiler/library supports it. Some older code
uses vsprintf(); do not copy that pattern into new code if a bounded
alternative is available.
Direct DDEUtils protocol
Use direct SWIs when the project cannot use LibThrowback, needs a precise protocol sequence, or is implementing a Throwback receiver.
Sender SWIs are:
DDEUtils_ThrowbackStart(&42587): start a throwback session.DDEUtils_ThrowbackSend(&42588): send processing, error, or info records.DDEUtils_ThrowbackEnd(&42589): end the session.
Call DDEUtils_ThrowbackStart before sending records and
DDEUtils_ThrowbackEnd before exiting or when processing is complete. Treat
errors such as "No task registered for throwback" and "Throwback not available
outside the desktop" as non-fatal; the tool should still continue with normal
text output. If Start reports that Throwback is unavailable, suppress further
Throwback SWIs for that processing run and rely on the normal textual
diagnostics.
DDEUtils_ThrowbackSend takes the reason code in R0 and reason-specific values
in R2-R5:
R0 = 0(Throwback_ReasonProcessing):R2points to the zero-terminated full pathname of the file being processed.R0 = 1(Throwback_ReasonErrorDetails):R2points to the file pathname,R3is the line number,R4is severity (0warning,1error,2serious error), andR5points to the zero-terminated message.R0 = 2(Throwback_ReasonInfoDetails):R2points to the file pathname,R3is the line number,R4must be 0, andR5points to the zero-terminated informational message.
For direct senders, use this sequence:
- Start the session with
DDEUtils_ThrowbackStart. - For each file that has diagnostics, send
Throwback_ReasonProcessingonce. - Send one
Throwback_ReasonErrorDetailsorThrowback_ReasonInfoDetailsfor each diagnostic. - End the session with
DDEUtils_ThrowbackEnd.
Always pass full RISC OS pathnames when possible. Relative filenames may be harder for a desktop receiver to resolve, especially when diagnostics come from a build tool with a different prefix or current directory.
Receivers and editors
A desktop task that wants to receive throwback messages registers with:
DDEUtils_ThrowbackRegister(&42585): R0 is the caller's Wimp task handle.DDEUtils_ThrowbackUnRegister(&42586): unregister before the task exits.
Only one task can be registered. Registration fails outside the desktop and can fail if another task is already registered.
DDEUtils translates sender SWIs into Wimp messages for the registered task. The
message action code is at byte offset +16; message-specific payload starts at
+20 unless noted. These are Wimp message action codes, not SWI numbers:
DDEUtils_ThrowbackStart(&42580): start of a dialogue.DDEUtils_ProcessingFile(&42581):+20zero-terminated filename.DDEUtils_ErrorsIn(&42582):+20zero-terminated filename.DDEUtils_ErrorDetails(&42583):+20line number,+28severity,+32zero-terminated description.DDEUtils_ThrowbackEnd(&42584): end of the dialogue.DDEUtils_InfoforFile(&42585):+20zero-terminated filename.DDEUtils_InfoDetails(&42586):+20line number,+28must be 0,+32zero-terminated informational message.
The documented message grammar is:
ErrorDialogue ::= <DDEUtils_ThrowbackStart>
ErrorsWhileProcessing{ErrorsWhileProcessing}
<DDEUtils_ThrowbackEnd>
ErrorsWhileProcessing ::= <DDEUtils_ProcessingFile>
ErrorFoundIn{ErrorFoundIn}
ErrorFoundIn ::= <DDEUtils_ErrorIn>
<DDEUtils_ErrorDetails>
InfoDialogue ::= <DDEUtils_ThrowbackStart>
InfoDetails{InfoDetails}
<DDEUtils_ThrowbackEnd>
InfoDetails ::= <DDEUtils_InfoforFile>
<DDEUtils_InfoDetails>When implementing a receiver, be lenient. Real tools may omit explicit processing records, may send multiple files in one session, or may continue after a recoverable protocol error.
Implementation checks
When adding Throwback support:
- Keep existing command-line diagnostics; Throwback is an additional desktop reporting path.
- Verify that the project links the Throwback library or includes the DDEUtils SWI definitions it uses.
- Make session shutdown reliable. If using direct SWIs, pair Start and End on all normal exit paths. If using LibThrowback, the library handles this after the first diagnostic.
- Avoid sending diagnostics without a filename. The LibThrowback wrapper ignores
NULLfilenames. - Use line 0 for whole-file or unknown-line diagnostics.
- Keep messages concise and user-facing; the receiver may display them in a compact list.
- Test both desktop and non-desktop cases. Missing throwback support must not make the build or processing operation fail.
In this repository47 other files it gives its agents.
- allocating-resourcesSkill
- ci-testingSkill
- creating-pull-requestsSkill
- designing-modulesSkill
- porting-to-riscos-cSkill
- reading-assemblySkill
- riscos-commandsSkill
- riscos-desktop-fileractionSkill
- riscos-filer-likeSkill
- riscos-filesystemSkill
- riscos-graphics-convertersSkill
- riscos-network-dcistatisticsSkill
- riscos-network-resolverSkill
- riscos-outputSkill
- riscos-reSkill
- riscos-styleSkill
- riscos-urls-fetchingSkill
- riscos-urls-launchingSkill
- riscos-wimp-appSkill
- riscos-wimpSkill
- riscos-wimp-templatesSkill
- updating-robe-skillsSkill
- using-bbcbasicSkill
- using-cmhgSkill
- using-ghSkill
- using-gitSkill
- using-libasmSkill
- using-libgcontextSkill
- using-liboslibSkill
- using-libriscoslibSkill
- using-libtoolboxSkill
- using-makefilesSkill
- using-perlSkill
- using-stronghelpSkill
- using-toolbox-imagefilegadgetSkill
- using-tooltesterSkill
- writing-assemblySkill
- writing-assembly-testsSkill
- writing-cmodulesSkill
- writing-cplusplusSkill
- writing-cSkill
- writing-fortranSkill
- writing-oslib-defsSkill
- writing-pascalSkill
- writing-prminxmlSkill
- writing-pymodulesSkill
- writing-pyromaniac-integration-testsSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

