netutil.c
来自「minimal python variant for small footpri」· C语言 代码 · 共 37 行
C
37 行
/* This file contains some utilities related to PalmOS networking.*/#include "PalmOS.h"#include "netutil.h"extern Int32 AppNetTimeout; /* defined in Netsocket.c */static intnetutil_millisecondsPerTick(){ /* (1000 ms/s) / (n ticks/s) = (1000/n) ms/tick */ return 1000 / SysTicksPerSecond();}void netutil_settimeout(long timeout) /* Timeout in milliseconds */{ /* If SysTicksPerSecond() > 1000, then we need to change the representation to from milliseconds to microseconds. */ if (timeout < 0) AppNetTimeout = -1; /* wait forever */ else AppNetTimeout = timeout / netutil_millisecondsPerTick();}Int32netutil_gettimeout() /* timeout in milliseconds */{ if (AppNetTimeout == -1) return -1; return AppNetTimeout * netutil_millisecondsPerTick();}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?