示例#1
0
static void writeAttrVals(struct gff3AttrVals *av, FILE *fh)
/* write one attribute and it's values */
{
writeEscaped(av->attr, fh);
fputc('=', fh);
struct slName *val;
for (val = av->vals; val != NULL; val = val->next)
    {
    if (val != av->vals)
        fputc(',', fh);
    writeEscaped(val->name, fh);
    }
}
  uint8_t sendFrame(uint8_t* frame, uint8_t frameLength) {
    writeChecksum = 0;
    writeEscaped(writeSequence);
    for (uint8_t index = 0; index < frameLength; index++) {
      writeEscaped(frame[index]);
    }
    writeEscaped(writeChecksum);
    Serial.write(End);

    // On Teensies, use the extended send_now to perform an undelayed send
    #ifdef USBserial_h_
    Serial.send_now();
    #endif

    return writeSequence++;
  }
示例#3
0
文件: svg_out.c 项目: grossman/mscgen
void SvgTextC(struct ADrawTag *ctx,
              unsigned int     x,
              unsigned int     y,
              const char      *string,
              const char      *url)
{
    SvgContext  *context = getSvgCtx(ctx);
    unsigned int hw = SvgTextWidth(ctx, string) / 2;

    svgRect(ctx, getSvgBgPen(ctx), x - (hw + 2), y - SvgTextHeight(ctx) + 1, x + hw, y - 1);

    y += getSpace(ctx, SvgHelvetica.descender);

    if(url)
    {
        fprintf(getSvgFile(ctx), "<a xlink:href=\"%s\">", url);
    }

    fprintf(getSvgFile(ctx),
            "<text x=\"%u\" y=\"%u\" textLength=\"%u\" font-family=\"Helvetica\" font-size=\"%u\" fill=\"%s\" text-anchor=\"middle\">",
            x, y, SvgTextWidth(ctx, string), context->fontPoints, context->penColName);
    writeEscaped(ctx, string);
    fprintf(getSvgFile(ctx), "</text>\n");

    if(url)
    {
        fprintf(getSvgFile(ctx), "</a>", url);
    }
}
示例#4
0
static void writeFields(struct gff3Ann *g3a, FILE *fh)
/* write an annotation record fields */
{
writeEscaped(g3a->seqid, fh);
fputc('\t', fh);
writeEscaped(g3a->source, fh);
fputc('\t', fh);
writeEscaped(g3a->type, fh);
fprintf(fh, "\t%d\t%d", g3a->start+1, g3a->end);
fputc('\t', fh);
if (g3a->haveScore)
    fprintf(fh, "%g", g3a->score);
else
    fputc('.', fh);
fprintf(fh, "\t%c", (g3a->strand != NULL) ? g3a->strand[0] : '.');
fputc('\t', fh);
if (g3a->phase < 0)
    fputc('.', fh);
else
    fprintf(fh, "%d", g3a->phase);
}
示例#5
0
文件: dsv.hpp 项目: chilabot/chila
 inline void writeField(std::ostream &out, const char *buff, unsigned size, char delim)
 {
     writeEscaped(out, buff, buff + size, delim);
 }
示例#6
0
文件: dsv.hpp 项目: chilabot/chila
 inline void save(std::ostream &out, const chila::lib::misc::String<size> &data, char delim)
 {
     writeEscaped(out, data.begin(), data.end(), delim);
 }
spark::JSONWriter& spark::JSONWriter::value(const char *val, size_t size) {
    writeSeparator();
    writeEscaped(val, size);
    state_ = NEXT;
    return *this;
}
spark::JSONWriter& spark::JSONWriter::name(const char *name, size_t size) {
    writeSeparator();
    writeEscaped(name, size);
    state_ = VALUE;
    return *this;
}