Added program description (dsc) support and broke out program dependancies from the program-handler
diff --git a/contiki/apps/about-dsc.c b/contiki/apps/about-dsc.c
new file mode 100644
index 0000000..26cf519
--- /dev/null
+++ b/contiki/apps/about-dsc.c
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2003, Adam Dunkels.
+ * All rights reserved. 
+ *
+ * Redistribution and use in source and binary forms, with or without 
+ * modification, are permitted provided that the following conditions 
+ * are met: 
+ * 1. Redistributions of source code must retain the above copyright 
+ *    notice, this list of conditions and the following disclaimer. 
+ * 2. Redistributions in binary form must reproduce the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer in the documentation and/or other materials provided
+ *    with the distribution. 
+ * 3. The name of the author may not be used to endorse or promote
+ *    products derived from this software without specific prior
+ *    written permission.  
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  
+ *
+ * This file is part of the Contiki desktop environment
+ *
+ * $Id: about-dsc.c,v 1.1 2003/04/17 19:00:00 adamdunkels Exp $
+ *
+ */
+
+#include "dsc.h"
+
+extern struct ctk_icon about_icon;
+/*-----------------------------------------------------------------------------------*/
+DSC(about_dsc,
+    "About dialog box",
+    "about.prg",
+    about_init,
+    &about_icon);
+/*-----------------------------------------------------------------------------------*/
+static unsigned char abouticon_bitmap[3*3*8] = {
+  0x00, 0x7f, 0x43, 0x4c, 0x58, 0x53, 0x60, 0x6f,
+  0x00, 0xff, 0x00, 0x7e, 0x00, 0xff, 0x00, 0xff,
+  0x00, 0xfe, 0xc2, 0x32, 0x1a, 0xca, 0x06, 0xf6,
+
+  0x40, 0x5f, 0x40, 0x5f, 0x40, 0x5f, 0x40, 0x4f,
+  0x00, 0xff, 0x00, 0xff, 0x00, 0xfc, 0x01, 0xf3,
+  0x02, 0xfa, 0x02, 0x82, 0x3e, 0xfe, 0xfe, 0xfe,
+
+  0x60, 0x67, 0x50, 0x59, 0x4c, 0x43, 0x7f, 0x00,
+  0x07, 0xe7, 0x0f, 0xef, 0x0f, 0x0f, 0xff, 0x00,
+  0x8e, 0x06, 0x06, 0x06, 0x8e, 0xfe, 0xfe, 0x00
+};
+
+static char abouticon_textmap[9] = {
+  ' ', ' ', 'c',
+  ' ', '?', ' ',
+  '.', ' ', ' '
+};
+
+static struct ctk_icon about_icon =
+  {CTK_ICON("About Contiki", abouticon_bitmap, abouticon_textmap)};
+/*-----------------------------------------------------------------------------------*/
diff --git a/contiki/apps/about-dsc.h b/contiki/apps/about-dsc.h
new file mode 100644
index 0000000..6b405c8
--- /dev/null
+++ b/contiki/apps/about-dsc.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2003, Adam Dunkels.
+ * All rights reserved. 
+ *
+ * Redistribution and use in source and binary forms, with or without 
+ * modification, are permitted provided that the following conditions 
+ * are met: 
+ * 1. Redistributions of source code must retain the above copyright 
+ *    notice, this list of conditions and the following disclaimer. 
+ * 2. Redistributions in binary form must reproduce the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer in the documentation and/or other materials provided
+ *    with the distribution. 
+ * 3. The name of the author may not be used to endorse or promote
+ *    products derived from this software without specific prior
+ *    written permission.  
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  
+ *
+ * This file is part of the Contiki desktop environment
+ *
+ * $Id: about-dsc.h,v 1.1 2003/04/17 19:00:00 adamdunkels Exp $
+ *
+ */
+#ifndef __ABOUT_DSC_H__
+#define __ABOUT_DSC_H__
+
+#include "dsc.h"
+
+DSC_HEADER(about_dsc);
+
+#endif /* __ABOUT_DSC_H__ */
diff --git a/contiki/apps/netconf-dsc.c b/contiki/apps/netconf-dsc.c
new file mode 100644
index 0000000..6d5725e
--- /dev/null
+++ b/contiki/apps/netconf-dsc.c
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2003, Adam Dunkels.
+ * All rights reserved. 
+ *
+ * Redistribution and use in source and binary forms, with or without 
+ * modification, are permitted provided that the following conditions 
+ * are met: 
+ * 1. Redistributions of source code must retain the above copyright 
+ *    notice, this list of conditions and the following disclaimer. 
+ * 2. Redistributions in binary form must reproduce the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer in the documentation and/or other materials provided
+ *    with the distribution. 
+ * 3. The name of the author may not be used to endorse or promote
+ *    products derived from this software without specific prior
+ *    written permission.  
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  
+ *
+ * This file is part of the Contiki desktop environment
+ *
+ * $Id: netconf-dsc.c,v 1.1 2003/04/17 19:00:00 adamdunkels Exp $
+ *
+ */
+
+#include "dsc.h"
+
+extern struct ctk_icon netconf_icon;
+/*-----------------------------------------------------------------------------------*/
+DSC(netconf_dsc,
+    "Network configuration",
+    "netconf.prg",
+    netconf_init,
+    &netconf_icon);
+/*-----------------------------------------------------------------------------------*/
+static unsigned char tcpipconficon_bitmap[3*3*8] = {
+  0x00, 0x79, 0x43, 0x73, 0x47, 0x77, 0x47, 0x6f,
+  0x00, 0xfe, 0xfe, 0xfc, 0xfc, 0xfc, 0xf8, 0xfb,
+  0x00, 0x16, 0x02, 0x00, 0x02, 0x00, 0x00, 0xc2,
+
+  0x48, 0x4c, 0x5f, 0x5f, 0x1f, 0x3f, 0x3f, 0x03,
+  0x79, 0xf0, 0xf0, 0xf0, 0xe0, 0xe0, 0xfe, 0xfc,
+  0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+  0x77, 0x47, 0x70, 0x43, 0x79, 0x41, 0x7c, 0x00,
+  0xfc, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xf7, 0x00,
+  0x00, 0x80, 0x00, 0x00, 0x00, 0x84, 0xf0, 0x00
+};
+
+static char tcpipconficon_textmap[9] = {
+  't', 'c', 'p',
+  '/', 'i', 'p',
+  'c', 'f', 'g'
+};
+
+
+static struct ctk_icon netconf_icon =
+  {CTK_ICON("Network setup", tcpipconficon_bitmap, tcpipconficon_textmap)};
+/*-----------------------------------------------------------------------------------*/
diff --git a/contiki/apps/netconf-dsc.h b/contiki/apps/netconf-dsc.h
new file mode 100644
index 0000000..86f17cc
--- /dev/null
+++ b/contiki/apps/netconf-dsc.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2003, Adam Dunkels.
+ * All rights reserved. 
+ *
+ * Redistribution and use in source and binary forms, with or without 
+ * modification, are permitted provided that the following conditions 
+ * are met: 
+ * 1. Redistributions of source code must retain the above copyright 
+ *    notice, this list of conditions and the following disclaimer. 
+ * 2. Redistributions in binary form must reproduce the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer in the documentation and/or other materials provided
+ *    with the distribution. 
+ * 3. The name of the author may not be used to endorse or promote
+ *    products derived from this software without specific prior
+ *    written permission.  
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  
+ *
+ * This file is part of the Contiki desktop environment
+ *
+ * $Id: netconf-dsc.h,v 1.1 2003/04/17 19:00:00 adamdunkels Exp $
+ *
+ */
+#ifndef __NETCONF_DSC_H__
+#define __NETCONF_DSC_H__
+
+#include "dsc.h"
+
+DSC_HEADER(netconf_dsc);
+
+#endif /* __NETCONF_DSC_H__ */
diff --git a/contiki/apps/netconf.c b/contiki/apps/netconf.c
index d4c67aa..88d58d1 100644
--- a/contiki/apps/netconf.c
+++ b/contiki/apps/netconf.c
@@ -32,7 +32,7 @@
  *
  * This file is part of the Contiki desktop environment
  *
