Check-in [f37675299a]
Not logged in
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
Changes

Modified test.d from [487b856e16418ffe] to [d9955daaabe58d54].

1 import std.algorithm; 1 import std.algorithm; 2 import std.array; 2 import std.array; 3 import std.conv; 3 import std.conv; 4 import std.stdio; 4 import std.stdio; 5 import std.string; 5 import std.string; 6 import std.typecons; 6 import std.typecons; > 7 import core.stdc.signal; > 8 import core.stdc.stdlib; 7 import dfl.all; 9 import dfl.all; 8 10 9 class Map 11 class Map 10 { 12 { 11 private char[][] data; 13 private char[][] data; 12 bool dead = false; 14 bool dead = false; 13 bool cleared = false; 15 bool cleared = false; ................................................................................................................................................................................ 371 writeln("Score: ", score); 373 writeln("Score: ", score); 372 Application.exit(); 374 Application.exit(); 373 } 375 } 374 this.text = .text("Score: ", score, " air[",m.water_proof-m.und 376 this.text = .text("Score: ", score, " air[",m.water_proof-m.und 375 invalidate(); 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 void main(string[] args) 389 void main(string[] args) 380 { 390 { > 391 signal(SIGINT, &sigint); > 392 381 Form myForm = new MyForm(new Map(File(args[1]))); 393 Form myForm = new MyForm(new Map(File(args[1]))); 382 Application.run(myForm); 394 Application.run(myForm); 383 } 395 }