view dpid/dpid_common.c @ 351:6fdc59173d00

- reverted all of the style->backgroundColor to current_bg_color - Fixed table_cell_style's backgroundColor when TR specifies one.
author jcid
date Fri, 26 Sep 2008 16:37:38 +0200
parents 6ee11bf9e3ea
children 49735e578039
line wrap: on
line source
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "dpid_common.h"

/*
 * Send a verbose error message.
 */
void errmsg(char *caller, char *called, int errornum, char *file, int line)
{
   MSG_ERR("%s:%d: %s: %s\n", file, line, caller, called);
   if (errornum > 0)
      MSG_ERR("%s\n", dStrerror(errornum));
}

/*! Selector function for scandir
 * Do not scan files starting with '.'
 */
int no_dotfiles(const struct dirent *filedat)
{
   if (filedat->d_name[0] == '.')
      return 0;
   else
      return 1;
}

/*!
 * Provides an error checked write command.
 * Call this via the CKD_WRITE macro
 * \return write return value
 */
ssize_t ckd_write(int fd, char *msg, char *file, int line)
{
   ssize_t ret;

   do {
      ret = write(fd, msg, strlen(msg));
   } while (ret == -1 && errno == EINTR);
   if (ret == -1) {
      MSG_ERR("%s:%d: write: %s\n", file, line, dStrerror(errno));
   }
   return (ret);
}