const ACTION: GKB_GETC is action "GKB_GETC";
const ACTION: GKB_GETS is action "GKB_GETS";
const ACTION: GKB_INPUT_READY is action "GKB_INPUT_READY";
const ACTION: GKB_LINE_READ is action "GKB_LINE_READ";
const ACTION: GKB_RAW_GETC is action "GKB_RAW_GETC";
const ACTION: GKB_SELECT_INPUT is action "GKB_SELECT_INPUT";
const ACTION: GKB_WINDOW is action "GKB_WINDOW";
const ACTION: GKB_WORD_READ is action "GKB_WORD_READ";
const ACTION: GKB_BUTTON_PRESSED is action "GKB_BUTTON_PRESSED";
const ACTION: GKB_CLICKED_XPOS is action "GKB_CLICKED_XPOS";
const ACTION: GKB_CLICKED_YPOS is action "GKB_CLICKED_YPOS";
const proc: gkb_prototypes (inout file: c_prog) is func
begin
declareExtern(c_prog, "boolType gkbButtonPressed (charType);");
declareExtern(c_prog, "intType gkbClickedXpos (void);");
declareExtern(c_prog, "intType gkbClickedYpos (void);");
declareExtern(c_prog, "charType gkbGetc (void);");
declareExtern(c_prog, "striType gkbGets (intType);");
declareExtern(c_prog, "boolType gkbInputReady (void);");
declareExtern(c_prog, "striType gkbLineRead (charType *);");
declareExtern(c_prog, "charType gkbRawGetc (void);");
declareExtern(c_prog, "void gkbSelectInput (winType, charType, boolType);");
declareExtern(c_prog, "winType gkbWindow (void);");
declareExtern(c_prog, "striType gkbWordRead (charType *);");
end func;
const proc: process (GKB_GETC, in reference: function,
in ref_list: params, inout expr_type: c_expr) is func
begin
c_expr.expr &:= "gkbGetc()";
end func;
const proc: process (GKB_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 := "gkbGets(";
getStdParamToResultExpr(params[2], c_expr);
c_expr.result_expr &:= ")";
end func;
const proc: process (GKB_INPUT_READY, in reference: function,
in ref_list: params, inout expr_type: c_expr) is func
begin
c_expr.expr &:= "gkbInputReady()";
end func;
const proc: process (GKB_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 := "gkbLineRead(&(";
getStdParamToResultExpr(params[2], c_expr);
c_expr.result_expr &:= "))";
end func;
const proc: process (GKB_RAW_GETC, in reference: function,
in ref_list: params, inout expr_type: c_expr) is func
begin
c_expr.expr &:= "gkbRawGetc()";
end func;
const proc: process (GKB_SELECT_INPUT, in reference: function,
in ref_list: params, inout expr_type: c_expr) is func
begin
setDiagnosticLine(c_expr);
c_expr.expr &:= "gkbSelectInput(";
getAnyParamToExpr(params[1], c_expr);
c_expr.expr &:= ", ";
process_expr(params[2], c_expr);
c_expr.expr &:= ", ";
process_expr(params[3], c_expr);
c_expr.expr &:= ");\n";
end func;
const proc: process (GKB_WINDOW, in reference: function,
in ref_list: params, inout expr_type: c_expr) is func
begin
prepare_win_result(c_expr);
c_expr.result_expr := "gkbWindow()";
end func;
const proc: process (GKB_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 := "gkbWordRead(&(";
getStdParamToResultExpr(params[2], c_expr);
c_expr.result_expr &:= "))";
end func;
const proc: process (GKB_BUTTON_PRESSED, in reference: function,
in ref_list: params, inout expr_type: c_expr) is func
begin
c_expr.expr &:= "gkbButtonPressed(";
process_expr(params[2], c_expr);
c_expr.expr &:= ")";
end func;
const proc: process (GKB_CLICKED_XPOS, in reference: function,
in ref_list: params, inout expr_type: c_expr) is func
begin
c_expr.expr &:= "gkbClickedXpos()";
end func;
const proc: process (GKB_CLICKED_YPOS, in reference: function,
in ref_list: params, inout expr_type: c_expr) is func
begin
c_expr.expr &:= "gkbClickedYpos()";
end func;