const ACTION: UT8_GETC is action "UT8_GETC";
const ACTION: UT8_GETS is action "UT8_GETS";
const ACTION: UT8_LINE_READ is action "UT8_LINE_READ";
const ACTION: UT8_SEEK is action "UT8_SEEK";
const ACTION: UT8_WORD_READ is action "UT8_WORD_READ";
const ACTION: UT8_WRITE is action "UT8_WRITE";
const proc: ut8_prototypes (inout file: c_prog) is func
begin
declareExtern(c_prog, "charType ut8Getc (fileType);");
declareExtern(c_prog, "striType ut8Gets (fileType, intType);");
declareExtern(c_prog, "striType ut8LineRead (fileType, charType *);");
declareExtern(c_prog, "void ut8Seek (fileType, intType);");
declareExtern(c_prog, "striType ut8WordRead (fileType, charType *);");
declareExtern(c_prog, "void ut8Write (fileType, const const_striType);");
end func;
const proc: process (UT8_GETC, in reference: function,
in ref_list: params, inout expr_type: c_expr) is func
begin
c_expr.expr &:= "ut8Getc(";
process_expr(params[1], c_expr);
c_expr.expr &:= ")";
end func;
const proc: process (UT8_GETS, in reference: function,
in ref_list: params, inout expr_type: c_expr) is func
begin
prepare_stri_result(c_expr);
c_expr.result_expr := "ut8Gets(";
getStdParamToResultExpr(params[1], c_expr);
c_expr.result_expr &:= ", ";
getStdParamToResultExpr(params[2], c_expr);
c_expr.result_expr &:= ")";
end func;
const proc: process (UT8_LINE_READ, in reference: function,
in ref_list: params, inout expr_type: c_expr) is func
begin
prepare_stri_result(c_expr);
c_expr.result_expr := "ut8LineRead(";
getStdParamToResultExpr(params[1], c_expr);
c_expr.result_expr &:= ", &(";
getStdParamToResultExpr(params[2], c_expr);
c_expr.result_expr &:= "))";
end func;
const proc: process (UT8_SEEK, in reference: function,
in ref_list: params, inout expr_type: c_expr) is func
begin
c_expr.expr &:= "ut8Seek(";
process_expr(params[1], c_expr);
c_expr.expr &:= ", ";
process_expr(params[2], c_expr);
c_expr.expr &:= ");\n";
end func;
const proc: process (UT8_WORD_READ, in reference: function,
in ref_list: params, inout expr_type: c_expr) is func
begin
prepare_stri_result(c_expr);
c_expr.result_expr := "ut8WordRead(";
getStdParamToResultExpr(params[1], c_expr);
c_expr.result_expr &:= ", &(";
getStdParamToResultExpr(params[2], c_expr);
c_expr.result_expr &:= "))";
end func;
const proc: process (UT8_WRITE, in reference: function,
in ref_list: params, inout expr_type: c_expr) is func
begin
setDiagnosticLine(c_expr);
c_expr.expr &:= "ut8Write(";
process_expr(params[1], c_expr);
c_expr.expr &:= ", ";
getAnyParamToExpr(params[2], c_expr);
c_expr.expr &:= ");\n";
end func;