- * $Id: netconf.c,v 1.5 2003/04/16 18:27:33 adamdunkels Exp $
+ * $Id: netconf.c,v 1.6 2003/04/17 19:00:00 adamdunkels Exp $
  *
  */
 
@@ -40,6 +40,7 @@
 #include "uip.h"
 #include "uip_arp.h"
 #include "ctk.h"
+#include "ctk-draw.h"
 #include "dispatcher.h"
 
 #include "loader.h"
diff --git a/contiki/apps/processes-dsc.c b/contiki/apps/processes-dsc.c
new file mode 100644
index 0000000..41d13da
--- /dev/null
+++ b/contiki/apps/processes-dsc.c
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2003, Adam Dunkels.
+ * All rights reserved. 
+ *
+ * Redistribution and use in source and binary forms, with or without 
+ * modification, are permitted provided that the following conditions 
+ * are met: 
+ * 1. Redistributions of source code must retain the above copyright 
+ *    notice, this list of conditions and the following disclaimer. 
+ * 2. Redistributions in binary form must reproduce the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer in the documentation and/or other materials provided
+ *    with the distribution. 
+ * 3. The name of the author may not be used to endorse or promote
+ *    products derived from this software without specific prior
+ *    written permission.  
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  
+ *
+ * This file is part of the Contiki desktop environment
+ *
+ * $Id: processes-dsc.c,v 1.1 2003/04/17 19:00:00 adamdunkels Exp $
+ *
+ */
+
+#include "dsc.h"
+
+extern struct ctk_icon processes_icon;
+/*-----------------------------------------------------------------------------------*/
+DSC(processes_dsc,
+    "Displays information about processes",
+    "processes.prg",
+    processes_init,
+    &processes_icon);
+/*-----------------------------------------------------------------------------------*/
+static struct ctk_icon processes_icon =
+  {CTK_ICON("Processes", NULL, NULL)};
+/*-----------------------------------------------------------------------------------*/
diff --git a/contiki/apps/processes-dsc.h b/contiki/apps/processes-dsc.h
new file mode 100644
index 0000000..a00c0d8
--- /dev/null
+++ b/contiki/apps/processes-dsc.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2003, Adam Dunkels.
+ * All rights reserved. 
+ *
+ * Redistribution and use in source and binary forms, with or without 
+ * modification, are permitted provided that the following conditions 
+ * are met: 
+ * 1. Redistributions of source code must retain the above copyright 
+ *    notice, this list of conditions and the following disclaimer. 
+ * 2. Redistributions in binary form must reproduce the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer in the documentation and/or other materials provided
+ *    with the distribution. 
+ * 3. The name of the author may not be used to endorse or promote
+ *    products derived from this software without specific prior
+ *    written permission.  
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  
+ *
+ * This file is part of the Contiki desktop environment
+ *
+ * $Id: processes-dsc.h,v 1.1 2003/04/17 19:00:00 adamdunkels Exp $
+ *
+ */
+#ifndef __PROCESSES_DSC_H__
+#define __PROCESSES_DSC_H__
+
+#include "dsc.h"
+
+DSC_HEADER(processes_dsc);
+
+#endif /* __PROCESSES_DSC_H__ */
diff --git a/contiki/apps/program-handler.c b/contiki/apps/program-handler.c
index ca632fe..98f2d05 100644
--- a/contiki/apps/program-handler.c
+++ b/contiki/apps/program-handler.c
@@ -32,7 +32,7 @@
  *
  * This file is part of the Contiki desktop OS
  *
