IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 16, 2006, 10:58:49 PM (20 years ago)
Author:
eugene
Message:

major updates to use gprint for buffered / threaded printing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.basic/fprintf.c

    r4746 r7917  
    99
    1010  if (argc < 2) {
    11     fprintf (stderr, "USAGE: fprintf format value value ...\n");
     11    gprint (GP_ERR, "USAGE: fprintf format value value ...\n");
    1212    return (FALSE);
    1313  }
     
    2424    p2 = strchr (p1, '%');
    2525    if (p2 == (char *) NULL) {
    26       fprintf (stderr, "mismatch between format and values\n");
     26      gprint (GP_ERR, "mismatch between format and values\n");
    2727      return (FALSE);
    2828    }
    2929    if (strlen(q) + p2 - p1 > NCHAR) {
    30       fprintf (stderr, "line too long");
     30      gprint (GP_ERR, "line too long");
    3131      return (FALSE);
    3232    }
     
    5151        break;
    5252      default:
    53         fprintf (stderr, "syntax error in format (only e,f,s,d,c,x allowed)\n");
     53        gprint (GP_ERR, "syntax error in format (only e,f,s,d,c,x allowed)\n");
    5454        return (FALSE);
    5555    }
    5656    if (strlen(q) + strlen(tmp) > NCHAR) {
    57       fprintf (stderr, "line too long");
     57      gprint (GP_ERR, "line too long");
    5858      return (FALSE);
    5959    }
     
    6464  p2 = strchr (p1, '%');
    6565  if (p2 != (char *) NULL) {
    66     fprintf (stderr, "mismatch between format and values\n");
     66    gprint (GP_ERR, "mismatch between format and values\n");
    6767    return (FALSE);
    6868  }
     
    7070  p2 = p1 + strlen (p1);
    7171  if (strlen(q) + p2 - p1 > NCHAR) {
    72     fprintf (stderr, "line too long");
     72    gprint (GP_ERR, "line too long");
    7373    return (FALSE);
    7474  }
    7575  memcpy (q, p1, p2-p1);
    76   fprintf (GetOutfile(), "%s\n", line);
     76  gprint (GP_LOG, "%s\n", line);
    7777
    7878  return (TRUE);
Note: See TracChangeset for help on using the changeset viewer.