00:00:00 --- log: started forth/06.03.06 00:15:06 --- join: nballen (n=nballen@ppp-69-239-137-85.dsl.renocs.pacbell.net) joined #forth 00:16:11 --- quit: nballen (Client Quit) 00:17:46 --- join: virl (n=virl@chello062178085149.1.12.vie.surfer.at) joined #forth 02:30:54 --- quit: PoppaVic ("Pulls the pin...") 02:42:04 --- join: tathi (n=josh@pdpc/supporter/bronze/tathi) joined #forth 07:01:31 --- log: started forth/06.03.06 07:01:31 --- join: clog (n=nef@bespin.org) joined #forth 07:01:31 --- topic: 'Welcome to #forth. We discuss the Forth programming language, simplicity, and a variety of technical subjects. The rules are simple: don't spam, don't troll, and please speak English.' 07:01:31 --- topic: set by Quartus on [Sat Jan 21 17:32:55 2006] 07:01:31 --- names: list (clog madwork @JasonWoof segher_ tathi virl Cheery rsyncx neceve Snoopy42 uiuiuiu warpzero Teratogen I440r ayrnieu Quartus madgarden Zymurgy saon Jim7J1AJH skylan ccfg Raystm2 OrngeTide scope) 07:15:42 --- nick: segher_ -> segher 07:19:09 so I should use poll? 07:20:24 --- quit: uiuiuiu (Remote closed the connection) 07:20:28 --- join: uiuiuiu (i=ian@dslb-084-056-212-129.pools.arcor-ip.net) joined #forth 07:26:59 sure, translating the above C code to Forth should work 07:29:46 --- quit: neceve ("Bye people, I'm leaving") 07:29:52 well, that doesn't work. 07:32:49 in fact poll produces a nice useless endless loop in retroforth. 07:39:39 somehow it produces a floating point error I don't know why. 07:40:08 what platform, exactly? 07:40:21 linux, x86, 2.6 07:41:58 huh. 07:44:03 --- quit: Cheery ("Leaving") 07:46:08 I try to make a retroforth game which is based only on syscalls, hell it would work when this izybizy little dam small shit would work. 08:51:35 --- join: snoopy_1711 (i=snoopy_1@dslb-084-058-156-112.pools.arcor-ip.net) joined #forth 08:52:37 --- quit: Snoopy42 (Nick collision from services.) 08:52:51 --- nick: snoopy_1711 -> Snoopy42 09:08:31 and the above C code produces an endless serie of zero returns 09:54:08 --- join: slava (n=slava@CPE0080ad77a020-CM000e5cdfda14.cpe.net.cable.rogers.com) joined #forth 10:02:36 virl use isforth :P 10:04:32 isforth can't patch the fact that somehow the syscalls don't work like most here think. 10:05:43 what ? 10:05:51 syscalls in isforth are just fine 10:06:13 what syscall do you need and how do you need it to work ? 10:07:20 ok, then how do you do nonblocking input? I tried it with termios, I tried it with poll and I tried it with fcntl to manipulate the fucking stdin fd so that I can read from it in a nonblocking way. 10:08:59 virl: the syscalls are not broken 10:09:54 you use a pollfd 10:10:04 or if its from the terminal just use ?key 10:10:19 ?key will tell you if theres anything to read 10:12:02 ?key uses a pollfd on stdin to see if theres anything there to read - you can do something similar on any fd to do non blocking input 10:13:19 --- quit: Jim7J1AJH ("leaving") 10:13:21 * virl cries in agony 10:13:43 virl if you need help just ask :) 10:13:56 --- join: Jim7J1AJH (n=jim@221x115x224x2.ap221.ftth.ucom.ne.jp) joined #forth 10:14:08 ive not touched isforth in about 3 years but i still know every inch of those soruces inside out 10:14:33 and if the guy im asking to help do my assembler is willing to do so then ill be making ALOT of changes soon hehe 10:14:40 oopts you didnt hear that did you tathi ? 10:14:41 you are the n-hundred person who tells me to use poll and I said it already that it doesn't work 3 or more times 10:14:52 yes it does if you do it right 10:15:07 key? uses a pollfd to tell you if theres anything there to read. if there is you jsut call key 10:15:25 being ?key until key 10:15:31 heh. I'm not worried. PPC assembler will be a tiny fraction of the work. 10:15:32 except teh begin until makes it blocking 10:15:39 heh 10:15:48 n-th times for you I440r, I know that! 10:16:02 so what doesnt work 10:16:09 loc: 10:16:09 create kfd 0 , 1 2, 0 2, 10:16:09 :: 0 1 kfd 3 168 syscall ; 10:16:09 ;loc alias key? 10:16:17 is that your poll idea? 10:16:33 then it doesn't work 10:16:39 thats not isforth code 10:16:47 that's retroforth code 10:16:56 it would work in isforth 10:17:24 and it would probably work in retro if you did it right - if that doesnt work then your not doing it right somehow 10:17:36 that's code from one of the retro sample apps 10:17:38 and this is the C code which doesn't work too... 10:17:41 #include 10:17:41 #include 10:17:41 int fd_readable(int s) 10:17:43 { 10:17:45 int r; 10:17:47 struct pollfd fd; 10:17:49 fd.fd = s; 10:17:51 fd.events = POLLIN; 10:17:53 r = poll(&fd, 1, 3); 10:17:55 if(r == -1) { 10:17:57 printf("error checking for input on socket"); 10:18:01 } else return r; 10:18:03 } 10:18:05 int main() 10:18:07 { 10:18:09 while(1) printf("return: %d\n", fd_readable(0)); 10:18:11 return 0; 10:18:13 } 10:19:16 ok thats buggy code right away 10:19:38 if theres an error on reading the pollfd then you dont ever return anything from fd_readable 10:20:03 that should be printf"..." followed by a return -1 or something 10:20:18 and main will never make it to the return 0 10:20:22 so its redundant 10:20:36 well, this code isn't from me, I think it was jasonwoofs code. 10:21:09 yeah, that was from something where that should never happen. 10:21:23 -1 from poll mostly means you're passing a bad fd 10:21:58 and...what happens when you run that C code? 10:23:18 an endless loop.. which prints return: 0 10:23:27 even when I press a key 10:24:32 thats because you didnt read man 5 poll 10:24:41 it returns zero on success 10:24:54 and you have to look in the pollfd structure to see if theres anything to read or not 10:25:06 thats from memory but i think im right 10:25:47 rtfm hhehe 10:25:51 I440r: no, poll returns the number of FDs that have events. 10:26:00 and virl: did you try pressing return? 10:26:03 hmm 10:26:10 because you didn't turn off line buffering 10:26:19 so there's nothing to read on stdin untill you end the line 10:26:52 you still want the tcsetattr call to turn that off 10:28:11 --- join: change-me (i=Boinc-Us@N1488.n.pppool.de) joined #forth 10:28:22 --- part: change-me left #forth 10:28:42 I440r, here directly out of poll man: RETURN VALUE 10:28:42 On success, a positive number is returned, where the number returned is the number of structures which have non-zero revents fields (in other words, those 10:28:42 descriptors with events or errors reported). A value of 0 indicates that the call timed out and no file descriptors have been selected. On error, -1 is 10:28:42 returned, and errno is set appropriately. 10:29:03 so YOU don't read the manual 10:29:22 virl i did read the manual - about 3 years ago lol 10:29:27 and MY code is working heh 10:30:45 virl: so...when you ran the C code, did you try pressing return/enter? 10:31:40 horray.. a success it returns 1 10:31:48 hallejulia... 10:31:51 told you it works 10:32:07 may not do what you think it does, but all the software on your system uses the syscalls -- they are NOT broken 10:32:29 now, I slowly see the fucking solution. 10:32:37 tho the libc wrappers MIGHT be broken hehe 10:33:02 tathi, I never thought that they were broken, it only seemed 10:33:54 --- quit: tathi ("foo") 10:34:32 wah, I hate such days. 10:37:10 now.. now.. I see the failures of the source they made into it. 10:39:21 keep in mind that poll on stdin will never work on OS X, at least in 10.4 10:39:53 the problem of the ekey version I copied out of #retro was that it changes the fd to non-canonical mode reads a key and then it resets it to normal again. normally no problem, but when used in combination with key?(poll) it reads from a fd which is in canonical mode and so it expect 10:41:22 so much hours, so much headaches and so much headaches I did to you. 10:41:48 I'm sry, really really sry. 10:46:15 everybody thanks and I'm excusing me for my behavior. 10:46:21 :-) 10:46:29 good night 10:46:31 --- quit: virl ("Verlassend")