File src/iroffer_misc.c

* iroffer by David Johnson (PMG) * Copyright (C) 1998-2005 David Johnson * * By using this file, you agree to the terms and conditions set * forth in the GNU General Public License. More information is * available in the LICENSE file. * * If you received this file without documentation, it can be * downloaded from http://iroffer.org/ * * @(#) iroffer_misc.c 1.251@(#) * pmg@wellington.i202.centerclick.org|src/iroffer_misc.c|20051123201144|15577 *


Included Files

include the headers


Preprocessor definitions

#define _LONGLONG 1

Global Function createpassword()

void createpassword ( void )
Prototyped in: src/iroffer_headers.h
Calls: add_password() src/dinoex_main.c
  inttosaltchar() src/iroffer_misc.c
  crypt(), exit(), fflush(), fprintf(), getpid(), printf(), rand(), read(), srand(), strcmp(), strlen(), time()
Called by: command_options() src/dinoex_main.c

Global Function floodchk()

void floodchk ( void )
Prototyped in: src/iroffer_headers.h
Calls: outerror() src/iroffer_utilities.c
  updatecontext_f() src/iroffer_utilities.c
Called by: privmsgparse() src/dinoex_user.c
References Variables: gdata src/dinoex_main.c
  gnetwork src/dinoex_main.c

Global Function getconfig()

void getconfig ( void )
Prototyped in: src/iroffer_headers.h
Calls: a_read_config_files() src/dinoex_jobs.c
  gototop() src/iroffer_display.c
  irlist_size() src/iroffer_utilities.c
  outerror() src/iroffer_utilities.c
  updatecontext_f() src/iroffer_utilities.c
  printf(), strlen()
Called by: startupiroffer() src/iroffer_misc.c
References Variables: gdata src/dinoex_main.c

Global Function getsendname()

'Sanitize' the filename in full, putting the sanitized copy into copy.

char* getsendname ( const char* const full )

Prototyped in: src/iroffer_headers.h
Calls: mymalloc2() src/iroffer_utilities.c
  sstrlen() src/iroffer_utilities.c
  updatecontext_f() src/iroffer_utilities.c
  sprintf(), strcpy()
Called by: command_dcc() src/dinoex_user.c
  l_establishcon() src/iroffer_upload.c
  l_setup_listen() src/dinoex_upload.c
  l_setup_passive() src/dinoex_upload.c
  t_find_resume() src/dinoex_transfer.c
  t_start_dcc_send() src/dinoex_transfer.c
  u_info() src/iroffer_admin.c
  upload_start() src/dinoex_upload.c
References Variables: gdata src/dinoex_main.c

Global Function getstatusline()

char* getstatusline ( char* str, size_t len )
Prototyped in: src/iroffer_headers.h
Calls: irlist_size() src/iroffer_utilities.c
  updatecontext_f() src/iroffer_utilities.c
  snprintf()
Called by: initscreen() src/iroffer_display.c
  logstat() src/iroffer_misc.c
  mainloop() src/iroffer_main.c
  u_status() src/iroffer_admin.c
  writestatus() src/iroffer_dccchat.c
References Variables: gdata src/dinoex_main.c
  gnetwork src/dinoex_main.c

Global Function getstatuslinenums()

char* getstatuslinenums ( char* str, size_t len )
Prototyped in: src/iroffer_headers.h
Calls: irlist_get_head() src/iroffer_utilities.c
  irlist_get_next() src/iroffer_utilities.c
  irlist_size() src/iroffer_utilities.c
  updatecontext_f() src/iroffer_utilities.c
  snprintf()
Called by: botonly_parse() src/dinoex_user.c
References Variables: gdata src/dinoex_main.c

Global Function gobackground()

void gobackground ( void )
Prototyped in: src/iroffer_headers.h
Calls: event_close() src/dinoex_kqueue.c
  mylog() src/iroffer_utilities.c
  outerror() src/iroffer_utilities.c
  updatecontext_f() src/iroffer_utilities.c
  __error(), dup(), exit(), fflush(), fork(), open(), printf(), setsid(), strerror()
Called by: a_backgroud() src/dinoex_admin.c
  startupiroffer() src/iroffer_misc.c
References Variables: gdata src/dinoex_main.c

Global Function initirc()

