⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mixguile.c

📁 汇编语言编程源代码
💻 C
字号:
/* -*-c-*- -------------- mixguile.c : * Implementation of the functions declared in mixguile.h * ------------------------------------------------------------------ *  $Id: mixguile.c,v 1.6 2001/09/28 23:10:45 jao Exp $ * ------------------------------------------------------------------ * Copyright (C) 2001 Free Software Foundation, Inc. *   * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. *   * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. *   * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *   */#include <unistd.h>#include <mixlib/mix_config.h>#include "mixguile_cmd_dispatcher.h"#include "mixguile.h"static mixguile_cmd_dispatcher_t *dispatcher_ = NULL;static mix_vm_cmd_dispatcher_t *vm_dispatcher_ = NULL;static main_func_t main_fun_;static gboolean init_file_;/* do local initialisation and enter the user provided main */static voidreal_main_ (int argc, char *argv[]){  if (vm_dispatcher_)    {      mixguile_set_cmd_dispatcher (vm_dispatcher_);      mixguile_load_bootstrap (init_file_);    }  (*main_fun_)(argc, argv);}/*  initialise the guile command dispatcher and enter the provided  main function.*/voidmixguile_init (int argc, char *argv[], gboolean initfile,	       main_func_t main_fun,	       mix_vm_cmd_dispatcher_t *dis){  main_fun_ = main_fun;  vm_dispatcher_ = dis;  init_file_ = initfile;  gh_enter (argc, argv, real_main_);}/* load bootstrap file */voidmixguile_load_bootstrap (gboolean loadlocal){  const gchar *scmfile = SCM_FILE;  gchar *lscmfile = g_strconcat (g_get_home_dir (), G_DIR_SEPARATOR_S,				 MIX_CONFIG_DIR, G_DIR_SEPARATOR_S,				 LOCAL_SCM_FILE, NULL);    if (access (scmfile, R_OK) && access ((scmfile = LOCAL_SCM_FILE), R_OK))    {      g_warning ("mixguile bootstrap file %s not found\n", SCM_FILE);      scmfile = NULL;    }  else    mixguile_interpret_file (scmfile);  if (loadlocal && !access (lscmfile, R_OK))    {      mixguile_interpret_file (lscmfile);    }  g_free (lscmfile);}/* enter the guile repl */voidmixguile_enter_repl (int argc, char *argv[]){  gh_repl (argc, argv);}/* set the command dispatcher */voidmixguile_set_cmd_dispatcher (mix_vm_cmd_dispatcher_t *dis){  g_return_if_fail (dis != NULL);  if (dispatcher_) mixguile_cmd_dispatcher_delete (dispatcher_);  vm_dispatcher_ = dis;  dispatcher_ = mixguile_cmd_dispatcher_new (dis);  g_assert (dispatcher_);}/* access the mixguile comand dispatcher */mix_vm_cmd_dispatcher_t *mixguile_get_cmd_dispatcher (void){  return mixguile_cmd_dispatcher_get_vm_dispatcher (dispatcher_);}/* execute a string or file using the guile interpreter */voidmixguile_interpret_file (const gchar *path){  mixguile_cmd_dispatcher_interpret_file (dispatcher_, path);}voidmixguile_interpret_command (const gchar *command){  mixguile_cmd_dispatcher_interpret_command (dispatcher_, command);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -