Overview
SHA1 Hash: | f37675299a1bd44ba1f698969ea9fc1371f9cd65 |
---|---|
Date: | 2012-07-14 12:42:25 |
User: | kinaba |
Comment: | Handle SIGINT. |
Timelines: | family | ancestors | descendants | both | trunk |
Diffs: | redesign |
Downloads: | Tarball | ZIP archive |
Other Links: | files | file ages | manifest |
Tags And Properties
- branch=trunk inherited from [16f0b5784f]
- sym-trunk inherited from [16f0b5784f]
Changes
Modified test.d from [487b856e16418ffe] to [d9955daaabe58d54].
1 1 import std.algorithm; 2 2 import std.array; 3 3 import std.conv; 4 4 import std.stdio; 5 5 import std.string; 6 6 import std.typecons; 7 +import core.stdc.signal; 8 +import core.stdc.stdlib; 7 9 import dfl.all; 8 10 9 11 class Map 10 12 { 11 13 private char[][] data; 12 14 bool dead = false; 13 15 bool cleared = false; ................................................................................ 371 373 writeln("Score: ", score); 372 374 Application.exit(); 373 375 } 374 376 this.text = .text("Score: ", score, " air[",m.water_proof-m.underwater,"]"); 375 377 invalidate(); 376 378 } 377 379 } 380 + 381 +extern(C) { 382 + void sigint(int) { 383 + write("A"); 384 + stdout.flush(); 385 + exit(0); 386 + } 387 +} 378 388 379 389 void main(string[] args) 380 390 { 391 + signal(SIGINT, &sigint); 392 + 381 393 Form myForm = new MyForm(new Map(File(args[1]))); 382 394 Application.run(myForm); 383 395 }