File: joke.act

package info (click to toggle)
flexml 1.9.6-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 856 kB
  • sloc: perl: 1,304; makefile: 264; xml: 188; ansic: 117
file content (37 lines) | stat: -rw-r--r-- 675 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<!DOCTYPE actions SYSTEM "flexml-act.dtd">

<actions>

<top><![CDATA[
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>

char* terminator;
]]></top>

<start tag='joke'><![CDATA[
  printf("Joke:\n");
]]></start>

<start tag='setup'><![CDATA[
  terminator = ({type} == {type/question} ? " ??" : "...");
]]></start>

<end tag='setup'><![CDATA[
  printf("%s%s\n", {#PCDATA}, terminator);
]]></end>

<start tag='punch-line'><![CDATA[
  terminator = ({type} == {type/question} ? "?" : "!");
]]></start>

<end tag='punch-line'><![CDATA[
  printf("-- %s%s\n", {#PCDATA}, terminator);
]]></end>

<start tag='pause'><![CDATA[
  sleep(atoi({seconds}));
]]></start>

</actions>