IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 31590


Ignore:
Timestamp:
May 31, 2011, 8:03:14 AM (15 years ago)
Author:
eugene
Message:

updates to use ohana malloc

Location:
branches/eam_branches/ipp-20110505/Ohana/src/opihi
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110505/Ohana/src/opihi/cmd.basic/cd.c

    r27435 r31590  
    2424    }
    2525    if (VERBOSE) gprint (GP_LOG, "cwd: %s\n", cwd);
    26     ohana_memregister (cwd);
    27     free (cwd);
     26    real_free (cwd);
    2827    return (TRUE);
    2928  }
     
    6261      free (var);
    6362  }
    64   ohana_memregister (cwd);
    65   free (cwd);
     63  real_free (cwd);
    6664  return (TRUE);
    6765 
  • branches/eam_branches/ipp-20110505/Ohana/src/opihi/cmd.basic/list.c

    r27587 r31590  
    223223    /* get the next line (from correct place) */
    224224    if (ThisList == 0) {
    225       input = readline (prompt);
     225      input = opihi_readline (prompt);
    226226    } else {
    227227      input = get_next_listentry (ThisList);
     
    236236      input = strcreate ("end");
    237237    }
    238     if (ThisList == 0) ohana_memregister (input);
    239238
    240239    stripwhite (input);
  • branches/eam_branches/ipp-20110505/Ohana/src/opihi/cmd.basic/run_for.c

    r27798 r31590  
    4848    /* get the next line (from correct place) */
    4949    if (ThisList == 0)
    50       input = readline (prompt);
     50      input = opihi_readline (prompt);
    5151    else
    5252      input = get_next_listentry (ThisList);
     
    6767      }
    6868    }
    69     if (ThisList == 0) ohana_memregister (input);
    7069
    7170    /* test for new macro (or other list, in the future?) */
  • branches/eam_branches/ipp-20110505/Ohana/src/opihi/cmd.basic/run_if.c

    r23583 r31590  
    6666    /* get the next line (from correct place) */
    6767    if (ThisList == 0) {
    68       input = readline (prompt);
     68      input = opihi_readline (prompt);
    6969    } else {
    7070      input = get_next_listentry (ThisList);
     
    7979      input = strcreate ("end");
    8080    }
    81     if (ThisList == 0) ohana_memregister (input);
    8281
    8382    stripwhite (input);
  • branches/eam_branches/ipp-20110505/Ohana/src/opihi/cmd.basic/run_while.c

    r27491 r31590  
    2525    /* get the next line (from correct place) */
    2626    if (ThisList == 0)
    27       input = readline (prompt);
     27      input = opihi_readline (prompt);
    2828    else
    2929      input = get_next_listentry (ThisList);
     
    4444      }
    4545    }
    46     if (ThisList == 0) ohana_memregister (input);
    4746
    4847    /* test for new macro (or other list, in the future?) */
  • branches/eam_branches/ipp-20110505/Ohana/src/opihi/include/shell.h

    r30614 r31590  
    158158char         *strip_version             PROTO((char *input));
    159159
     160// wrap readline in ohana mem functions:
     161char         *opihi_readline            PROTO((char *prompt));
     162
    160163/* gprint functions */
    161164void          gprintInit                PROTO((void));
  • branches/eam_branches/ipp-20110505/Ohana/src/opihi/lib.shell/macro_create.c

    r16444 r31590  
    6868
    6969    /* get the next line (from correct place) */
    70     if (ThisList == 0)
    71       input = readline (prompt);
    72     else
     70    if (ThisList == 0) {
     71      input = opihi_readline (prompt);
     72    } else {
    7373      input = get_next_listentry (ThisList);
     74    }
    7475
    7576    if ((ThisList == 0) && (input == (char *) NULL)) {
     
    7778      continue;
    7879    }
    79     if (ThisList == 0) ohana_memregister (input);
    8080
    8181    if ((ThisList > 0) && (input == (char *) NULL)) {
  • branches/eam_branches/ipp-20110505/Ohana/src/opihi/lib.shell/opihi.c

    r16473 r31590  
    1919    if (Nbad == 10) exit (20);
    2020
    21     line = readline (prompt);
     21    line = opihi_readline (prompt);
    2222
    2323    if (line == NULL) {
     
    3636
    3737    Nbad = 0;
    38     ohana_memregister (line);
    3938
    4039    stripwhite (line);
  • branches/eam_branches/ipp-20110505/Ohana/src/opihi/lib.shell/string.c

    r15878 r31590  
    276276}
    277277
     278char *opihi_readline (char *prompt) {
     279
     280# ifdef OHANA_MEMORY
     281    char *raw = readline (prompt);
     282    char *line = strcreate (raw);
     283    real_free (raw);
     284    return line;
     285# else
     286    char *line = readline (prompt);
     287    return line;
     288# endif
     289}
     290
    278291/* replace all instances of \A with A in line */
    279292void interpolate_slash (char *line) {
  • branches/eam_branches/ipp-20110505/Ohana/src/opihi/pantasks/client_shell.c

    r8548 r31590  
    2222    if (Nbad == 10) exit (3);
    2323
    24     line = readline (prompt);
     24    line = opihi_readline (prompt);
    2525
    2626    if (line == NULL) {
     
    3737    }
    3838    Nbad = 0;
    39     ohana_memregister (line);
    4039
    4140    stripwhite (line);
  • branches/eam_branches/ipp-20110505/Ohana/src/opihi/pantasks/task.c

    r23530 r31590  
    3434    /* get the next line (from correct place) */
    3535    if (ThisList == 0)
    36       input = readline (prompt);
     36      input = opihi_readline (prompt);
    3737    else
    3838      input = get_next_listentry (ThisList);
     
    4646      input = strcreate ("end");
    4747    }
    48     if (ThisList == 0) ohana_memregister (input);
    4948
    5049    stripwhite (input);
  • branches/eam_branches/ipp-20110505/Ohana/src/opihi/pantasks/task_macros.c

    r23530 r31590  
    112112    /* get the next line (from correct place) */
    113113    if (ThisList == 0)
    114       input = readline (prompt);
     114      input = opihi_readline (prompt);
    115115    else
    116116      input = get_next_listentry (ThisList);
     
    124124      input = strcreate ("end");
    125125    }
    126     if (ThisList == 0) ohana_memregister (input);
    127126
    128127    stripwhite (input);
Note: See TracChangeset for help on using the changeset viewer.