deleted api stuff, own cvs module now. found seg fault reason, fixed though till...
[my-code/ivac.git] / src / ivac.c
index e959ef8..f6a1118 100644 (file)
@@ -319,8 +319,6 @@ int ivac_regular_cb(t_event *event,void *ptr) {
 
   ivac=(t_ivac *)ptr;
 
-  ivac_add_to_monitor(ivac,"event HUGH");
-
   /* usual jobs like audio & video transmit ... */
 
   return SUCCESS;
@@ -335,7 +333,9 @@ int ivac_parse_command(t_input *input,void *ptr) {
   char *data,valid;
   char c_str[IVAC_CONSOLE_STRING_LEN];
   char arg[IVAC_ARG_COUNT][IVAC_ARG_LEN];
-  char debug_string[128];
+#ifdef DEBUG
+  char debug_string[IVAC_CONSOLE_STRING_LEN];
+#endif
 
   ivac=(t_ivac *)ptr;
   data=input->content;
@@ -345,15 +345,12 @@ int ivac_parse_command(t_input *input,void *ptr) {
   ivac_display_prompt_content(ivac);
   ivac_display_draw(ivac);
 
-#ifdef DEBUG
-  ivac_add_to_monitor(ivac,"nach display refresh");
-#endif
-
   /* parse command routines */
   if(data[input->c_count-1]=='\n'||data[input->c_count-1]=='\r') {
 
 #ifdef DEBUG
-    ivac_add_to_monitor(ivac,"got newline or carriage return!");
+    sprintf(debug_string,"got %02x",data[input->c_count-1]);
+    ivac_add_to_monitor(ivac,debug_string);
 #endif
 
     /* delete console string + args */
@@ -377,6 +374,10 @@ int ivac_parse_command(t_input *input,void *ptr) {
       i+=k;
     }
 
+#ifdef DEBUG
+    sprintf(debug_string,"got args: %s ...",arg[0]);
+    ivac_add_to_monitor(ivac,debug_string);
+#endif
 
     /* parse command  aka arg[0] */
     if(!(strncmp(arg[0],"quit",4))) {
@@ -493,8 +494,6 @@ int ivac_parse_command(t_input *input,void *ptr) {
 
   }
 
-  ivac_add_to_monitor(ivac,"debug: end of parse function");
-
   return SUCCESS;
 }
 
@@ -586,12 +585,24 @@ int ivac_display_prompt_content(t_ivac *ivac) {
 
   char string[IVAC_CONSOLE_STRING_LEN];
   int count;
+#ifdef DEBUG
+  char debug_string[IVAC_CONSOLE_STRING_LEN];
+#endif
 
   for(count=0;count<ivac->input.c_count;count++)
     string[count]=ivac->input.content[count];
-  for(;count<ivac->display.max_x-8;count++) string[count]=' ';
+  for(count=ivac->input.c_count;count<IVAC_CONSOLE_STRING_LEN-8;count++)
+    string[count]=' ';
   display_string(&(ivac->display),8,ivac->display.max_y-1,
                  string,ivac->display.max_x);
+
+#ifdef DEBUG
+  sprintf(debug_string,"%02x %02x %02x %02x ...",ivac->input.content[0],
+                                                 ivac->input.content[1],
+                                                 ivac->input.content[2],
+                                                 ivac->input.content[3]);
+  ivac_add_to_monitor(ivac,debug_string);
+#endif
   
   return SUCCESS;
 }