next up previous contents
Next: A.2 ウインドウデザイン用ソースファイル (srh2.c) Up: 付 録A サーチアクセスプログラム Previous: 付 録A サーチアクセスプログラム

A.1 メイン関数用ソースファイル (srh2_main.c)

 

メイン関数のソースファイルである。ここでは,主に初期設定を行っている。

#include "srh2_ms.h"

extern char p_dir[100];/* srh2 を実行しているディレクトリ名 */

int main(int argc, char *argv[])
{
  FILE *pwd;

   fl_initialize(&argc, argv, 0, 0, 0);

   create_the_forms();

   /* fill-in form initialization code */
  /* Result File と Passage File のファイル名の初期設定 */
   fl_set_input(rfl,"srh/s_.dat");
   fl_set_input(pfl,"keika/k_.dat");

  /* ファイルの内容を表示するブラウザのフォントの設定 */
   fl_set_browser_fontsize(b_sw,14);
   fl_set_browser_fontstyle(b_sw,5);

  /* Max Times の初期設定 */
   fl_set_counter_value(mt,500.0);
   fl_set_counter_bounds(mt,10.0,1000000.0);
   fl_set_counter_step(mt,10.0,100.0);
   fl_set_counter_precision(mt,0);

  /* Pattern Number の初期設定 */
   fl_set_counter_step(pn,1.0,10.0);
   fl_set_counter_precision(pn,0);

  /* Search Number の初期設定 */
   fl_set_counter_value(sn,50.0);
   fl_set_counter_bounds(sn,1.0,(double)SRH_MAX);
   fl_set_counter_step(sn,1.0,10.0);
   fl_set_counter_precision(sn,0);

  /* km の初期設定 */
   fl_set_counter_value(km_o,0.5);
   fl_set_counter_bounds(km_o,0.0,1.0);
   fl_set_counter_step(km_o,0.01,0.1);
   fl_set_counter_precision(km_o,2);

  /* kr の初期設定 */
   fl_set_counter_value(kr_o,0.5);
   fl_set_counter_bounds(kr_o,0.0,1.0);
   fl_set_counter_step(kr_o,0.01,0.1);
   fl_set_counter_precision(kr_o,2);

  /* gs の初期設定 */
   fl_set_counter_value(gs_o,0.25);
   fl_set_counter_bounds(gs_o,0.0,1.0);
   fl_set_counter_step(gs_o,0.01,0.1);
   fl_set_counter_precision(gs_o,2);

  /* sok の初期設定 */
   fl_set_counter_value(sok_o,0.25);
   fl_set_counter_bounds(sok_o,0.25,10.0);
   fl_set_counter_step(sok_o,0.25,1.0);
   fl_set_counter_precision(sok_o,2);

  /* alp の初期設定 */
   fl_set_counter_value(alp_o,10.0);
   fl_set_counter_step(alp_o,0.1,1.0);
   fl_set_counter_precision(alp_o,1);

  /* STOP と PAUSE ボタンの初期設定 */
   fl_set_object_lcol(stp,FL_INACTIVE);
   fl_set_object_lcol(ps,FL_INACTIVE);
   fl_deactivate_object(stp);
   fl_deactivate_object(ps);

  /* srh2 が実行されているディレクトリを調べる */
  pwd=popen("pwd","r");
  fscanf(pwd,"%s",p_dir);
  fclose(pwd);

   /* show the first form */
  /* srh2 のウィンドウの設定と表示 */
  fsform();
  fl_do_forms();
  return 0;
}



Deguchi Toshinori
1998年03月12日 (木) 16時16分01秒 JST