Skip to content

Commit

Permalink
New files
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@396 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
x97davka committed Sep 9, 1998
1 parent bb73d7b commit 09be46e
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
22 changes: 22 additions & 0 deletions modeq/runtime/Makefile
@@ -0,0 +1,22 @@
#
# Makefile for modeq/runtime
#
# David Kĺgedal <x97davka@ida.liu.se>
#
# $Id$
#

RMLINCLUDE = /home/pelab/pub/pkg/rml/current/sol2-sparc/include/plain

SHELL = /bin/sh
CC = cc
CFLAGS = -I$(RMLINCLUDE)

SRC = rtopts.c

OBJ = $(SRC:.c=.o)

all: $(OBJ)

clean:
$(RM) $(OBJ)
55 changes: 55 additions & 0 deletions modeq/runtime/rtopts.c
@@ -0,0 +1,55 @@

#include <stdio.h>
#include "rml.h"
#include "../ast/yacclib.h"
#include <errno.h>

static int type_info;

void RTOpts_5finit(void)
{
type_info = 0;
}

RML_BEGIN_LABEL(RTOpts__args)
{
void *args = rmlA0;
void *res = mk_nil();

while (RML_GETHDR(args) != RML_NILHDR)
{
char *arg = RML_STRINGDATA(RML_CAR(args));
printf("Arg: %s\n", arg);
if (arg[0] == '+')
{
printf("Option %s\n", arg+1);
if (strlen(arg) < 2)
{
fprintf(stderr, "# Unknown option: -\n");
RML_TAILCALLK(rmlFC);
}
switch (arg[1]) {
case 't':
type_info = 1;
break;
default:
fprintf(stderr, "# Unknown option: %s\n", arg);
RML_TAILCALLK(rmlFC);
}
}
else
res = mk_cons(RML_CAR(args), res);
args = RML_CDR(args);
}

rmlA0 = res;
RML_TAILCALLK(rmlSC);
}
RML_END_LABEL

RML_BEGIN_LABEL(RTOpts__typeinfo)
{
rmlA0 = RML_PRIM_MKBOOL(type_info);
RML_TAILCALLK(rmlSC);
}
RML_END_LABEL

0 comments on commit 09be46e

Please sign in to comment.