diff options
Diffstat (limited to 'com32/samples')
-rw-r--r-- | com32/samples/resolv.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/com32/samples/resolv.c b/com32/samples/resolv.c index 02cc0a83..bd49d9f9 100644 --- a/com32/samples/resolv.c +++ b/com32/samples/resolv.c @@ -24,43 +24,43 @@ uint32_t resolv(const char *name) { - com32sys_t reg; + com32sys_t reg; - strcpy((char *)__com32.cs_bounce, name); + strcpy((char *)__com32.cs_bounce, name); - memset(®, 0, sizeof reg); - reg.eax.w[0] = 0x0010; - reg.ebx.w[0] = OFFS(__com32.cs_bounce); - reg.es = SEG(__com32.cs_bounce); + memset(®, 0, sizeof reg); + reg.eax.w[0] = 0x0010; + reg.ebx.w[0] = OFFS(__com32.cs_bounce); + reg.es = SEG(__com32.cs_bounce); - __intcall(0x22, ®, ®); + __intcall(0x22, ®, ®); - if ( reg.eflags.l & EFLAGS_CF ) - return 0; - else - return reg.eax.l; + if (reg.eflags.l & EFLAGS_CF) + return 0; + else + return reg.eax.l; } int main(int argc, char *argv[]) { - uint32_t ip; + uint32_t ip; - openconsole(&dev_null_r, &dev_stdcon_w); + openconsole(&dev_null_r, &dev_stdcon_w); - if ( argc < 2 ) { - fputs("Usage: resolv hostname\n", stderr); - exit(1); - } + if (argc < 2) { + fputs("Usage: resolv hostname\n", stderr); + exit(1); + } - ip = resolv(argv[1]); + ip = resolv(argv[1]); - if ( ip ) { - printf("%s = %u.%u.%u.%u\n", argv[1], - (ip & 0xff), (ip >> 8) & 0xff, - (ip >> 16) & 0xff, (ip >> 24) & 0xff); - } else { - printf("%s not found\n", argv[1]); - } + if (ip) { + printf("%s = %u.%u.%u.%u\n", argv[1], + (ip & 0xff), (ip >> 8) & 0xff, + (ip >> 16) & 0xff, (ip >> 24) & 0xff); + } else { + printf("%s not found\n", argv[1]); + } - return 0; + return 0; } |