void initirc ( void )
Prototyped in: src/iroffer_headers.h
Calls: get_config_nick() src/dinoex_irc.c
  irlist_get_head() src/iroffer_utilities.c
  irlist_get_next() src/iroffer_utilities.c
  mydelete2() src/iroffer_utilities.c
  mymalloc2() src/iroffer_utilities.c
  updatecontext_f() src/iroffer_utilities.c
  writeserver() src/iroffer_misc.c
  snprintf(), strlen()
Called by: handshake_ssl() src/dinoex_ssl.c
References Variables: gdata src/dinoex_main.c
  gnetwork src/dinoex_main.c

Global Function initprefixes()

void initprefixes ( void )
Prototyped in: src/iroffer_headers.h
Calls: memset()
Called by: initvars() src/iroffer_misc.c
  irc_005() src/dinoex_irc.c
References Variables: gnetwork src/dinoex_main.c

Global Function initvars()

void initvars ( void )
Prototyped in: src/iroffer_headers.h
Calls: config_reset() src/dinoex_config.c
  initchanmodes() src/iroffer_misc.c
  initprefixes() src/iroffer_misc.c
  mymalloc2() src/iroffer_utilities.c
  timeval_to_ms() src/dinoex_utilities.c
  fprintf(), gettimeofday(), memset(), setlocale()
Called by: main() src/iroffer_main.c
References Variables: gdata src/dinoex_main.c
  gnetwork src/dinoex_main.c

Global Function inttosaltchar()

0 .. 63

int inttosaltchar ( int n )

Prototyped in: src/iroffer_headers.h
Called by: createpassword() src/iroffer_misc.c

Global Function isrotatelog()

void isrotatelog ( void )
Prototyped in: src/iroffer_headers.h
Calls: expire_logfiles() src/dinoex_jobs.c
  ioutput() src/iroffer_utilities.c
  mydelete2() src/iroffer_utilities.c
  mylog() src/iroffer_utilities.c
  new_logfilename() src/dinoex_jobs.c
  outerror() src/iroffer_utilities.c
  rotatelog() src/dinoex_jobs.c
  updatecontext_f() src/iroffer_utilities.c
  write_statefile() src/iroffer_statefile.c
  __error(), close(), link(), strerror(), unlink()
Called by: mainloop() src/iroffer_main.c
References Variables: gdata src/dinoex_main.c

Global Function joinchannel()

void joinchannel ( channel_t* c )
Prototyped in: src/iroffer_headers.h
Calls: clearmemberlist() src/iroffer_utilities.c
  irlist_get_head() src/iroffer_utilities.c
  irlist_get_next() src/iroffer_utilities.c
  reverify_restrictsend() src/iroffer_misc.c
  updatecontext_f() src/iroffer_utilities.c
  writeserver() src/iroffer_misc.c
Called by: a_hop_net() src/dinoex_admin.c
  a_rehash_channels() src/dinoex_jobs.c
  ir_parseline2() src/dinoex_irc.c
  mainloop() src/iroffer_main.c
References Variables: gdata src/dinoex_main.c
  gnetwork src/dinoex_main.c

Global Function logstat()

void logstat ( void )
Prototyped in: src/iroffer_headers.h
Calls: getstatusline() src/iroffer_misc.c
  mydelete2() src/iroffer_utilities.c
  mylog() src/iroffer_utilities.c
  mymalloc2() src/iroffer_utilities.c
Called by: mainloop() src/iroffer_main.c
References Variables: gdata src/dinoex_main.c

Global Function look_for_file_changes()

int look_for_file_changes ( xdcc* xpack )
Prototyped in: src/iroffer_headers.h
Calls: cancel_md5_hash() src/dinoex_jobs.c
  irlist_get_head() src/iroffer_utilities.c
  irlist_get_next() src/iroffer_utilities.c
  number_of_pack() src/dinoex_misc.c
  outerror() src/iroffer_utilities.c
  t_closeconn() src/iroffer_transfer.c
  __error(), stat(), strcmp(), strerror()
Called by: a_removelost() src/dinoex_admin.c
  a_send() src/dinoex_admin.c
  check_for_file_remove() src/dinoex_jobs.c
  send_from_queue() src/dinoex_queue.c
  send_xdcc_file2() src/dinoex_user.c
References Variables: gdata src/dinoex_main.c

Global Function notifybandwidth()

void notifybandwidth ( void )
Prototyped in: src/iroffer_headers.h
Calls: get_user_nick() src/dinoex_irc.c
  irlist_get_head() src/iroffer_utilities.c
  irlist_get_next() src/iroffer_utilities.c
  notice_slow() src/iroffer_utilities.c
  updatecontext_f() src/iroffer_utilities.c
