Beispiel #1
0
LISP md5_update(LISP ctx,LISP str,LISP len)
{char *buffer; long dim,n;
 buffer = get_c_string_dim(str,&dim);
 if TYPEP(len,tc_c_file)
   {md5_update_from_file(get_md5_ctx(ctx), get_c_file(len,NULL),
			 (unsigned char *)buffer,dim);
    return(NIL);}
Beispiel #2
0
LISP lputpwent(LISP alist,LISP file)
{int iflag = no_interrupt(1);
 int status;
 struct passwd p;
 lencode_pwent(alist,&p);
 status = putpwent(&p,get_c_file(file,NULL));
 no_interrupt(iflag);
 return(NIL);}
Beispiel #3
0
Datei: gd.c Projekt: suprit/stuff
LISP lgdImageCreateFromXbm(LISP f)
{   LISP result;
    long iflag;
    result = cons(NIL,NIL);
    result->type = tc_gdimage;
    iflag = no_interrupt(1);
    result->storage_as.string.data =
        (char *) gdImageCreateFromXbm(get_c_file(f,NULL));
    no_interrupt(iflag);
    return(result);
}
Beispiel #4
0
int compile(const std::string& input_file)
{
    int ret = 0;

    std::string c_file     = g_options.output;
    std::string h_file     = get_h_file(c_file);

    if (c_file.empty()) {
        c_file = get_c_file(input_file);
        h_file = get_h_file(c_file);
    }

    yyin = fopen(input_file.c_str(), "r");
    if (!yyin) {
        std::cout << "failed to open input file: " << input_file << std::endl;
        return -1;
    }

    ast::Context::instance()->set_j4a_include_file_path(get_j4a_include_file(c_file));
    ast::Context::instance()->set_j4a_loader_file_path(get_j4a_loader_file(c_file));
    ast::Context::instance()->set_h_file_path(h_file.c_str());
    ast::Context::instance()->set_c_file_path(c_file.c_str());

    std::string input_dir_name;
    size_t file_name_pos = input_file.rfind('/');
    if (file_name_pos == std::string::npos) {
        input_dir_name = "./";
    } else {
        input_dir_name = input_file.substr(0, file_name_pos);
    }

    ast::Context::instance()->add_java_package("java.lang.Object");
    ast::Context::instance()->add_java_package("java.lang.String");

    std::cout << "add java path: " << input_dir_name << std::endl;
    ast::Context::instance()->set_java_class_dir(input_dir_name.c_str());

    ret = yyparse();
    fclose(yyin);
    return ret;
}