cleanup zombies during run, and check processes still exist
[tridge/junkcode.git] / name.c
1 #include <stdio.h>
2
3 /****************************************************************************
4 interpret the weird netbios "name"
5 ****************************************************************************/
6 void name_interpret(char *in,char *out)
7 {
8
9 int len = (*in++) / 2;
10 while (len--)
11   {
12     *out = ((in[0]-'A')<<4) + (in[1]-'A');
13     in += 2;
14     out++;
15   }
16 *out = 0;
17 /* Handle any scope names */
18 while(*in) 
19   {
20   *out++ = '.'; /* Scope names are separated by periods */
21   len = *(unsigned char *)in++;
22   strncpy(out, in, len);
23   out += len;
24   *out=0;
25   in += len;
26   }
27 }
28
29
30 main(int argc,char *argv[])
31 {
32   char out[100];
33
34   name_interpret(argv[1],out);
35   puts(out);
36 }