Called by: mainloop() src/iroffer_main.c
References Variables: gdata src/dinoex_main.c
  gnetwork src/dinoex_main.c

Global Function notifybandwidthtrans()

void notifybandwidthtrans ( void )
Prototyped in: src/iroffer_headers.h
Calls: irlist_get_head() src/iroffer_utilities.c
  irlist_get_next() src/iroffer_utilities.c
  notice_slow() src/iroffer_utilities.c
  updatecontext_f() src/iroffer_utilities.c
Called by: mainloop() src/iroffer_main.c
References Variables: gdata src/dinoex_main.c
  gnetwork src/dinoex_main.c

Global Function pingserver()

void pingserver ( void )
Prototyped in: src/iroffer_headers.h
Calls: updatecontext_f() src/iroffer_utilities.c
  writeserver() src/iroffer_misc.c
Called by: a_lag_net() src/dinoex_admin.c
  mainloop() src/iroffer_main.c
References Variables: gnetwork src/dinoex_main.c

Global Function quit_server()

void quit_server ( void )
Prototyped in: src/iroffer_headers.h
Calls: clean_send_buffers() src/dinoex_jobs.c
  close_server() src/dinoex_ssl.c
  ioutput() src/iroffer_utilities.c
  updatecontext_f() src/iroffer_utilities.c
  writeserver() src/iroffer_misc.c
Called by: a_quit_network() src/dinoex_jobs.c
  switchserver() src/iroffer_misc.c
References Variables: gnetwork src/dinoex_main.c

Global Function reverify_restrictsend()

void reverify_restrictsend ( void )
Prototyped in: src/iroffer_headers.h
Calls: get_restrictsend() src/dinoex_misc.c
  irlist_get_head() src/iroffer_utilities.c
  irlist_get_next() src/iroffer_utilities.c
  isinmemberlist() src/iroffer_utilities.c
  notice() src/iroffer_utilities.c
  queue_reverify_restrictsend() src/dinoex_queue.c
  t_closeconn() src/iroffer_transfer.c
  strcmp()
Called by: ir_parseline2() src/dinoex_irc.c
  joinchannel() src/iroffer_misc.c
  mainloop() src/iroffer_main.c
  u_rehash() src/iroffer_admin.c
References Variables: gdata src/dinoex_main.c
  gnetwork src/dinoex_main.c

Global Function sendserver()

void sendserver ( void )
Prototyped in: src/iroffer_headers.h
Calls: close_server() src/dinoex_ssl.c
  gototop() src/iroffer_display.c
  ioutput() src/iroffer_utilities.c
  irlist_delete() src/iroffer_utilities.c
  irlist_get_head() src/iroffer_utilities.c
  irlist_size() src/iroffer_utilities.c
  sendannounce() src/dinoex_jobs.c
  writeserver_ssl() src/dinoex_ssl.c
  strlen()
Called by: mainloop() src/iroffer_main.c
References Variables: gdata src/dinoex_main.c
  gnetwork src/dinoex_main.c

Global Function sendxdlqueue()

void sendxdlqueue ( void )
Prototyped in: src/iroffer_headers.h
Calls: a_fillwith_msg2() src/dinoex_jobs.c
  ioutput() src/iroffer_utilities.c
  irlist_delete() src/iroffer_utilities.c
  irlist_get_head() src/iroffer_utilities.c
  irlist_get_next() src/iroffer_utilities.c
  irlist_size() src/iroffer_utilities.c
  mydelete2() src/iroffer_utilities.c
  mymalloc2() src/iroffer_utilities.c
  notice() src/iroffer_utilities.c
  strcmp_null() src/dinoex_utilities.c
  u_parseit() src/iroffer_admin.c
  updatecontext_f() src/iroffer_utilities.c
  bzero(), snprintf(), strcasecmp(), strcpy(), strlen()
Called by: mainloop() src/iroffer_main.c
References Variables: gdata src/dinoex_main.c
  gnetwork src/dinoex_main.c

Global Function shutdowniroffer()