- * $Id: program-handler.c,v 1.6 2003/04/11 20:11:40 adamdunkels Exp $
+ * $Id: program-handler.c,v 1.7 2003/04/17 19:00:00 adamdunkels Exp $
  *
  */
 
@@ -44,158 +44,25 @@
 #include "ctk-draw.h"
 #include "dispatcher.h"
 #include "resolv.h"
-#include "telnet.h"
 
 #include "loader.h"
 
+#include "program-handler.h"
 
 /* Menus */
 static struct ctk_menu contikimenu;
-static unsigned char menuitem_about, menuitem_processes, menuitem_tcpip;
 
-static struct ctk_menu programsmenu;
-static unsigned char menuitem_www,
-  menuitem_email, menuitem_telnet, menuitem_webserver,
-  menuitem_run;
+static struct dsc *contikidsc[10];
+static unsigned char contikidsclast = 0;
 
-/* Icons */
-static unsigned char abouticon_bitmap[3*3*8] = {
-  0x00, 0x7f, 0x43, 0x4c, 0x58, 0x53, 0x60, 0x6f,
-  0x00, 0xff, 0x00, 0x7e, 0x00, 0xff, 0x00, 0xff,
-  0x00, 0xfe, 0xc2, 0x32, 0x1a, 0xca, 0x06, 0xf6,
-
-  0x40, 0x5f, 0x40, 0x5f, 0x40, 0x5f, 0x40, 0x4f,
-  0x00, 0xff, 0x00, 0xff, 0x00, 0xfc, 0x01, 0xf3,
-  0x02, 0xfa, 0x02, 0x82, 0x3e, 0xfe, 0xfe, 0xfe,
-
-  0x60, 0x67, 0x50, 0x59, 0x4c, 0x43, 0x7f, 0x00,
-  0x07, 0xe7, 0x0f, 0xef, 0x0f, 0x0f, 0xff, 0x00,
-  0x8e, 0x06, 0x06, 0x06, 0x8e, 0xfe, 0xfe, 0x00
-};
-
-static char abouticon_textmap[9] = {
-  ' ', ' ', 'c',
-  ' ', '?', ' ',
-  '.', ' ', ' '
-};
-
-static struct ctk_icon abouticon =
-  {CTK_ICON("About Contiki", abouticon_bitmap, abouticon_textmap)};
-
-static unsigned char tcpipconficon_bitmap[3*3*8] = {
-  0x00, 0x79, 0x43, 0x73, 0x47, 0x77, 0x47, 0x6f,
-  0x00, 0xfe, 0xfe, 0xfc, 0xfc, 0xfc, 0xf8, 0xfb,
-  0x00, 0x16, 0x02, 0x00, 0x02, 0x00, 0x00, 0xc2,
-
-  0x48, 0x4c, 0x5f, 0x5f, 0x1f, 0x3f, 0x3f, 0x03,
-  0x79, 0xf0, 0xf0, 0xf0, 0xe0, 0xe0, 0xfe, 0xfc,
-  0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-
-  0x77, 0x47, 0x70, 0x43, 0x79, 0x41, 0x7c, 0x00,
-  0xfc, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xf7, 0x00,
-  0x00, 0x80, 0x00, 0x00, 0x00, 0x84, 0xf0, 0x00
-};
-
-static char tcpipconficon_textmap[9] = {
-  't', 'c', 'p',
-  '/', 'i', 'p',
-  'c', 'f', 'g'
-};
-
-
-static struct ctk_icon tcpipconficon =
-  {CTK_ICON("TCP/IP conf", tcpipconficon_bitmap, tcpipconficon_textmap)};
-
-
-#ifdef WITH_WWW
-/* The icon for the WWW browser */
-static unsigned char wwwicon_bitmap[3*3*8] = {
-  0x00, 0x7e, 0x40, 0x73, 0x46, 0x4c, 0x18, 0x13,
-  0x00, 0x00, 0xff, 0x81, 0x34, 0xc9, 0x00, 0xb6,
-  0x00, 0x7e, 0x02, 0xce, 0x72, 0x32, 0x18, 0x48,
-
-  0x30, 0x27, 0x24, 0x20, 0x37, 0x24, 0x20, 0x33,
-  0x00, 0x7b, 0x42, 0x00, 0x7b, 0x42, 0x00, 0x3b,
-  0x0c, 0x24, 0x24, 0x04, 0xa4, 0x24, 0x04, 0x4c,
-
-  0x12, 0x19, 0x4c, 0x46, 0x63, 0x40, 0x7c, 0x00,
-  0x22, 0x91, 0x00, 0xc4, 0x81, 0xff, 0x00, 0x00,
-  0x08, 0x18, 0x32, 0x62, 0xc6, 0x02, 0x3e, 0x00
-};
-
-static char wwwicon_textmap[9] = {
-  'w', 'w', 'w',
-  '(', ')', ' ',
-  ' ', '(', ')'
-};
-
-static struct ctk_icon wwwicon =
-  {CTK_ICON("Web browser", wwwicon_bitmap, wwwicon_textmap)};
-#endif /* WITH_WWW */
-
-#ifdef WITH_WEBSERVER
-/* The icon for the web server */
-static unsigned char webservericon_bitmap[3*3*8] = {
-  0x00, 0x7f, 0x40, 0x41, 0x44, 0x48, 0x40, 0x50,
-  0x00, 0xff, 0x5a, 0x00, 0x00, 0x00, 0x3c, 0x81,
-  0x00, 0xfe, 0x02, 0x82, 0x22, 0x12, 0x02, 0x0a,
-
-  0x41, 0x60, 0x42, 0x62, 0x62, 0x42, 0x60, 0x41,
-  0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18,
-  0x82, 0x06, 0x42, 0x46, 0x46, 0x42, 0x06, 0x82,
-
-  0x50, 0x40, 0x48, 0x44, 0x41, 0x40, 0x7e, 0x00,
-  0xc5, 0x34, 0x3c, 0x52, 0x7a, 0x7e, 0xa1, 0xfd,
-  0x0a, 0x02, 0x12, 0x22, 0x82, 0x02, 0x7e, 0x00
-};
-
-static char webservericon_textmap[9] = {
-  '+', '-', '+',
-  '|', ')', '|',
-  '+', '-', '+'
-};
-
-static struct ctk_icon webservericon =
-  {CTK_ICON("Web server", webservericon_bitmap, webservericon_textmap)};
-#endif /* WITH_WEBSERVER */
-
-#ifdef WITH_TELNET 
-/* The icon for the telnet client */
-static unsigned char telneticon_bitmap[3*3*8] = {
-  0x00, 0x7f, 0x43, 0x4c, 0x58, 0x53, 0x60, 0x6f,
-  0x00, 0xff, 0x00, 0x7e, 0x00, 0xff, 0x00, 0xff,
-  0x00, 0xfe, 0xc2, 0x32, 0x1a, 0xca, 0x06, 0xf6,
-
-  0x40, 0x5f, 0x40, 0x5f, 0x40, 0x5f, 0x40, 0x4f,
-  0x00, 0xff, 0x00, 0xff, 0x00, 0xfc, 0x01, 0xf3,
-  0x02, 0xfa, 0x02, 0x82, 0x3e, 0xfe, 0xfe, 0xfe,
-
-  0x60, 0x67, 0x50, 0x59, 0x4c, 0x43, 0x7f, 0x00,
-  0x07, 0xe7, 0x0f, 0xef, 0x0f, 0x0f, 0xff, 0x00,
-  0x8e, 0x06, 0x06, 0x06, 0x8e, 0xfe, 0xfe, 0x00
-};
-
-static char telneticon_textmap[9] = {
-  't', 'e', 'l',
-  'n', 'e', 't',
-  '-', '-', '-'
-};
-
-static struct ctk_icon telneticon =
-  {CTK_ICON("Telnet client", telneticon_bitmap, telneticon_textmap)};
-#endif /* WITH_TELNET */
-
-
-/* Main window */
+/* "Run..." window */
 static struct ctk_window runwindow;
