/freebsd/usr.sbin/ppp/ |
H A D | fsm.c | 129 struct fsm *fp = (struct fsm *)v; in StoppedTimeout() local 131 log_Printf(fp->LogLevel, "%s: Stopped timer expired\n", fp->link->name); in StoppedTimeout() 132 if (fp->OpenTimer.state == TIMER_RUNNING) { in StoppedTimeout() 134 fp->link->name, fp->name); in StoppedTimeout() 135 timer_Stop(&fp->OpenTimer); in StoppedTimeout() 137 if (fp->state == ST_STOPPED) in StoppedTimeout() 138 fsm2initial(fp); in StoppedTimeout() 142 fsm_Init(struct fsm *fp, const char *name, u_short proto, int mincode, in fsm_Init() argument 147 fp->name = name; in fsm_Init() 148 fp->proto = proto; in fsm_Init() [all …]
|
/freebsd/sbin/ipf/libipf/ |
H A D | printfr.c | 17 printfr( struct frentry *fp, ioctlfunc_t iocfunc) in printfr() argument 27 type = fp->fr_type & ~FR_T_BUILTIN; in printfr() 29 if ((fp->fr_type & FR_T_BUILTIN) != 0) in printfr() 32 if (fp->fr_collect != 0) in printfr() 33 PRINTF("%u ", fp->fr_collect); in printfr() 35 if (fp->fr_type == FR_T_CALLFUNC) { in printfr() 37 } else if (fp->fr_func != NULL) { in printfr() 39 if ((fp->fr_flags & FR_CALLNOW) != 0) in printfr() 41 s = kvatoname(fp->fr_func, iocfunc); in printfr() 42 PRINTF(" %s/%u", s ? s : "?", fp->fr_arg); in printfr() [all …]
|
/freebsd/contrib/openbsm/libbsm/ |
H A D | bsm_io.c | 146 print_delim(FILE *fp, const char *del) in print_delim() argument 149 fprintf(fp, "%s", del); in print_delim() 156 print_1_byte(FILE *fp, u_char val, const char *format) in print_1_byte() argument 159 fprintf(fp, format, val); in print_1_byte() 166 print_2_bytes(FILE *fp, u_int16_t val, const char *format) in print_2_bytes() argument 169 fprintf(fp, format, val); in print_2_bytes() 176 print_4_bytes(FILE *fp, u_int32_t val, const char *format) in print_4_bytes() argument 179 fprintf(fp, format, val); in print_4_bytes() 186 print_8_bytes(FILE *fp, u_int64_t val, const char *format) in print_8_bytes() argument 189 fprintf(fp, format, val); in print_8_bytes() [all …]
|
/freebsd/lib/libc/stdio/ |
H A D | ungetc.c | 52 __submore(FILE *fp) in __submore() argument 57 if (fp->_ub._base == fp->_ubuf) { in __submore() 63 fp->_ub._base = p; in __submore() 64 fp->_ub._size = BUFSIZ; in __submore() 65 p += BUFSIZ - sizeof(fp->_ubuf); in __submore() 66 for (i = sizeof(fp->_ubuf); --i >= 0;) in __submore() 67 p[i] = fp->_ubuf[i]; in __submore() 68 fp->_p = p; in __submore() 71 i = fp->_ub._size; in __submore() 72 p = reallocarray(fp->_ub._base, i, 2); in __submore() [all …]
|
H A D | freopen.c | 55 FILE * __restrict fp) in freopen() argument 62 (void) fclose(fp); in freopen() 67 FLOCKFILE_CANCELSAFE(fp); in freopen() 79 if (fp->_flags == 0) { in freopen() 81 fp = NULL; in freopen() 84 if ((dflags = _fcntl(fp->_file, F_GETFL)) < 0) { in freopen() 86 fclose(fp); in freopen() 88 fp = NULL; in freopen() 94 fclose(fp); in freopen() 96 fp = NULL; in freopen() [all …]
|
H A D | refill.c | 47 lflush(FILE *fp) in lflush() argument 51 if ((fp->_flags & (__SLBF|__SWR)) == (__SLBF|__SWR)) { in lflush() 52 FLOCKFILE_CANCELSAFE(fp); in lflush() 53 ret = __sflush(fp); in lflush() 64 __srefill(FILE *fp) in __srefill() argument 71 ORIENT(fp, -1); in __srefill() 73 fp->_r = 0; /* largely a convenience for callers */ in __srefill() 76 if (fp->_flags & __SEOF) in __srefill() 80 if ((fp->_flags & __SRD) == 0) { in __srefill() 81 if ((fp->_flags & __SRW) == 0) { in __srefill() [all …]
|
H A D | fseek.c | 50 fseek(FILE *fp, long offset, int whence) in fseek() argument 59 FLOCKFILE_CANCELSAFE(fp); in fseek() 60 ret = _fseeko(fp, (off_t)offset, whence, 1); in fseek() 68 fseeko(FILE *fp, off_t offset, int whence) in fseeko() argument 77 FLOCKFILE_CANCELSAFE(fp); in fseeko() 78 ret = _fseeko(fp, offset, whence, 0); in fseeko() 90 _fseeko(FILE *fp, off_t offset, int whence, int ltest) in _fseeko() argument 101 if ((seekfn = fp->_seek) == NULL) { in _fseeko() 118 if (_ftello(fp, &curoff)) in _fseeko() 165 if (fp->_bf._base == NULL) in _fseeko() [all …]
|
H A D | stdio.c | 51 FILE *fp = cookie; in __sread() local 53 return(_read(fp->_file, buf, (size_t)n)); in __sread() 59 FILE *fp = cookie; in __swrite() local 61 return (_write(fp->_file, buf, (size_t)n)); in __swrite() 67 FILE *fp = cookie; in __sseek() local 69 return (lseek(fp->_file, (off_t)offset, whence)); in __sseek() 83 _sread(FILE *fp, char *buf, int n) in _sread() argument 87 ret = (*fp->_read)(fp->_cookie, buf, n); in _sread() 89 if (fp->_flags & __SOFF) { in _sread() 90 if (fp->_offset <= OFF_MAX - ret) in _sread() [all …]
|
/freebsd/cddl/contrib/opensolaris/common/ctf/ |
H A D | ctf_open.c | 249 init_symtab(ctf_file_t *fp, const ctf_header_t *hp, in init_symtab() argument 253 uint_t *xp = fp->ctf_sxlate; in init_symtab() 254 uint_t *xend = xp + fp->ctf_nsyms; in init_symtab() 298 objtoff += fp->ctf_idwidth; in init_symtab() 309 info = *(uint_t *)((uintptr_t)fp->ctf_buf + funcoff); in init_symtab() 310 vlen = LCTF_INFO_VLEN(fp, info); in init_symtab() 317 if (LCTF_INFO_KIND(fp, info) == CTF_K_UNKNOWN && in init_symtab() 319 funcoff += fp->ctf_idwidth; in init_symtab() 322 roundup2(fp->ctf_idwidth * (vlen + 2), 4); in init_symtab() 331 ctf_dprintf("loaded %lu symtab entries\n", fp->ctf_nsyms); in init_symtab() [all …]
|
H A D | ctf_lookup.c | 81 ctf_lookup_by_name(ctf_file_t *fp, const char *name) in ctf_lookup_by_name() argument 92 return (ctf_set_errno(fp, EINVAL)); in ctf_lookup_by_name() 114 ntype = fp->ctf_ptrtab[LCTF_TYPE_TO_INDEX(fp, type)]; in ctf_lookup_by_name() 116 ntype = ctf_type_resolve(fp, type); in ctf_lookup_by_name() 117 if (ntype == CTF_ERR || (ntype = fp->ctf_ptrtab[ in ctf_lookup_by_name() 118 LCTF_TYPE_TO_INDEX(fp, ntype)]) == 0) { in ctf_lookup_by_name() 119 (void) ctf_set_errno(fp, ECTF_NOTYPE); in ctf_lookup_by_name() 124 type = LCTF_INDEX_TO_TYPE(fp, ntype, in ctf_lookup_by_name() 125 (fp->ctf_flags & LCTF_CHILD)); in ctf_lookup_by_name() 134 for (lp = fp->ctf_lookups; lp->ctl_prefix != NULL; lp++) { in ctf_lookup_by_name() [all …]
|
/freebsd/contrib/sendmail/libsm/ |
H A D | ungetc.c | 50 sm_submore_x(fp) in sm_submore_x() argument 51 SM_FILE_T *fp; in sm_submore_x() 56 if (fp->f_ub.smb_base == fp->f_ubuf) 60 fp->f_ub.smb_base = p; 61 fp->f_ub.smb_size = SM_IO_BUFSIZ; 62 p += SM_IO_BUFSIZ - sizeof(fp->f_ubuf); 63 for (i = sizeof(fp->f_ubuf); --i >= 0;) 64 p[i] = fp->f_ubuf[i]; 65 fp->f_p = p; 68 i = fp->f_ub.smb_size; [all …]
|
H A D | fseek.c | 77 sm_io_seek(fp, timeout, offset, whence) in sm_io_seek() argument 78 register SM_FILE_T *fp; in sm_io_seek() 91 SM_REQUIRE_ISA(fp, SmFileMagic); 98 if ((seekfn = fp->f_seek) == NULL) 105 timeout = fp->f_timeout; 145 sm_flush(fp, (int *) &timeout); 147 if (fp->f_flags & SMOFF) 148 curoff = fp->f_lseekoff; 151 curoff = (*seekfn)(fp, (off_t) 0, SM_IO_SEEK_CUR); 158 if (fp->f_flags & SMRD) [all …]
|
H A D | refill.c | 59 #define SM_IO_RD_TIMEOUT(fp, fd, to, timeout, sel_ret) \ argument 88 fp->f_r = 0; \ 89 fp->f_flags |= SMERR; \ 118 sm_lflush(fp, timeout) in sm_lflush() argument 119 SM_FILE_T *fp; in sm_lflush() 123 if ((fp->f_flags & (SMLBF|SMWR)) == (SMLBF|SMWR)) 124 return sm_flush(fp, timeout); 141 sm_refill(fp, timeout) in sm_refill() argument 142 register SM_FILE_T *fp; in sm_refill() 150 timeout = fp->f_timeout; [all …]
|
H A D | findfp.c | 153 register SM_FILE_T *fp; local 164 fp = oldfp; 170 for (fp = g->gl_iobs, n = g->gl_niobs; --n >= 0; fp++) 171 if (fp->sm_magic == NULL) 177 fp->sm_magic = SmFileMagic; /* 'fp' now valid and in-use */ 178 fp->f_p = NULL; /* no current pointer */ 179 fp->f_w = 0; /* nothing to write */ 180 fp->f_r = 0; /* nothing to read */ 181 fp->f_flags = flags; 182 fp->f_file = -1; /* no file */ [all …]
|
H A D | fvwrite.c | 45 #define COPY(n) (void)memcpy((void *)fp->f_p, (void *)p, (size_t)(n)) 56 sm_fvwrite(fp, timeout, uio) 57 register SM_FILE_T *fp; 74 if (cantwrite(fp)) 80 SM_CONVERT_TIME(fp, fd, timeout, &to); 86 if (fp->f_flags & SMNBF) 93 w = (*fp->f_write)(fp, p, SM_MIN(len, SM_IO_BUFSIZ)); 102 SM_IO_WR_TIMEOUT(fp, fd, timeout); 112 else if ((fp->f_flags & SMLBF) == 0) 130 if ((((fp->f_flags & (SMALC | SMSTR)) == (SMALC | SMSTR)) [all …]
|
H A D | smstdio.c | 50 sm_stdioopen(fp, info, flags, rpool) in sm_stdioopen() argument 51 SM_FILE_T *fp; in sm_stdioopen() 98 fp->f_cookie = s; 113 setup(fp) in setup() argument 114 SM_FILE_T *fp; in setup() 116 if (fp->f_cookie == NULL) 118 switch (fp->f_ival) 121 fp->f_cookie = stdin; 124 fp->f_cookie = stdout; 127 fp->f_cookie = stderr; [all …]
|
/freebsd/sys/contrib/openzfs/lib/libnvpair/ |
H A D | libnvpair_json.c | 24 #define FPRINTF(fp, ...) \ argument 26 if (fprintf(fp, __VA_ARGS__) < 0) \ 47 nvlist_print_json_string(FILE *fp, const char *input) in nvlist_print_json_string() argument 53 FPRINTF(fp, "\""); in nvlist_print_json_string() 64 FPRINTF(fp, "\\\""); in nvlist_print_json_string() 67 FPRINTF(fp, "\\n"); in nvlist_print_json_string() 70 FPRINTF(fp, "\\r"); in nvlist_print_json_string() 73 FPRINTF(fp, "\\\\"); in nvlist_print_json_string() 76 FPRINTF(fp, "\\f"); in nvlist_print_json_string() 79 FPRINTF(fp, "\\t"); in nvlist_print_json_string() [all …]
|
/freebsd/libexec/bootpd/ |
H A D | dumptab.c | 46 FILE *fp; in dumptab() local 91 if ((fp = fopen(filename, "w")) == NULL) { in dumptab() 97 fprintf(fp, "\n# %s %s.%d\n", progname, VERSION, PATCHLEVEL); in dumptab() 98 fprintf(fp, "# %s: dump of bootp server database.\n", filename); in dumptab() 99 fprintf(fp, "# Dump taken %s", ctime(&t)); in dumptab() 100 fwrite(legend, 1, sizeof(legend) - 1, fp); in dumptab() 105 dump_host(fp, hp); in dumptab() 106 fprintf(fp, "\n"); in dumptab() 109 fclose(fp); in dumptab() 122 dump_host(FILE *fp, struct host *hp) in dump_host() argument [all …]
|
/freebsd/contrib/llvm-project/compiler-rt/lib/builtins/hexagon/ |
H A D | common_entry_exit_abi2.S | 42 memd(fp+#-48) = r27:26 43 memd(fp+#-40) = r25:24 46 memd(fp+#-32) = r23:22 47 memd(fp+#-24) = r21:20 50 memd(fp+#-16) = r19:18 51 memd(fp+#-8) = r17:16 58 memd(fp+#-40) = r25:24 59 memd(fp+#-32) = r23:22 62 memd(fp+#-24) = r21:20 63 memd(fp+#-16) = r19:18 [all …]
|
/freebsd/usr.bin/fortune/fortune/ |
H A D | fortune.c | 205 display(FILEDESC *fp) in display() argument 211 open_fp(fp); in display() 212 fseeko(fp->inf, Seekpts[0], SEEK_SET); in display() 213 for (Fort_len = 0; fgets(line, sizeof line, fp->inf) != NULL && in display() 214 !STR_ENDSTRING(line, fp->tbl); Fort_len++) { in display() 215 if (fp->tbl.str_flags & STR_ROTATED) in display() 224 if (fp->tbl.str_flags & STR_COMMENTS in display() 225 && line[0] == fp->tbl.str_delim in display() 226 && line[1] == fp->tbl.str_delim) in display() 446 FILEDESC *fp; in add_file() local [all …]
|
/freebsd/lib/libc/tests/stdio/ |
H A D | open_memstream2_test.c | 54 FILE *fp; in ATF_TC_BODY() local 57 fp = open_memstream(&buf, &len); in ATF_TC_BODY() 58 ATF_REQUIRE_MSG(fp != NULL, "open_memstream failed"); in ATF_TC_BODY() 60 fprintf(fp, "hello my world"); in ATF_TC_BODY() 61 fflush(fp); in ATF_TC_BODY() 63 eob = ftello(fp); in ATF_TC_BODY() 64 rewind(fp); in ATF_TC_BODY() 65 fprintf(fp, "good-bye"); in ATF_TC_BODY() 66 fseeko(fp, eob, SEEK_SET); in ATF_TC_BODY() 67 fclose(fp); in ATF_TC_BODY() [all …]
|
H A D | open_wmemstream_test.c | 54 FILE *fp; in ATF_TC_BODY() local 57 fp = open_wmemstream(&buf, &len); in ATF_TC_BODY() 58 ATF_REQUIRE_MSG(fp != NULL, "open_wmemstream failed"); in ATF_TC_BODY() 60 fwprintf(fp, L"hello my world"); in ATF_TC_BODY() 61 fflush(fp); in ATF_TC_BODY() 63 eob = ftello(fp); in ATF_TC_BODY() 64 rewind(fp); in ATF_TC_BODY() 65 fwprintf(fp, L"good-bye"); in ATF_TC_BODY() 66 fseeko(fp, eob, SEEK_SET); in ATF_TC_BODY() 67 fclose(fp); in ATF_TC_BODY() [all …]
|
H A D | fmemopen2_test.c | 47 FILE *fp; in ATF_TC_BODY() local 52 fp = fmemopen(buf, sizeof(buf), "w"); in ATF_TC_BODY() 53 ATF_REQUIRE(fp != NULL); in ATF_TC_BODY() 56 nofw = fwrite(str, 1, sizeof(str), fp); in ATF_TC_BODY() 60 rc = fclose(fp); in ATF_TC_BODY() 64 fp = fmemopen(buf, sizeof(buf), "r"); in ATF_TC_BODY() 65 ATF_REQUIRE(fp != NULL); in ATF_TC_BODY() 69 nofr = fread(buf2, 1, sizeof(buf2), fp); in ATF_TC_BODY() 80 rc = fclose(fp); in ATF_TC_BODY() 84 fp = fmemopen(str, 4, "w"); in ATF_TC_BODY() [all …]
|
/freebsd/contrib/netbsd-tests/lib/libc/stdio/ |
H A D | t_fmemopen.c | 131 FILE *fp; in ATF_TC_BODY() local 134 fp = fmemopen(&buf[0], sizeof(buf), *p); in ATF_TC_BODY() 139 ATF_CHECK(fp != NULL); in ATF_TC_BODY() 141 ATF_CHECK(fclose(fp) == 0); in ATF_TC_BODY() 159 FILE *fp; in ATF_TC_BODY() local 166 fp = fmemopen(NULL, BUFSIZ, *p); in ATF_TC_BODY() 167 ATF_CHECK(fp != NULL); in ATF_TC_BODY() 173 ATF_CHECK(ftello(fp) == (off_t)0); in ATF_TC_BODY() 175 ATF_CHECK(fclose(fp) == 0); in ATF_TC_BODY() 188 FILE *fp; in ATF_TC_BODY() local [all …]
|
/freebsd/sys/powerpc/fpu/ |
H A D | fpu_implode.c | 76 round(struct fpemu *fe, struct fpn *fp) in round() argument 82 m0 = fp->fp_mant[0]; in round() 83 m1 = fp->fp_mant[1]; in round() 84 m2 = fp->fp_mant[2]; in round() 85 m3 = fp->fp_mant[3]; in round() 87 s = fp->fp_sticky; in round() 111 if ((gr & 1) || fp->fp_sticky || (m3 & 1)) in round() 121 if (fp->fp_sign) in round() 127 if (!fp->fp_sign) in round() 139 fp->fp_mant[0] = m0; in round() [all …]
|