void shutdowniroffer ( void )
Prototyped in: src/iroffer_headers.h
Calls: clean_send_buffers() src/dinoex_jobs.c
  exit_iroffer() src/dinoex_main.c
  getuptime() src/iroffer_utilities.c
  has_closed_servers() src/dinoex_irc.c
  ioutput() src/iroffer_utilities.c
  irlist_delete() src/iroffer_utilities.c
  irlist_get_head() src/iroffer_utilities.c
  irlist_get_next() src/iroffer_utilities.c
  l_closeconn() src/iroffer_upload.c
  mydelete2() src/iroffer_utilities.c
  mylog() src/iroffer_utilities.c
  mymalloc2() src/iroffer_utilities.c
  requeue() src/dinoex_queue.c
  shutdowndccchat() src/iroffer_dccchat.c
  t_closeconn() src/iroffer_transfer.c
  updatecontext_f() src/iroffer_utilities.c
  write_statefile() src/iroffer_statefile.c
  writedccchat() src/iroffer_dccchat.c
  writeserver_ssl() src/dinoex_ssl.c
  snprintf(), strlen()
Called by: mainloop() src/iroffer_main.c
References Variables: gdata src/dinoex_main.c
  gnetwork src/dinoex_main.c

Global Function startupiroffer()

void startupiroffer ( void )
Prototyped in: src/iroffer_headers.h
Calls: autotrigger_rebuild() src/dinoex_jobs.c
  config_dinoex() src/dinoex_misc.c
  drawbot() src/iroffer_display.c
  getconfig() src/iroffer_misc.c
  getdatestr() src/iroffer_utilities.c
  getos() src/iroffer_utilities.c
  gobackground() src/iroffer_misc.c
  gotobot() src/iroffer_display.c
  gototop() src/iroffer_display.c
  import_xdccfile() src/dinoex_jobs.c
  initscreen() src/iroffer_display.c
  ir_boutput_init() src/iroffer_utilities.c
  mydelete2() src/iroffer_utilities.c
  mylog() src/iroffer_utilities.c
  mymalloc2() src/iroffer_utilities.c
  outerror() src/iroffer_utilities.c
  read_statefile() src/iroffer_statefile.c
  set_loginname() src/iroffer_utilities.c
  set_socket_nonblocking() src/iroffer_utilities.c
  start_main_queue() src/dinoex_queue.c
  startup_dinoex() src/dinoex_misc.c
  switchserver() src/iroffer_misc.c
  updatecontext_f() src/iroffer_utilities.c
  write_statefile() src/iroffer_statefile.c
  writepidfile() src/iroffer_misc.c
  __error(), atoi(), chdir(), chroot(), fflush(), geteuid(), getgrouplist(), getpid(), getpwnam(), getpwuid(), getrlimit(), memset(), printf(), setgid(), setgroups(), setrlimit(), setuid(), sigaction(), sigfillset(), signal(), srand(), strerror()
Called by: main() src/iroffer_main.c
References Functions: iroffer_signal_handler() src/iroffer_misc.c
  fileno()
References Variables: gdata src/dinoex_main.c
  gnetwork src/dinoex_main.c

Global Function switchserver()

void switchserver ( int which )
Prototyped in: src/iroffer_headers.h
Calls: connectirc() src/iroffer_misc.c
  irlist_get_nth() src/iroffer_utilities.c
  irlist_size() src/iroffer_utilities.c
  quit_server() src/iroffer_misc.c
  updatecontext_f() src/iroffer_utilities.c
  rand()
Called by: a_rehash_jump() src/dinoex_jobs.c
  irc_perform() src/dinoex_irc.c
  startupiroffer() src/iroffer_misc.c
  u_jump() src/iroffer_admin.c
References Variables: gnetwork src/dinoex_main.c

Global Function user_changed_nick()

void user_changed_nick ( const char* oldnick, const char* newnick )
Prototyped in: src/iroffer_headers.h
Calls: ioutput() src/iroffer_utilities.c
  irlist_delete() src/iroffer_utilities.c
  irlist_get_head() src/iroffer_utilities.c
  irlist_get_next() src/iroffer_utilities.c
  mydelete2() src/iroffer_utilities.c
  mystrdup2() src/dinoex_utilities.c
  notice() src/iroffer_utilities.c
  queue_update_nick() src/dinoex_queue.c
  strcasecmp(), strcmp()
Called by: ir_parseline2() src/dinoex_irc.c
References Variables: gdata src/dinoex_main.c

Global Function vwriteserver()

void vwriteserver ( writeserver_type_e type, const char* format, va_list ap )
Prototyped in: src/iroffer_headers.h
Calls: ioutput() src/iroffer_utilities.c
  irlist_add_string() src/dinoex_utilities.c
  irlist_size() src/iroffer_utilities.c
  mydelete2() src/iroffer_utilities.c
  mymalloc2() src/iroffer_utilities.c
  outerror() src/iroffer_utilities.c
  writeserver_ssl() src/dinoex_ssl.c
  vsnprintf()