-
+static unsigned char runmenuitem;
 static struct ctk_label namelabel =
   {CTK_LABEL(0, 0, 13, 1, "Program name:")};
-
 static char name[31];
 static struct ctk_textentry nameentry =
   {CTK_TEXTENTRY(0, 1, 14, 1, name, 30)};
-
 static struct ctk_button loadbutton =
   {CTK_BUTTON(10, 2, 4, "Load")};
 
@@ -232,16 +99,17 @@
   {CTK_BUTTON(9, 5, 2, "Ok")};
 
 
-/* Function declarations for init() functions for external
-   programs: */
-
-void about_init(void);
-void netconf_init(void);
-void processes_init(void);
-void www_init(void);
-void webserver_init(void);
-void simpletelnet_init(void);
-void email_init(void);
+/*-----------------------------------------------------------------------------------*/
+void
+program_handler_add(struct dsc *dsc, char *menuname,
+		    unsigned char desktop)
+{
+  contikidsc[contikidsclast++] = dsc;
+  ctk_menuitem_add(&contikimenu, menuname);
+  if(desktop) {
+    CTK_ICON_ADD(dsc->icon, id);
+  }
+}
 /*-----------------------------------------------------------------------------------*/
 void
 program_handler_init(void)     
@@ -252,44 +120,8 @@
     /* Create the menus */
     ctk_menu_new(&contikimenu, "Contiki");
     ctk_menu_add(&contikimenu);
-    menuitem_about = ctk_menuitem_add(&contikimenu, "About");
-    menuitem_processes = ctk_menuitem_add(&contikimenu, "Processes");
-    menuitem_tcpip = ctk_menuitem_add(&contikimenu, "TCP/IP conf");
+    runmenuitem = ctk_menuitem_add(&contikimenu, "Run program...");
     
