IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 8, 2012, 1:10:28 PM (14 years ago)
Author:
eugene
Message:

add foreach loop

Location:
branches/eam_branches/ipp-20120405/Ohana/src/opihi
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20120405/Ohana/src/opihi/cmd.basic/Makefile

    r31635 r33849  
    4444$(SRC)/quit.$(ARCH).o        \
    4545$(SRC)/run_for.$(ARCH).o    \
     46$(SRC)/run_foreach.$(ARCH).o    \
    4647$(SRC)/run_if.$(ARCH).o     \
    4748$(SRC)/run_while.$(ARCH).o  \
  • branches/eam_branches/ipp-20120405/Ohana/src/opihi/cmd.basic/init.c

    r27255 r33849  
    3131int quit            PROTO((int, char **));
    3232int run_for         PROTO((int, char **));
     33int run_foreach     PROTO((int, char **));
    3334int run_if          PROTO((int, char **));
    3435int run_while       PROTO((int, char **));
     
    8182  {1, "quit",          quit,               "exit program *"},
    8283  {1, "for",           run_for,            "for loop"},
     84  {1, "foreach",       run_foreach,        "foreach loop"},
    8385  {1, "if",            run_if,             "logical cases *"},
    8486  {1, "while",         run_while,          "while loop"},
  • branches/eam_branches/ipp-20120405/Ohana/src/opihi/lib.shell/ListOps.c

    r33662 r33849  
    116116 
    117117  status = !strcmp (comm, "for");
     118  free (comm);
     119  return (status);
     120}
     121
     122int is_foreach_loop (char *line) {
     123
     124  int status;
     125  char *comm;
     126
     127  comm = thisword (line);
     128  if (comm == (char *) NULL) return (FALSE);
     129 
     130  status = !strcmp (comm, "foreach");
    118131  free (comm);
    119132  return (status);
     
    266279  status |= is_macro_create (line);
    267280  status |= is_for_loop (line);
     281  status |= is_foreach_loop (line);
    268282  status |= is_list_data (line);
    269283  status |= is_loop (line);
Note: See TracChangeset for help on using the changeset viewer.