Called by: writeserver() src/iroffer_misc.c
References Variables: gdata src/dinoex_main.c
  gnetwork src/dinoex_main.c

Global Function writepidfile()

void writepidfile ( const char* filename )
Prototyped in: src/iroffer_headers.h
Calls: ioutput() src/iroffer_utilities.c
  mydelete2() src/iroffer_utilities.c
  mymalloc2() src/iroffer_utilities.c
  outerror() src/iroffer_utilities.c
  updatecontext_f() src/iroffer_utilities.c
  __error(), close(), getpid(), open(), snprintf(), strerror(), strlen(), write()
Called by: a_backgroud() src/dinoex_admin.c
  startupiroffer() src/iroffer_misc.c
  u_rehash() src/iroffer_admin.c

Global Function writeserver()

void writeserver ( writeserver_type_e type, const char* format, ... )
Prototyped in: src/iroffer_headers.h
Calls: vwriteserver() src/iroffer_misc.c
  __builtin_va_end(), __builtin_va_start()
Called by: a_hop_net() src/dinoex_admin.c
  a_nochannel() src/dinoex_admin.c
  a_part() src/dinoex_admin.c
  a_raw() src/dinoex_admin.c
  a_rawnet() src/dinoex_admin.c
  a_rehash_channels() src/dinoex_jobs.c
  a_rehash_cleanup() src/dinoex_jobs.c
  cie_mode() src/dinoex_ruby.c
  identify_needed() src/dinoex_irc.c
  initirc() src/iroffer_misc.c
  ir_parseline2() src/dinoex_irc.c
  irc_001() src/dinoex_irc.c
  joinchannel() src/iroffer_misc.c
  mainloop() src/iroffer_main.c
  pingserver() src/iroffer_misc.c
  quit_server() src/iroffer_misc.c
  sendannounce() src/dinoex_jobs.c
  writeserver_notice() src/dinoex_jobs.c
  writeserver_privmsg() src/dinoex_jobs.c

Global Function xdccsavetext()

void xdccsavetext ( void )
Prototyped in: src/iroffer_headers.h
Calls: a_fillwith_msg2() src/dinoex_jobs.c
  mydelete2() src/iroffer_utilities.c
  mymalloc2() src/iroffer_utilities.c
  mystrsuffix2() src/dinoex_utilities.c
  outerror() src/iroffer_utilities.c
  rename_with_backup() src/dinoex_jobs.c
  u_parseit() src/iroffer_admin.c
  updatecontext_f() src/iroffer_utilities.c
  __error(), close(), open(), strerror()
Called by: write_files() src/dinoex_jobs.c
References Variables: gdata src/dinoex_main.c
  gnetwork src/dinoex_main.c

Local Function connectirc()

static int connectirc ( server_t* tserver )
Calls: child_resolver() src/dinoex_irc.c
  event_close() src/dinoex_kqueue.c
  get_local_vhost() src/dinoex_irc.c
  ioutput() src/iroffer_utilities.c
  mydelete2() src/iroffer_utilities.c
  mymalloc2() src/iroffer_utilities.c
  mystrdup2() src/dinoex_utilities.c
  outerror() src/iroffer_utilities.c
  updatecontext_f() src/iroffer_utilities.c
  __error(), _exit(), fork(), sleep(), snprintf(), socketpair(), strchr(), strerror()
Called by: switchserver() src/iroffer_misc.c
References Variables: gdata src/dinoex_main.c
  gnetwork src/dinoex_main.c

Local Function initchanmodes()

static void initchanmodes ( void )
Calls: memset()
Called by: initvars() src/iroffer_misc.c
References Variables: gnetwork src/dinoex_main.c

Local Function iroffer_signal_handler()

static void iroffer_signal_handler ( int signo, siginfo_t* sinfo, void* UNUSED_unused )
Calls: dumpcontext() src/iroffer_utilities.c
  dumpgdata() src/iroffer_utilities.c
  exit_iroffer() src/dinoex_main.c
  ioutput() src/iroffer_utilities.c
  mylog() src/iroffer_utilities.c
  tostdout_disable_buffering() src/iroffer_display.c
  uninitscreen() src/iroffer_display.c
  exit(), printf(), raise(), sigaddset(), sigemptyset(), signal(), sigprocmask(), strsignal()
Used in: startupiroffer() src/iroffer_misc.c
References Variables: gdata src/dinoex_main.c