-    ctk_menu_new(&programsmenu, "Programs");
-    ctk_menu_add(&programsmenu);
-#ifdef WITH_WWW
-    menuitem_www = ctk_menuitem_add(&programsmenu, "Web browser");
-#endif /* WITH_WWW */    
-#ifdef WITH_EMAIL
-    menuitem_email = ctk_menuitem_add(&programsmenu, "E-mail");
-#endif /* WITH_EMAIL */
-#ifdef WITH_WEBSERVER
-    menuitem_webserver = ctk_menuitem_add(&programsmenu, "Web server");
-#endif /* WITH_WEBSERVER */
-#ifdef WITH_TELNET
-    menuitem_telnet = ctk_menuitem_add(&programsmenu, "Telnet client");
-#endif /* WITH_TELNET */
-
-#ifdef WITH_LOADER_ARCH
-    menuitem_run = ctk_menuitem_add(&programsmenu, "Run...");
-#endif /* WITH_LOADER_ARCH */
-    
-
-    CTK_ICON_ADD(&abouticon, id);
-    CTK_ICON_ADD(&tcpipconficon, id);
-
-#ifdef WITH_WWW  
-    CTK_ICON_ADD(&wwwicon, id);
-#endif /* WITH_WWW */
-#ifdef WITH_WEBSERVER
-    CTK_ICON_ADD(&webservericon, id);
-#endif /* WITH_WEBSERVER */  
-#ifdef WITH_TELNET
-    CTK_ICON_ADD(&telneticon, id);
-#endif /* WITH_TELNET */  
-    
-
     ctk_window_new(&runwindow, 16, 3, "Run");
  
     CTK_WIDGET_ADD(&runwindow, &namelabel);
