Lines Matching defs:scb

43 /* Pointer to list of scb's. */
176 struct serial *scb;
180 for (scb = scb_base; scb; scb = scb->next)
181 if (scb->name && strcmp (scb->name, name) == 0)
183 scb->refcnt++;
184 return scb;
204 scb = XMALLOC (struct serial);
206 scb->ops = ops;
208 scb->bufcnt = 0;
209 scb->bufp = scb->buf;
211 if (scb->ops->open (scb, open_name))
213 xfree (scb);
217 scb->name = xstrdup (name);
218 scb->next = scb_base;
219 scb->refcnt = 1;
220 scb->debug_p = 0;
221 scb->async_state = 0;
222 scb->async_handler = NULL;
223 scb->async_context = NULL;
224 scb_base = scb;
226 last_serial_opened = scb;
235 return scb;
241 struct serial *scb;
244 for (scb = scb_base; scb; scb = scb->next)
245 if (scb->fd == fd)
247 scb->refcnt++;
248 return scb;
256 scb = XMALLOC (struct serial);
258 scb->ops = ops;
260 scb->bufcnt = 0;
261 scb->bufp = scb->buf;
263 scb->fd = fd;
265 scb->name = NULL;
266 scb->next = scb_base;
267 scb->refcnt = 1;
268 scb->debug_p = 0;
269 scb->async_state = 0;
270 scb->async_handler = NULL;
271 scb->async_context = NULL;
272 scb_base = scb;
274 last_serial_opened = scb;
276 return scb;
280 do_serial_close (struct serial *scb, int really_close)
296 /* This is bogus. It's not our fault if you pass us a bad scb...! Rob, you
299 if (!scb)
302 scb->refcnt--;
303 if (scb->refcnt > 0)
307 if (scb->async_handler != NULL)
308 serial_async (scb, NULL, NULL);
311 scb->ops->close (scb);
313 if (scb->name)
314 xfree (scb->name);
316 if (scb_base == scb)
321 if (tmp_scb->next != scb)
328 xfree (scb);
332 serial_close (struct serial *scb)
334 do_serial_close (scb, 1);
338 serial_un_fdopen (struct serial *scb)
340 do_serial_close (scb, 0);
344 serial_readchar (struct serial *scb, int timeout)
350 if (0 && serial_is_async_p (scb) && timeout < 0)
354 ch = scb->ops->readchar (scb, timeout);
363 if (serial_debug_p (scb))
375 serial_write (struct serial *scb, const char *str, int len)
389 return (scb->ops->write (scb, str, len));
407 serial_drain_output (struct serial *scb)
409 return scb->ops->drain_output (scb);
413 serial_flush_output (struct serial *scb)
415 return scb->ops->flush_output (scb);
419 serial_flush_input (struct serial *scb)
421 return scb->ops->flush_input (scb);
425 serial_send_break (struct serial *scb)
430 return (scb->ops->send_break (scb));
434 serial_raw (struct serial *scb)
436 scb->ops->go_raw (scb);
440 serial_get_tty_state (struct serial *scb)
442 return scb->ops->get_tty_state (scb);
446 serial_set_tty_state (struct serial *scb, serial_ttystate ttystate)
448 return scb->ops->set_tty_state (scb, ttystate);
452 serial_print_tty_state (struct serial *scb,
456 scb->ops->print_tty_state (scb, ttystate, stream);
460 serial_noflush_set_tty_state (struct serial *scb,
464 return scb->ops->noflush_set_tty_state (scb, new_ttystate, old_ttystate);
468 serial_setbaudrate (struct serial *scb, int rate)
470 return scb->ops->setbaudrate (scb, rate);
474 serial_setstopbits (struct serial *scb, int num)
476 return scb->ops->setstopbits (scb, num);
480 serial_can_async_p (struct serial *scb)
482 return (scb->ops->async != NULL);
486 serial_is_async_p (struct serial *scb)
488 return (scb->ops->async != NULL) && (scb->async_handler != NULL);
492 serial_async (struct serial *scb,
497 if ((scb->async_handler == NULL)
499 scb->ops->async (scb, handler != NULL);
500 scb->async_handler = handler;
501 scb->async_context = context;
505 deprecated_serial_fd (struct serial *scb)
509 if (scb->fd < 0)
514 return scb->fd; /* sigh */
518 serial_debug (struct serial *scb, int debug_p)
520 scb->debug_p = debug_p;
524 serial_debug_p (struct serial *scb)
526 return scb->debug_p || global_serial_debug_p;