File: write.h

package info (click to toggle)
libperlio-eol-perl 0.19-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 148 kB
  • sloc: ansic: 169; perl: 41; makefile: 3
file content (29 lines) | stat: -rw-r--r-- 673 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#define WriteInsert(sym, len) \
    if (PerlIOBuf_write(aTHX_ f, sym, len) < len) \
        return i - (STDCHAR*)vbuf;

#define WriteOutBuffer \
    WriteInsert( start, (i - start) );

#define WriteCheckForCRLF \
    EOL_CheckForCRLF( s->write );

#define WriteCheckForCRandCRLF \
    if (*i == EOL_CR) { WriteCheckForCRLF };

#define WriteWithCRLF \
    WriteOutBuffer; \
    WriteInsert( "\015\012", 2 ); \
    WriteCheckForCRandCRLF;

#define WriteWithLF \
    WriteOutBuffer; \
    WriteInsert( "\012", 1 ); \
    WriteCheckForCRLF;

#define WriteWithCR \
    WriteOutBuffer; \
    WriteInsert( "\015", 1 ); \
    WriteCheckForCRandCRLF;

/* vim: set filetype=perl: */