/*
    Robot servo controller

    Sends contrller data to the server

    (C) 2004 Jason Hunt

    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2
    of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

    Contact: huntjas2@msu.edu

    Compile with -lwsock32

    FILE: debug.cpp
    
    
    Simple debugging subsystem
*/

#include <stdio.h>

/* clear the debug file */
void debug_start( void )
{
    FILE *f = fopen("debug.txt", "wt");
    fclose(f);
}
/* end fo debug_start */


/* add a string to the debug file */
void debug(char *s)
{
    FILE *f = fopen("debug.txt", "at");
    if (!f) return;
    
    fprintf(f, "%s\n", s);
    
    fclose(f);
}
/* end of debug */


/* and a string and an unsigned int to the debug file */
void debug(char *s, unsigned int a)
{
    FILE *f = fopen("debug.txt", "at");
    if (!f) return;
    
    fprintf(f, "%s   %d\n", s, a);
    
    fclose(f);
}
/* end of debug */


/* and a string and an int to the debug file */
void debug(char *s, int a)
{
    FILE *f = fopen("debug.txt", "at");
    if (!f) return;
    
    fprintf(f, "%s   %d\n", s, a);
    
    fclose(f);
}
/* end of debug */


