Home
last modified time | relevance | path

Searched refs:fp (Results 1 – 25 of 361) sorted by relevance

12345678910>>...15

/device/linaro/bootloader/edk2/StdLib/LibC/Stdio/
Dungetc.c64 __submore(FILE *fp) in __submore() argument
69 _DIAGASSERT(fp != NULL); in __submore()
70 if(fp == NULL) { in __submore()
75 if (_UB(fp)._base == fp->_ubuf) { in __submore()
81 _UB(fp)._base = p; in __submore()
82 _UB(fp)._size = BUFSIZ; in __submore()
83 p += BUFSIZ - sizeof(fp->_ubuf); in __submore()
84 for (i = sizeof(fp->_ubuf); --i >= 0;) in __submore()
85 p[i] = fp->_ubuf[i]; in __submore()
86 fp->_p = p; in __submore()
[all …]
Dfseeko.c72 fseeko(FILE *fp, off_t offset, int whence) in __weak_alias()
80 _DIAGASSERT(fp != NULL); in __weak_alias()
81 if(fp == NULL) { in __weak_alias()
96 FLOCKFILE(fp); in __weak_alias()
101 if ((seekfn = fp->_seek) == NULL) { in __weak_alias()
103 FUNLOCKFILE(fp); in __weak_alias()
120 __sflush(fp); /* may adjust seek offset on append stream */ in __weak_alias()
121 if (fp->_flags & __SOFF) in __weak_alias()
122 curoff = fp->_offset; in __weak_alias()
124 curoff = (*seekfn)(fp->_cookie, (fpos_t)0, SEEK_CUR); in __weak_alias()
[all …]
Drefill.c61 lflush(FILE *fp) in lflush() argument
64 _DIAGASSERT(fp != NULL); in lflush()
65 if(fp == NULL) { in lflush()
70 if ((fp->_flags & (__SLBF|__SWR)) == (__SLBF|__SWR)) in lflush()
71 return (__sflush(fp)); in lflush()
80 __srefill(FILE *fp) in __srefill() argument
83 _DIAGASSERT(fp != NULL); in __srefill()
84 if(fp == NULL) { in __srefill()
93 fp->_r = 0; /* largely a convenience for callers */ in __srefill()
96 if (fp->_flags & __SEOF) { in __srefill()
[all …]
Dflockfile.c68 flockfile(FILE *fp) in flockfile() argument
71 __flockfile_internal(fp, 0); in flockfile()
75 ftrylockfile(FILE *fp) in ftrylockfile() argument
83 mutex_lock(&_LOCK(fp)); in ftrylockfile()
85 if (_LOCKOWNER(fp) == thr_self()) { in ftrylockfile()
86 _LOCKCOUNT(fp)++; in ftrylockfile()
87 } else if (_LOCKOWNER(fp) == NULL) { in ftrylockfile()
88 _LOCKOWNER(fp) = thr_self(); in ftrylockfile()
89 _LOCKCOUNT(fp) = 1; in ftrylockfile()
93 mutex_unlock(&_LOCK(fp)); in ftrylockfile()
[all …]
Dfreopen.c68 freopen(const char *file, const char *mode, FILE *fp) in freopen() argument
75 _DIAGASSERT(fp != NULL); in freopen()
76 if(fp == NULL) { in freopen()
82 (void) fclose(fp); in freopen()
97 if (fp->_flags == 0) { in freopen()
98 fp->_flags = __SEOF; /* hold on to it */ in freopen()
103 if (fp->_flags & __SWR) in freopen()
104 (void) __sflush(fp); in freopen()
106 isopen = fp->_close != NULL; in freopen()
107 if (((wantfd = fp->_file) >= 0) && isopen) { in freopen()
[all …]
Dfgetstr.c68 __slbexpand(FILE *fp, size_t newsize) in __slbexpand() argument
75 _DIAGASSERT(fp != NULL); in __slbexpand()
76 if(fp == NULL) { in __slbexpand()
81 if ((size_t)fp->_lb._size >= newsize) in __slbexpand()
83 if ((p = realloc(fp->_lb._base, newsize)) == NULL) in __slbexpand()
85 fp->_lb._base = p; in __slbexpand()
86 fp->_lb._size = (int)newsize; in __slbexpand()
98 __fgetstr(FILE *fp, size_t *lenp, int sep) in __fgetstr() argument
104 _DIAGASSERT(fp != NULL); in __fgetstr()
106 if(fp == NULL) { in __fgetstr()
[all …]
Dfvwrite.c63 __sfvwrite(FILE *fp, struct __suio *uio) in __sfvwrite() argument
72 _DIAGASSERT(fp != NULL); in __sfvwrite()
74 if(fp == NULL) { in __sfvwrite()
82 if (cantwrite(fp)) { in __sfvwrite()
88 #define COPY(n) (void)memcpy((void *)fp->_p, (void *)p, (size_t)(n)) in __sfvwrite()
101 if (fp->_flags & __SNBF) { in __sfvwrite()
107 w = (*fp->_write)(fp->_cookie, p, in __sfvwrite()
115 } else if ((fp->_flags & __SLBF) == 0) { in __sfvwrite()
129 if ((fp->_flags & (__SALC | __SSTR)) == in __sfvwrite()
130 (__SALC | __SSTR) && fp->_w < (int)len) { in __sfvwrite()
[all …]
Dfclose.c57 fclose(FILE *fp) in fclose() argument
61 _DIAGASSERT(fp != NULL); in fclose()
62 if(fp == NULL) { in fclose()
67 if (fp->_flags == 0) { /* not open! */ in fclose()
71 FLOCKFILE(fp); in fclose()
72 WCIO_FREE(fp); in fclose()
73 r = fp->_flags & __SWR ? __sflush(fp) : 0; in fclose()
74 if (fp->_close != NULL && (*fp->_close)(fp->_cookie) < 0) in fclose()
76 if (fp->_flags & __SMBF) in fclose()
77 free((char *)fp->_bf._base); in fclose()
[all …]
Dwsetup.c60 __swsetup(FILE *fp) in __swsetup() argument
63 _DIAGASSERT(fp != NULL); in __swsetup()
64 if(fp == NULL) { in __swsetup()
76 if ((fp->_flags & __SWR) == 0) { in __swsetup()
77 if ((fp->_flags & __SRW) == 0) in __swsetup()
79 if (fp->_flags & __SRD) { in __swsetup()
81 if (HASUB(fp)) in __swsetup()
82 FREEUB(fp); in __swsetup()
83 fp->_flags &= ~(__SRD|__SEOF); in __swsetup()
84 fp->_r = 0; in __swsetup()
[all …]
Dsetvbuf.c62 setvbuf(FILE *fp, char *buf, int mode, size_t size) in setvbuf() argument
68 _DIAGASSERT(fp != NULL); in setvbuf()
70 if(fp == NULL) { in setvbuf()
84 FLOCKFILE(fp); in setvbuf()
92 (void)__sflush(fp); in setvbuf()
93 if (HASUB(fp)) in setvbuf()
94 FREEUB(fp); in setvbuf()
95 WCIO_FREE(fp); in setvbuf()
96 fp->_r = fp->_lbfsize = 0; in setvbuf()
97 flags = fp->_flags; in setvbuf()
[all …]
Dmakebuf.c68 __smakebuf(FILE *fp) in __smakebuf() argument
75 _DIAGASSERT(fp != NULL); in __smakebuf()
77 if (fp != NULL) { in __smakebuf()
78 if (fp->_flags & __SNBF) { in __smakebuf()
79 fp->_bf._base = fp->_p = fp->_nbuf; in __smakebuf()
80 fp->_bf._size = MB_LEN_MAX; in __smakebuf()
83 flags = __swhatbuf(fp, &size, &couldbetty); in __smakebuf()
86 fp->_flags |= __SNBF; in __smakebuf()
87 fp->_bf._base = fp->_p = fp->_nbuf; in __smakebuf()
88 fp->_bf._size = 1; in __smakebuf()
[all …]
Dftell.c58 ftell(FILE *fp) in ftell() argument
62 FLOCKFILE(fp); in ftell()
64 if (fp->_seek == NULL) { in ftell()
65 FUNLOCKFILE(fp); in ftell()
74 __sflush(fp); /* may adjust seek offset on append stream */ in ftell()
75 if (fp->_flags & __SOFF) in ftell()
76 pos = fp->_offset; in ftell()
78 pos = (*fp->_seek)(fp->_cookie, (fpos_t)0, SEEK_CUR); in ftell()
80 FUNLOCKFILE(fp); in ftell()
84 if (fp->_flags & __SRD) { in ftell()
[all …]
Dftello.c55 ftello(FILE *fp) in __weak_alias()
59 FLOCKFILE(fp); in __weak_alias()
61 if (fp->_seek == NULL) { in __weak_alias()
62 FUNLOCKFILE(fp); in __weak_alias()
71 __sflush(fp); /* may adjust seek offset on append stream */ in __weak_alias()
72 if (fp->_flags & __SOFF) in __weak_alias()
73 pos = fp->_offset; in __weak_alias()
75 pos = (*fp->_seek)(fp->_cookie, (fpos_t)0, SEEK_CUR); in __weak_alias()
77 FUNLOCKFILE(fp); in __weak_alias()
81 if (fp->_flags & __SRD) { in __weak_alias()
[all …]
Dfpurge.c60 fpurge(fp) in fpurge() argument
61 FILE *fp; in fpurge()
64 _DIAGASSERT(fp != NULL);
65 if(fp == NULL) {
70 if (fp->_flags == 0) {
74 FLOCKFILE(fp);
75 if (HASUB(fp))
76 FREEUB(fp);
77 WCIO_FREE(fp);
78 fp->_p = fp->_bf._base;
[all …]
Dfflush.c60 fflush(FILE *fp) in fflush() argument
64 if (fp == NULL) { in fflush()
71 FLOCKFILE(fp); in fflush()
72 if ((fp->_flags & (__SWR | __SRW)) == 0) { in fflush()
76 r = __sflush(fp); in fflush()
78 FUNLOCKFILE(fp); in fflush()
83 __sflush(FILE *fp) in __sflush() argument
89 _DIAGASSERT(fp != NULL); in __sflush()
90 if(fp == NULL) { in __sflush()
95 t = fp->_flags; in __sflush()
[all …]
Dwbuf.c59 __swbuf(int c, FILE *fp) in __swbuf() argument
64 if(fp == NULL) { in __swbuf()
69 _SET_ORIENTATION(fp, -1); in __swbuf()
78 fp->_w = fp->_lbfsize; in __swbuf()
79 if (cantwrite(fp)) { in __swbuf()
94 n = (int)(fp->_p - fp->_bf._base); in __swbuf()
95 if (n >= fp->_bf._size) { in __swbuf()
96 if (fflush(fp)) in __swbuf()
100 fp->_w--; in __swbuf()
101 *fp->_p++ = (unsigned char)c; in __swbuf()
[all …]
Dstdio.c63 FILE *fp = cookie; in __sread() local
66 _DIAGASSERT(fp != NULL); in __sread()
68 if(fp == NULL) { in __sread()
73 ret = (int)read(fp->_file, buf, (size_t)n); in __sread()
76 fp->_offset += ret; in __sread()
78 fp->_flags &= ~__SOFF; /* paranoia */ in __sread()
85 FILE *fp = cookie; in __swrite() local
89 if(fp == NULL) { in __swrite()
94 if (fp->_flags & __SAPP) in __swrite()
95 (void) lseek(fp->_file, (off_t)0, SEEK_END); in __swrite()
[all …]
Dvfscanf.c140 __svfscanf(FILE *fp, char const *fmt0, va_list ap) in __svfscanf() argument
144 if(fp == NULL) { in __svfscanf()
148 FLOCKFILE(fp); in __svfscanf()
149 ret = __svfscanf_unlocked(fp, fmt0, ap); in __svfscanf()
150 FUNLOCKFILE(fp); in __svfscanf()
158 __svfscanf_unlocked(FILE *fp, const char *fmt0, va_list ap) in __svfscanf_unlocked() argument
182 _DIAGASSERT(fp != NULL); in __svfscanf_unlocked()
184 if(fp == NULL) { in __svfscanf_unlocked()
189 _SET_ORIENTATION(fp, -1); in __svfscanf_unlocked()
201 while ((fp->_r > 0 || __srefill(fp) == 0) && in __svfscanf_unlocked()
[all …]
Dfileext.h47 #define _EXT(fp) ((struct __sfileext *)(void *)((fp)->_ext._base)) argument
48 #define _UB(fp) _EXT(fp)->_ub argument
50 #define _LOCK(fp) (_EXT(fp)->_lock) argument
51 #define _LOCKCOND(fp) (_EXT(fp)->_lockcond) argument
52 #define _LOCKOWNER(fp) (_EXT(fp)->_lockowner) argument
53 #define _LOCKCOUNT(fp) (_EXT(fp)->_lockcount) argument
54 #define _LOCKINTERNAL(fp) (_EXT(fp)->_lockinternal) argument
55 #define _LOCKCANCELSTATE(fp) (_EXT(fp)->_lockcancelstate) argument
Dfgets.c61 fgets(char *buf, int n, FILE *fp) in fgets() argument
68 _DIAGASSERT(fp != NULL); in fgets()
69 if ((fp == NULL) || (n <= 0)) { /* sanity check */ in fgets()
74 FLOCKFILE(fp); in fgets()
75 _SET_ORIENTATION(fp, -1); in fgets()
82 if (fp->_r <= 0) { in fgets()
83 if (__srefill(fp)) { in fgets()
86 FUNLOCKFILE(fp); in fgets()
92 len = fp->_r; in fgets()
93 p = fp->_p; in fgets()
[all …]
Dfread.c56 fread(void *buf, size_t size, size_t count, FILE *fp) in fread() argument
63 _DIAGASSERT(fp != NULL); in fread()
64 if(fp == NULL) { in fread()
78 FLOCKFILE(fp); in fread()
79 if (fp->_r < 0) in fread()
80 fp->_r = 0; in fread()
83 while (resid > (size_t)(r = fp->_r)) { in fread()
84 (void)memcpy((void *)p, (void *)fp->_p, (size_t)r); in fread()
85 fp->_p += r; in fread()
89 if (__srefill(fp)) { in fread()
[all …]
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.2/Parser/
Dprintgrammar.c14 printgrammar(grammar *g, FILE *fp) in printgrammar() argument
16 fprintf(fp, "/* Generated by Parser/pgen */\n\n"); in printgrammar()
17 fprintf(fp, "#include \"pgenheaders.h\"\n"); in printgrammar()
18 fprintf(fp, "#include \"grammar.h\"\n"); in printgrammar()
19 fprintf(fp, "PyAPI_DATA(grammar) _PyParser_Grammar;\n"); in printgrammar()
20 printdfas(g, fp); in printgrammar()
21 printlabels(g, fp); in printgrammar()
22 fprintf(fp, "grammar _PyParser_Grammar = {\n"); in printgrammar()
23 fprintf(fp, " %d,\n", g->g_ndfas); in printgrammar()
24 fprintf(fp, " dfas,\n"); in printgrammar()
[all …]
/device/linaro/bootloader/edk2/EdkCompatibilityPkg/Sample/Tools/Source/SetStamp/
DSetStamp.c65 FILE *fp, in GetDateTime() argument
87 if (fgets (buffer, LINE_MAXLEN, fp) == NULL) { in GetDateTime()
113 if (fseek (fp, 0, SEEK_SET) != 0) { in GetDateTime()
118 if (fputs (buffer, fp) == EOF) { in GetDateTime()
178 FILE *fp, in ReadFromFile() argument
201 if (fseek (fp, offset, SEEK_SET) != 0) { in ReadFromFile()
208 if (fread (buffer, size, 1, fp) != 1) { in ReadFromFile()
218 FILE *fp, in WriteToFile() argument
241 if (fseek (fp, offset, SEEK_SET) != 0) { in WriteToFile()
248 if (fwrite (buffer, size, 1, fp) != 1) { in WriteToFile()
[all …]
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.2/Tools/unicode/
Dmakeunicodedata.py228 fp = open(FILE, "w")
229 print >>fp, "/* this file was generated by %s %s */" % (SCRIPT, VERSION)
230 print >>fp
231 print >>fp, '#define UNIDATA_VERSION "%s"' % UNIDATA_VERSION
232 print >>fp, "/* a list of unique database records */"
233 print >>fp, \
236 print >>fp, " {%d, %d, %d, %d, %d, %d}," % item
237 print >>fp, "};"
238 print >>fp
240 print >>fp, "/* Reindexing of NFC first characters. */"
[all …]
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.2/Lib/test/
Dtest_univnewlines2k.py40 with open(test_support.TESTFN, self.WRITEMODE) as fp:
41 fp.write(self.DATA)
50 with open(test_support.TESTFN, self.READMODE) as fp:
51 data = fp.read()
53 self.assertEqual(repr(fp.newlines), repr(self.NEWLINE))
56 with open(test_support.TESTFN, self.READMODE) as fp:
57 data = fp.readlines()
59 self.assertEqual(repr(fp.newlines), repr(self.NEWLINE))
62 with open(test_support.TESTFN, self.READMODE) as fp:
64 d = fp.readline()
[all …]

12345678910>>...15