Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

nml_mod.cc File Reference

#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <stdarg.h>
#include <math.h>
#include "nml_mod.hh"
#include "nml_oi.hh"
#include "rcs_prnt.hh"
#include "rcs_exit.hh"

Include dependency graph for node/nml_mod.cc:

Include dependency graph

Go to the source code of this file.

Functions

int logTextToNML (NML *errorLog, const char *fmt,...)


Function Documentation

int logTextToNML NML   errorLog,
const char *    fmt,
...   
 

Definition at line 724 of file node/nml_mod.cc.

00725 {
00726   NML_TEXT text_msg;
00727   va_list ap;
00728 
00729   // check channel for validity
00730   if (errorLog == NULL)
00731     return -1;
00732 
00733   // write args to NML message
00734   va_start (ap, fmt);
00735 #ifndef UNDER_CE
00736   vsprintf (text_msg.text, fmt, ap);
00737 #else
00738   RCS_CE_VSPRINTF (text_msg.text, fmt, ap);
00739 #endif
00740   va_end (ap);
00741 
00742   //  rcs_print("%s\n", text_msg.text);
00743 
00744   // force a NULL at the end for safety
00745   text_msg.text[NML_TEXT_LEN - 1] = 0;
00746 
00747   // write it
00748   if (errorLog->write (text_msg) < 0)
00749     {
00750       return -1;
00751     }
00752 
00753   return 0;
00754 }


Generated on Sun Dec 2 15:57:16 2001 for rcslib by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001