@@ -320,7 +152,7 @@
 program_handler_load(char *name)
 {
 #ifdef WITH_LOADER_ARCH
-  dispatcher_emit(loader_signal_load, name, DISPATCHER_CURRENT());
+  dispatcher_emit(loader_signal_load, name, id);
   ctk_label_set_text(&loadingname, name);
   ctk_dialog_open(&loadingdialog);
   ctk_redraw();
@@ -336,7 +168,7 @@
 static
 DISPATCHER_SIGHANDLER(program_handler_sighandler, s, data)
 {
-  unsigned char err;
+  unsigned char err, i;
   DISPATCHER_SIGHANDLER_ARGS(s, data);
   
   if(s == ctk_signal_button_activate) {
@@ -349,66 +181,24 @@
       ctk_dialog_close();
       ctk_redraw();
     }
-    
-    if((struct ctk_widget *)data == (struct ctk_widget *)&abouticon) {
-      RUN("about.prg", about_init);
-    } 
-    if((struct ctk_widget *)data == (struct ctk_widget *)&tcpipconficon) {
-      RUN("netconf.prg", netconf_init);
-    } 
 
-#ifdef WITH_WWW    
-    if((struct ctk_widget *)data == (struct ctk_widget *)&wwwicon) {
-      RUN("www.prg", www_init);
-    } 
-#endif /* WITH_WWW */
-#ifdef WITH_WEBSERVER      
-    if((struct ctk_widget *)data ==
-       (struct ctk_widget *)&webservericon) {
-      RUN("webserver.prg", webserver_init);
-    } 
-#endif /* WITH_WEBSERVER */
-#ifdef WITH_TELNET
-    if((struct ctk_widget *)data ==
-       (struct ctk_widget *)&telneticon) {
-      RUN("simpletelnet.prg", simpletelnet_init);
-    } 
-#endif /* WITH_TELNET */  
-    
+    for(i = 0; i < CTK_CONF_MAXMENUITEMS; ++i) {
+      if(data == (ek_data_t)contikidsc[i]->icon) {
+	RUN(contikidsc[i]->prgname, contikidsc[i]->init);
+	break;
+      }
+    }    
   } else if(s == ctk_signal_menu_activate) {
-    if((struct ctk_menu *)data == &programsmenu) {
-      if(0) {
-#ifdef WITH_WWW
-      } else if(programsmenu.active == menuitem_www) {
-	RUN("www.prg", www_init);
-#endif /* WITH_WWW */
-#ifdef WITH_EMAIL	
-      } else if(programsmenu.active == menuitem_email) {
-	RUN("email.prg", email_init);
-#endif /* WITH_EMAIL */
-#ifdef WITH_TELNET
-      } else if(programsmenu.active == menuitem_telnet) {
-	RUN("simpletelnet.prg", simpletelnet_init);
-#endif /* WITH_TELNET */
-#ifdef WITH_WEBSERVER
-      } else if(programsmenu.active == menuitem_webserver) {
-	RUN("webserver.prg", webserver_init);
-#endif /* WITH_WEBSERVER */
-#ifdef WITH_LOADER_ARCH
-      } else if(programsmenu.active == menuitem_run) {
+    if((struct ctk_menu *)data == &contikimenu) {
+      if(contikimenu.active == runmenuitem) {
 	ctk_window_open(&runwindow);
 	ctk_redraw();
-#endif /* WITH_LOADER_ARCH */
+      } else if(contikidsc[contikimenu.active - 1] != NULL) {
+	RUN(contikidsc[contikimenu.active - 1]->prgname,
+	    contikidsc[contikimenu.active - 1]->init);
       }
-    } else if((struct ctk_menu *)data == &contikimenu) {
-      if(contikimenu.active == menuitem_about) {
-	RUN("about.prg", about_init);
-      } else if(contikimenu.active == menuitem_tcpip) {
-	RUN("netconf.prg", netconf_init);
-      } else if(contikimenu.active == menuitem_processes) {
-	RUN("processes.prg", processes_init);
-      } 
-    }
+    }      
+    
   } else if(s == loader_signal_load) {
     ctk_dialog_close();
     err = LOADER_LOAD(data);
diff --git a/contiki/apps/program-handler.h b/contiki/apps/program-handler.h
index 0c8852e..70a95b0 100644
--- a/contiki/apps/program-handler.h
+++ b/contiki/apps/program-handler.h
@@ -32,13 +32,18 @@
  *
  * This file is part of the Contiki desktop environment for the C64.
  *
- * $Id: program-handler.h,v 1.2 2003/04/11 20:12:03 adamdunkels Exp $
+ * $Id: program-handler.h,v 1.3 2003/04/17 19:00:01 adamdunkels Exp $
  *
  */
 #ifndef __PROGRAM_HANDLER_H__
 #define __PROGRAM_HANDLER_H__
 
+#include "dsc.h"
+
 void program_handler_init(void);
 void program_handler_load(char *name);
 
+void program_handler_add(struct dsc *dsc, char *menuname,
+			 unsigned char desktop);
+
 #endif /* __PROGRAM_HANDLER_H__ */
diff --git a/contiki/apps/telnet-dsc.c b/contiki/apps/telnet-dsc.c
new file mode 100644
index 0000000..4ab98b1
--- /dev/null
+++ b/contiki/apps/telnet-dsc.c
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2003, Adam Dunkels.
+ * All rights reserved. 
+ *
+ * Redistribution and use in source and binary forms, with or without 
+ * modification, are permitted provided that the following conditions 
+ * are met: 
+ * 1. Redistributions of source code must retain the above copyright 
+ *    notice, this list of conditions and the following disclaimer. 
+ * 2. Redistributions in binary form must reproduce the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer in the documentation and/or other materials provided
+ *    with the distribution. 
+ * 3. The name of the author may not be used to endorse or promote
+ *    products derived from this software without specific prior
+ *    written permission.  
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  
+ *
+ * This file is part of the Contiki desktop environment
+ *
+ * $Id: telnet-dsc.c,v 1.1 2003/04/17 19:00:01 adamdunkels Exp $
+ *
+ */
+
+#include "dsc.h"
+
+extern struct ctk_icon telnet_icon;
+/*-----------------------------------------------------------------------------------*/
+DSC(telnet_dsc,
+    "A simple Telnet client",
+    "telnet.prg",
+    telnet_init,
+    &telnet_icon);
+/*-----------------------------------------------------------------------------------*/
+static unsigned char telneticon_bitmap[3*3*8] = {
+  0x00, 0x7f, 0x43, 0x4c, 0x58, 0x53, 0x60, 0x6f,
+  0x00, 0xff, 0x00, 0x7e, 0x00, 0xff, 0x00, 0xff,
+  0x00, 0xfe, 0xc2, 0x32, 0x1a, 0xca, 0x06, 0xf6,
+
+  0x40, 0x5f, 0x40, 0x5f, 0x40, 0x5f, 0x40, 0x4f,
+  0x00, 0xff, 0x00, 0xff, 0x00, 0xfc, 0x01, 0xf3,
+  0x02, 0xfa, 0x02, 0x82, 0x3e, 0xfe, 0xfe, 0xfe,
+
+  0x60, 0x67, 0x50, 0x59, 0x4c, 0x43, 0x7f, 0x00,
+  0x07, 0xe7, 0x0f, 0xef, 0x0f, 0x0f, 0xff, 0x00,
+  0x8e, 0x06, 0x06, 0x06, 0x8e, 0xfe, 0xfe, 0x00
+};
+
+static char telneticon_textmap[9] = {
+  't', 'e', 'l',
+  'n', 'e', 't',
+  '-', '-', '-'
+};
+
+static struct ctk_icon telnet_icon =
+  {CTK_ICON("Telnet client", telneticon_bitmap, telneticon_textmap)};
+/*-----------------------------------------------------------------------------------*/
diff --git a/contiki/apps/telnet-dsc.h b/contiki/apps/telnet-dsc.h
new file mode 100644
index 0000000..6275654
--- /dev/null
+++ b/contiki/apps/telnet-dsc.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2003, Adam Dunkels.
+ * All rights reserved. 
+ *
+ * Redistribution and use in source and binary forms, with or without 
+ * modification, are permitted provided that the following conditions 
+ * are met: 
+ * 1. Redistributions of source code must retain the above copyright 
+ *    notice, this list of conditions and the following disclaimer. 
+ * 2. Redistributions in binary form must reproduce the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer in the documentation and/or other materials provided
+ *    with the distribution. 
+ * 3. The name of the author may not be used to endorse or promote
+ *    products derived from this software without specific prior
+ *    written permission.  
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  
+ *
+ * This file is part of the Contiki desktop environment
+ *
+ * $Id: telnet-dsc.h,v 1.1 2003/04/17 19:00:01 adamdunkels Exp $
+ *
+ */
+#ifndef __TELNET_DSC_H__
+#define __TELNET_DSC_H__
+
+#include "dsc.h"
+
+DSC_HEADER(telnet_dsc);
+
+#endif /* __TELNET_DSC_H__ */
diff --git a/contiki/apps/webserver-dsc.c b/contiki/apps/webserver-dsc.c
new file mode 100644
index 0000000..02a46d7
--- /dev/null
+++ b/contiki/apps/webserver-dsc.c
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2003, Adam Dunkels.
+ * All rights reserved. 
+ *
+ * Redistribution and use in source and binary forms, with or without 
+ * modification, are permitted provided that the following conditions 
+ * are met: 
+ * 1. Redistributions of source code must retain the above copyright 
+ *    notice, this list of conditions and the following disclaimer. 
+ * 2. Redistributions in binary form must reproduce the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer in the documentation and/or other materials provided
+ *    with the distribution. 
+ * 3. The name of the author may not be used to endorse or promote
+ *    products derived from this software without specific prior
+ *    written permission.  
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  
+ *
+ * This file is part of the Contiki desktop environment
+ *
+ * $Id: webserver-dsc.c,v 1.1 2003/04/17 19:00:01 adamdunkels Exp $
+ *
+ */
+
+#include "dsc.h"
+
+extern struct ctk_icon webserver_icon;
+/*-----------------------------------------------------------------------------------*/
+DSC(webserver_dsc,
+    "The Contiki web server",
+    "webserver.prg",
+    webserver_init,
+    &webserver_icon);
+/*-----------------------------------------------------------------------------------*/
+static unsigned char webservericon_bitmap[3*3*8] = {
+  0x00, 0x7f, 0x40, 0x41, 0x44, 0x48, 0x40, 0x50,
+  0x00, 0xff, 0x5a, 0x00, 0x00, 0x00, 0x3c, 0x81,
+  0x00, 0xfe, 0x02, 0x82, 0x22, 0x12, 0x02, 0x0a,
+
+  0x41, 0x60, 0x42, 0x62, 0x62, 0x42, 0x60, 0x41,
+  0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18,
+  0x82, 0x06, 0x42, 0x46, 0x46, 0x42, 0x06, 0x82,
+
+  0x50, 0x40, 0x48, 0x44, 0x41, 0x40, 0x7e, 0x00,
+  0xc5, 0x34, 0x3c, 0x52, 0x7a, 0x7e, 0xa1, 0xfd,
+  0x0a, 0x02, 0x12, 0x22, 0x82, 0x02, 0x7e, 0x00
+};
+
+static char webservericon_textmap[9] = {
+  '+', '-', '+',
+  '|', ')', '|',
+  '+', '-', '+'
+};
+
+static struct ctk_icon webserver_icon =
+  {CTK_ICON("Web server", webservericon_bitmap, webservericon_textmap)};
+/*-----------------------------------------------------------------------------------*/
diff --git a/contiki/apps/webserver-dsc.h b/contiki/apps/webserver-dsc.h
new file mode 100644
index 0000000..789a57d
--- /dev/null
+++ b/contiki/apps/webserver-dsc.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2003, Adam Dunkels.
+ * All rights reserved. 
+ *
+ * Redistribution and use in source and binary forms, with or without 
+ * modification, are permitted provided that the following conditions 
+ * are met: 
+ * 1. Redistributions of source code must retain the above copyright 
+ *    notice, this list of conditions and the following disclaimer. 
+ * 2. Redistributions in binary form must reproduce the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer in the documentation and/or other materials provided
+ *    with the distribution. 
+ * 3. The name of the author may not be used to endorse or promote
+ *    products derived from this software without specific prior
+ *    written permission.  
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  
+ *
+ * This file is part of the Contiki desktop environment
+ *
+ * $Id: webserver-dsc.h,v 1.1 2003/04/17 19:00:01 adamdunkels Exp $
+ *
+ */
+#ifndef __WEBSERVER_DSC_H__
+#define __WEBSERVER_DSC_H__
+
+#include "dsc.h"
+
+DSC_HEADER(webserver_dsc);
+
+#endif /* __WEBSERVER_DSC_H__ */
diff --git a/contiki/apps/www-dsc.c b/contiki/apps/www-dsc.c
new file mode 100644
index 0000000..b55ca3b
--- /dev/null
+++ b/contiki/apps/www-dsc.c
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2003, Adam Dunkels.
+ * All rights reserved. 
+ *
+ * Redistribution and use in source and binary forms, with or without 
+ * modification, are permitted provided that the following conditions 
+ * are met: 
+ * 1. Redistributions of source code must retain the above copyright 
+ *    notice, this list of conditions and the following disclaimer. 
+ * 2. Redistributions in binary form must reproduce the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer in the documentation and/or other materials provided
+ *    with the distribution. 
+ * 3. The name of the author may not be used to endorse or promote
+ *    products derived from this software without specific prior
+ *    written permission.  
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  
+ *
+ * This file is part of the Contiki desktop environment
+ *
+ * $Id: www-dsc.c,v 1.1 2003/04/17 19:00:01 adamdunkels Exp $
+ *
+ */
+
+#include "dsc.h"
+
+extern struct ctk_icon icon;
+/*-----------------------------------------------------------------------------------*/
+DSC(www_dsc,
+    "The Contiki web browser",
+    "www.prg",
+    www_init,
+    &icon);
+/*-----------------------------------------------------------------------------------*/
+static unsigned char wwwicon_bitmap[3*3*8] = {
+  0x00, 0x7e, 0x40, 0x73, 0x46, 0x4c, 0x18, 0x13,
+  0x00, 0x00, 0xff, 0x81, 0x34, 0xc9, 0x00, 0xb6,
+  0x00, 0x7e, 0x02, 0xce, 0x72, 0x32, 0x18, 0x48,
+
+  0x30, 0x27, 0x24, 0x20, 0x37, 0x24, 0x20, 0x33,
+  0x00, 0x7b, 0x42, 0x00, 0x7b, 0x42, 0x00, 0x3b,
+  0x0c, 0x24, 0x24, 0x04, 0xa4, 0x24, 0x04, 0x4c,
+
+  0x12, 0x19, 0x4c, 0x46, 0x63, 0x40, 0x7c, 0x00,
+  0x22, 0x91, 0x00, 0xc4, 0x81, 0xff, 0x00, 0x00,
+  0x08, 0x18, 0x32, 0x62, 0xc6, 0x02, 0x3e, 0x00
+};
+
+static char wwwicon_textmap[9] = {
+  'w', 'w', 'w',
+  '(', ')', ' ',
+  ' ', '(', ')'
+};
+
+static struct ctk_icon icon =
+  {CTK_ICON("Web browser", wwwicon_bitmap, wwwicon_textmap)};
+/*-----------------------------------------------------------------------------------*/
diff --git a/contiki/apps/www-dsc.h b/contiki/apps/www-dsc.h
new file mode 100644
index 0000000..18bba6b
--- /dev/null
+++ b/contiki/apps/www-dsc.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2003, Adam Dunkels.
+ * All rights reserved. 
+ *
+ * Redistribution and use in source and binary forms, with or without 
+ * modification, are permitted provided that the following conditions 
+ * are met: 
+ * 1. Redistributions of source code must retain the above copyright 
+ *    notice, this list of conditions and the following disclaimer. 
+ * 2. Redistributions in binary form must reproduce the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer in the documentation and/or other materials provided
+ *    with the distribution. 
+ * 3. The name of the author may not be used to endorse or promote
+ *    products derived from this software without specific prior
+ *    written permission.  
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  
+ *
+ * This file is part of the Contiki desktop environment
+ *
+ * $Id: www-dsc.h,v 1.1 2003/04/17 19:00:01 adamdunkels Exp $
+ *
+ */
+#ifndef __WWW_DSC_H__
+#define __WWW_DSC_H__
+
+#include "dsc.h"
+
+DSC_HEADER(www_dsc);
+
+#endif /* __WWW_DSC_H__ */
diff --git a/contiki/ek/dsc.h b/contiki/ek/dsc.h
new file mode 100644
index 0000000..0467240
--- /dev/null
+++ b/contiki/ek/dsc.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2003, Adam Dunkels.
+ * All rights reserved. 
+ *
+ * Redistribution and use in source and binary forms, with or without 
+ * modification, are permitted provided that the following conditions 
+ * are met: 
+ * 1. Redistributions of source code must retain the above copyright 
+ *    notice, this list of conditions and the following disclaimer. 
+ * 2. Redistributions in binary form must reproduce the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer in the documentation and/or other materials provided
+ *    with the distribution. 
+ * 3. The name of the author may not be used to endorse or promote
+ *    products derived from this software without specific prior
+ *    written permission.  
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  
+ *
+ * This file is part of the Contiki desktop environment
+ *
+ * $Id: dsc.h,v 1.1 2003/04/17 19:00:02 adamdunkels Exp $
+ *
+ */
+#ifndef __DSC_H__
+#define __DSC_H__
+
+#include "ctk.h"
+
+/* The dsc struct is used for describing a Contiki program. It
+   includes a short textual description of the program, either the
+   name of the program on disk, or a pointer to the init() function,
+   and an icon for the program. */
+struct dsc {
+  char *description;
+  
+#if WITH_LOADER_ARCH
+  char *prgname;
+#else /* WITH_LOADER_ARCH */
+  void (*init)(void);
+#endif /* WITH_LOADER_ARCH */
+  
+  struct ctk_icon *icon;
+
+#if WITH_LOADER_ARCH
+  void *loadaddr;
+#endif /* WITH_LOADER_ARCH */
+};
+
+#if WITH_LOADER_ARCH
+#define DSC(dscname, description, prgname, initfunc, icon) \
+        struct dsc dscname = {description, prgname, icon}
+#else /* WITH_LOADER_ARCH */
+#define DSC(dscname, description, prgname, initfunc, icon) \
+    void initfunc(void); \
+    struct dsc dscname = {description, initfunc, icon}
+#endif /* WITH_LOADER_ARCH */
+
+#define DSC_HEADER(name) extern struct dsc name;
+
+#endif /* _DSC_H__ */
diff --git a/contiki/ek/loader.h b/contiki/ek/loader.h
index 5eeee3b..abec50f 100644
--- a/contiki/ek/loader.h
+++ b/contiki/ek/loader.h
@@ -32,7 +32,7 @@
  *
  * This file is part of the Contiki desktop OS
  *
- * $Id: loader.h,v 1.2 2003/04/08 19:28:55 adamdunkels Exp $
+ * $Id: loader.h,v 1.3 2003/04/17 19:00:02 adamdunkels Exp $
  *
  */
 #ifndef __LOADER_H__
@@ -49,10 +49,18 @@
 #define LOADER_LOAD(name) LOADER_OK
 #endif /* LOADER_LOAD */
 
+#ifndef LOADER_LOAD_DSC
+#define LOADER_LOAD_DSC(name) NULL
+#endif /* LOADER_LOAD_DSC */
+
 #ifndef LOADER_UNLOAD
 #define LOADER_UNLOAD()
 #endif /* LOADER_UNLOAD */
 
+#ifndef LOADER_UNLOAD_DSC(dsc)
+#define LOADER_UNLOAD_DSC(dsc)
+#endif /* LOADER_UNLOAD */
+
 
 
 #define LOADER_OK 0