Home
last modified time | relevance | path

Searched refs:G (Results 1 – 25 of 110) sorted by relevance

12345

/busybox-1.35.0/miscutils/
Dhexedit.c35 #define G_pagesize cached_pagesize(G.pagesize)
45 #define G (*ptr_to_globals) macro
47 SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
58 tcsetattr_stdin_TCSANOW(&G.orig_termios); in restore_term()
65 if (!G.in_read_key) { in sig_catcher()
93 if ((G.size - offset) > 0) { in format_line()
95 if ((G.size - offset) <= 15) in format_line()
96 end = data + (G.size - offset) - 1; in format_line()
128 i = (cursor / 16) - G.height + 1; in redraw()
132 data = G.baseaddr + i * 16; in redraw()
[all …]
Dconspy.c88 #define G (*ptr_to_globals) macro
90 SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
91 G.width = G.height = UINT_MAX; \
92 G.last_attr--; \
118 G.col = G.line = 0; in clrscr()
123 if (G.curoff != state) { in set_cursor()
124 G.curoff = state; in set_cursor()
132 if (G.col != col || G.line != line) { in gotoxy()
133 G.col = col; in gotoxy()
134 G.line = line; in gotoxy()
[all …]
Dfbsplash.c85 #define G (*ptr_to_globals) macro
87 SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
102 if (G.bdebug_messages) { \
103 fprintf(G.logfile_fd, "[%s][%s] - %s\n", \
157 xioctl(fbfd, FBIOGET_VSCREENINFO, &G.scr_var); in fb_open()
158 xioctl(fbfd, FBIOGET_FSCREENINFO, &G.scr_fix); in fb_open()
160 switch (G.scr_var.bits_per_pixel) { in fb_open()
171 bb_error_msg_and_die("unsupported %u bpp", (int)G.scr_var.bits_per_pixel); in fb_open()
175 G.red_shift = 8 - G.scr_var.red.length; in fb_open()
176 G.green_shift = 8 - G.scr_var.green.length; in fb_open()
[all …]
/busybox-1.35.0/loginutils/
Dgetty.c111 #define G (*ptr_to_globals) macro
113 SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
165 G.speeds[G.numspeed] = bcode(cp); in parse_speeds()
166 if (G.speeds[G.numspeed] < 0) in parse_speeds()
169 G.numspeed++; in parse_speeds()
170 if (G.numspeed > MAX_SPEED) in parse_speeds()
183 &G.initstring, &G.fakehost, &G.issue, in parse_args()
184 &G.login, &G.timeout in parse_args()
187 G.initstring = xstrdup(G.initstring); in parse_args()
189 strcpy_and_process_escape_sequences(G.initstring, G.initstring); in parse_args()
[all …]
/busybox-1.35.0/coreutils/
Ddu.c105 #define G (*(struct globals*)bb_common_bufsiz1) macro
121 if (G.disp_unit) in print()
122 size += (G.disp_unit-1) / (unsigned)(512 * 2); in print()
129 make_human_readable_str(size, (option_mask32 & OPT_b) ? 1 : 512, G.disp_unit), in print()
132 if (G.disp_k) { in print()
152 G.status = EXIT_FAILURE; in du()
157 if (G.du_depth == 0) { in du()
158 G.dir_dev = statbuf.st_dev; in du()
159 } else if (G.dir_dev != statbuf.st_dev) { in du()
167 if (G.slink_depth > G.du_depth) { /* -H or -L */ in du()
[all …]
Dod_bloaty.c70 &str_A, &str_N, &str_j, &lst_t, &str_S, &G.bytes_per_block)
195 # define G_pseudo_offset G.pseudo_offset
218 #define address_base_char G.address_fmt[sizeof(G.address_fmt)-3]
220 #define address_pad_len_char G.address_fmt[2]
225 #define G (*(struct globals*)bb_common_bufsiz1) macro
228 BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \
229 G.bytes_per_block = 32; \
230 strcpy(G.address_fmt, "%0n"OFF_FMT"xc"); \
503 if (!*G.file_list) in open_next_file()
505 G.in_stream = fopen_or_warn_stdin(*G.file_list++); in open_next_file()
[all …]
Ddd.c123 #define G (*(struct globals*)bb_common_bufsiz1) macro
127 memset(&G, 0, sizeof(G)); \
169 G.in_full, G.in_part, in dd_output_status()
170 G.out_full, G.out_part); in dd_output_status()
174 if (G.flags & FLAG_STATUS_NOXFER) /* status=noxfer active? */ in dd_output_status()
182 , G.total_bytes, in dd_output_status()
184 make_human_readable_str(G.total_bytes, 1, 0) in dd_output_status()
192 seconds = (now_us - G.begin_time_us) / 1000000.0; in dd_output_status()
193 bytes_sec = G.total_bytes / seconds; in dd_output_status()
222 if (G.flags & FLAG_FULLBLOCK) in dd_read()
[all …]
/busybox-1.35.0/procps/
Dmpstat.c107 #define G (*ptr_to_globals) macro
109 SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
124 return (opt & G.options); in display_opt()
161 return ((double)overflow_safe_sub(prev, curr)) / itv * G.hz; in hz_value()
172 return G.cpu_bitmap[cpu >> 3] & (1 << (cpu & 7)); in is_cpu_in_bitmap()
186 if (G.interval != 0) { in write_irqcpu_stats()
221 for (cpu = 1; cpu <= G.cpu_nr; cpu++) { in write_irqcpu_stats()
223 if (!is_cpu_in_bitmap(cpu) && G.p_option) { in write_irqcpu_stats()
246 && G.interval != 0 in write_irqcpu_stats()
261 || G.interval == 0 in write_irqcpu_stats()
[all …]
Dfree.c110 struct globals G; in free_main() local
116 G.unit = 1 << 10; in free_main()
120 G.unit = 1; in free_main()
126 G.unit = 1 << 20; in free_main()
129 G.unit = 1 << 30; in free_main()
136 G.unit = 0; /* human readable */ in free_main()
153 seen_available = parse_meminfo(&G); in free_main()
154 G.mem_unit = (info.mem_unit ? info.mem_unit : 1); /* kernels < 2.4.x return mem_unit==0, so cope */ in free_main()
155 available = ((unsigned long long) G.available_kb * 1024) / G.mem_unit; in free_main()
156 cached = ((unsigned long long) G.cached_kb * 1024) / G.mem_unit; in free_main()
[all …]
Dpowertop.c98 #define G (*ptr_to_globals) macro
100 SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
106 tcsetattr_stdin_TCSANOW(&G.init_settings); in reset_term()
133 if (G.lines) { in clear_lines()
134 for (i = 0; i < G.lines_cnt; i++) in clear_lines()
135 free(G.lines[i].string); in clear_lines()
136 free(G.lines); in clear_lines()
137 G.lines_cnt = 0; in clear_lines()
138 G.lines = NULL; in clear_lines()
145 for (i = 0; i < G.lines_cnt; i++) in update_lines_cumulative_count()
[all …]
Dpstree.c82 #define G (*ptr_to_globals) macro
84 SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
96 if (bufindex >= G.capacity) { in ensure_buffer_capacity()
97 G.capacity += 0x100; in ensure_buffer_capacity()
98 G.width = xrealloc(G.width, G.capacity * sizeof(G.width[0])); in ensure_buffer_capacity()
99 G.more = xrealloc(G.more, G.capacity * sizeof(G.more[0])); in ensure_buffer_capacity()
108 G.cur_x++; in out_char()
109 if (G.cur_x > G.output_width) in out_char()
111 if (G.cur_x == G.output_width) in out_char()
128 G.cur_x = 0; in out_newline()
[all …]
Diostat.c94 #define G (*ptr_to_globals) macro
96 SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
97 G.unit.str = "Blk"; \
98 G.unit.div = 1; \
113 return (G.total_cpus > 1); in this_is_smp()
124 strftime(buf, sizeof(buf), "%x", &G.tmtime); in print_header()
128 buf, uts.machine, G.total_cpus); in print_header()
143 strftime(buf, sizeof(buf), "%x %X", &G.tmtime); in print_timestamp()
159 return (cputime_t)sec * G.clk_tck + dec * G.clk_tck / 100; in get_smp_uptime()
272 percent_value(p->rd_sectors, c->rd_sectors, itv) / G.unit.div, in print_stats_dev_struct()
[all …]
/busybox-1.35.0/networking/
Dtelnet.c139 #define G (*(struct globals*)bb_common_bufsiz1) macro
142 BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \
155 if (G.iaclen != 0) { in iac_flush()
156 full_write(netfd, G.iacbuf, G.iaclen); in iac_flush()
157 G.iaclen = 0; in iac_flush()
218 byte *src = (byte*)G.buf; in handle_net_output()
267 if (G.telstate == TS_NORMAL) { /* most typical state */ in handle_net_input()
269 c = G.buf[i]; in handle_net_input()
275 G.telstate = TS_CR; in handle_net_input()
279 full_write(STDOUT_FILENO, G.buf, len); in handle_net_input()
[all …]
Dwget.c228 # define USR_HEADER_HOST (G.user_headers & HDR_HOST)
229 # define USR_HEADER_USER_AGENT (G.user_headers & HDR_USER_AGENT)
230 # define USR_HEADER_RANGE (G.user_headers & HDR_RANGE)
231 # define USR_HEADER_CONTENT_TYPE (G.user_headers & HDR_CONTENT_TYPE)
232 # define USR_HEADER_AUTH (G.user_headers & HDR_AUTH)
233 # define USR_HEADER_PROXY_AUTH (G.user_headers & HDR_PROXY_AUTH)
278 #define G (*ptr_to_globals) macro
280 SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
325 if (G.log_fd >= 0) in progress_meter()
329 bb_progress_init(&G.pmt, G.curfile); in progress_meter()
[all …]
Dftpd.c180 #define G (*ptr_to_globals) macro
184 SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
263 if (G.verbose > 1) in cmdio_write()
271 *(bb__aliased_uint32_t *) G.msg_ok = status; in cmdio_write_ok()
272 xwrite(STDOUT_FILENO, G.msg_ok, sizeof("NNN " MSG_OK) - 1); in cmdio_write_ok()
273 if (G.verbose > 1) in cmdio_write_ok()
274 verbose_log(G.msg_ok); in cmdio_write_ok()
282 *(bb__aliased_uint32_t *) G.msg_err = status; in cmdio_write_error()
283 xwrite(STDOUT_FILENO, G.msg_err, sizeof("NNN " MSG_ERR) - 1); in cmdio_write_error()
284 if (G.verbose > 0) in cmdio_write_error()
[all …]
Difplugd.c151 #define G (*ptr_to_globals) macro
153 SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
154 G.iface_last_status = -1; \
155 G.iface_exists = 1; \
156 G.poll_time = 1; \
157 G.delay_down = 5; \
158 G.iface = "eth0"; \
159 G.api_mode = "a"; \
160 G.script_name = "/etc/ifplugd/ifplugd.action"; \
169 strncpy_IFNAMSIZ(ifreq->ifr_name, G.iface); in set_ifreq_to_ifname()
[all …]
Dping.c244 #define G (*(struct globals*)bb_common_bufsiz1) macro
249 printf("No response from %s\n", G.hostname); in noresp()
258 pkt = (struct icmp *) G.packet; in ping4()
261 pkt->icmp_id = G.myid; in ping4()
262 pkt->icmp_cksum = inet_cksum(pkt, sizeof(G.packet)); in ping4()
264 xsendto(pingsock, G.packet, DEFDATALEN + ICMP_MINLEN, &lsa->u.sa, lsa->len); in ping4()
272 c = recvfrom(pingsock, G.packet, sizeof(G.packet), 0, in ping4()
275 c = recv(pingsock, G.packet, sizeof(G.packet), 0); in ping4()
283 struct iphdr *iphdr = (struct iphdr *) G.packet; in ping4()
285 pkt = (struct icmp *) (G.packet + (iphdr->ihl << 2)); /* skip ip hdr */ in ping4()
[all …]
Dnslookup.c326 #define G (*(struct globals*)bb_common_bufsiz1) macro
329 G.default_port = 53; \
330 G.default_retry = 2; \
331 G.default_timeout = 5; \
526 unsigned timeout = G.default_timeout * 1000; in send_queries()
543 retry_interval = timeout / G.default_retry; in send_queries()
553 for (qn = 0; qn < G.query_count; qn++) { in send_queries()
554 if (G.query[qn].qlen == 0) in send_queries()
557 if (write(pfd.fd, G.query[qn].query, G.query[qn].qlen) < 0) { in send_queries()
565 servfail_retry = 2 * G.query_count; in send_queries()
[all …]
Darping.c88 #define src (G.src )
89 #define dst (G.dst )
90 #define me (G.me )
91 #define he (G.he )
92 #define count (G.count )
93 #define last (G.last )
94 #define timeout_us (G.timeout_us)
95 #define start (G.start )
96 #define sent (G.sent )
97 #define brd_sent (G.brd_sent )
[all …]
/busybox-1.35.0/util-linux/
Dmkfs_minix.c128 #define version2 G.version2
158 #define G (*ptr_to_globals) macro
160 SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
168 #define INODE_BUF1 (((struct minix1_inode*)G.inode_buffer) - 1)
169 #define INODE_BUF2 (((struct minix2_inode*)G.inode_buffer) - 1)
171 #define SB (G.u.SB)
211 #define zone_in_use(x) minix_bit(G.zone_map,(x)-SB_FIRSTZONE+1)
214 #define mark_inode(x) minix_setbit(G.inode_map,(x))
215 #define unmark_inode(x) minix_clrbit(G.inode_map,(x))
216 #define mark_zone(x) minix_setbit(G.zone_map,(x)-SB_FIRSTZONE+1)
[all …]
Dmdev.c254 # define dbg1(...) do { if (G.verbose) bb_error_msg(__VA_ARGS__); } while(0)
255 # define dbg1s(msg) do { if (G.verbose) bb_simple_error_msg(msg); } while(0)
261 # define dbg2(...) do { if (G.verbose >= 2) bb_error_msg(__VA_ARGS__); } while(0)
262 # define dbg2s(msg) do { if (G.verbose >= 2) bb_simple_error_msg(msg); } while(0)
268 # define dbg3(...) do { if (G.verbose >= 3) bb_error_msg(__VA_ARGS__); } while(0)
269 # define dbg3s(msg) do { if (G.verbose >= 3) bb_simple_error_msg(msg); } while(0)
311 #define G (*(struct globals*)bb_common_bufsiz1) macro
314 IF_NOT_FEATURE_MDEV_CONF(G.cur_rule.maj = -1;) \
315 IF_NOT_FEATURE_MDEV_CONF(G.cur_rule.mode = 0660;) \
329 memset(&G.cur_rule, 0, sizeof(G.cur_rule)); in make_default_cur_rule()
[all …]
/busybox-1.35.0/e2fsprogs/
Dfsck.c173 #define G (*(struct globals*)bb_common_bufsiz1) macro
176 BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \
326 if (!G.filesys_info) in create_fs_device()
327 G.filesys_info = fs; in create_fs_device()
329 G.filesys_last->next = fs; in create_fs_device()
330 G.filesys_last = fs; in create_fs_device()
365 for (fs = G.filesys_info; fs; fs = fs->next) { in lookup()
380 for (inst = G.instance_list; inst; inst = inst->next) { in progress_active()
398 if (!bb_got_signal || G.kill_sent) in kill_all_if_got_signal()
401 for (inst = G.instance_list; inst; inst = inst->next) { in kill_all_if_got_signal()
[all …]
/busybox-1.35.0/findutils/
Dxargs.c128 #define G (*(struct globals*)bb_common_bufsiz1) macro
131 IF_FEATURE_XARGS_SUPPORT_REPL_STR(G.repl_str = "{}";) \
132 IF_FEATURE_XARGS_SUPPORT_REPL_STR(G.eol_ch = '\n';) \
134 G.eof_str = NULL; \
135 G.idx = 0; \
136 IF_FEATURE_XARGS_SUPPORT_PARALLEL(G.running_procs = 0;) \
137 IF_FEATURE_XARGS_SUPPORT_PARALLEL(G.max_procs = 1;) \
138 G.xargs_exitcode = 0; \
139 IF_FEATURE_XARGS_SUPPORT_QUOTES(G.process_stdin__state = NORM;) \
140 IF_FEATURE_XARGS_SUPPORT_QUOTES(G.process_stdin__q = '\0';) \
[all …]
/busybox-1.35.0/sysklogd/
Dsyslogd.c314 #define G (*ptr_to_globals) macro
316 SET_PTR_TO_GLOBALS(memcpy(xzalloc(sizeof(G)), &init_data, sizeof(init_data))); \
366 #define OPTION_PARAM &opt_m, &(G.logFile.path), &opt_l \
412 pp_rule = &G.log_rules; in parse_syslogdcfg()
519 if (strcmp(G.logFile.path, tok[1]) == 0) { in parse_syslogdcfg()
520 cur_rule->file = &G.logFile; in parse_syslogdcfg()
527 for (cur_rule = G.log_rules; cur_rule != *pp_rule; cur_rule = cur_rule->next) { in parse_syslogdcfg()
564 if (G.shmid != -1) { in ipcsyslog_cleanup()
565 shmdt(G.shbuf); in ipcsyslog_cleanup()
567 if (G.shmid != -1) { in ipcsyslog_cleanup()
[all …]
/busybox-1.35.0/editors/
Dsed.c162 #define G (*(struct globals*)bb_common_bufsiz1) macro
165 BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \
166 G.sed_cmd_tail = &G.sed_cmd_head; \
173 sed_cmd_t *sed_cmd = G.sed_cmd_head; in sed_free_and_close_stuff()
175 llist_free(G.append_head, free); in sed_free_and_close_stuff()
205 free(G.hold_space); in sed_free_and_close_stuff()
207 if (G.current_fp) in sed_free_and_close_stuff()
208 fclose(G.current_fp); in sed_free_and_close_stuff()
218 if (G.outname) unlink(G.outname); in cleanup_outname()
357 G.previous_regex_ptr = *regex = xzalloc(sizeof(regex_t)); in get_address()
[all …]

12345