Changeset 21 for trunk/src


Ignore:
Timestamp:
Jan 8, 2001, 6:54:48 PM (25 years ago)
Author:
umoeller
Message:

Final changes for 0.9.7, i hope...

Location:
trunk/src/helpers
Files:
30 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/helpers/animate.c

    r18 r21  
    6565/*
    6666 *@@category: Helpers\PM helpers\Animation helpers
     67 *      See animate.c.
    6768 */
    6869
  • trunk/src/helpers/cctl_chart.c

    r18 r21  
    8181/*
    8282 *@@category: Helpers\PM helpers\Window classes\Chart control
     83 *      See cctl_chart.c.
    8384 */
    8485
  • trunk/src/helpers/cctl_checkcnr.c

    r14 r21  
    8181/*
    8282 *@@category: Helpers\PM helpers\Window classes\Checkbox containers
     83 *      See cctl_checkcnr.c.
    8384 */
    8485
  • trunk/src/helpers/cctl_progbar.c

    r18 r21  
    8181/*
    8282 *@@category: Helpers\PM helpers\Window classes\Progress bars
     83 *      See cctl_progbar.c.
    8384 */
    8485
  • trunk/src/helpers/cctl_splitwin.c

    r14 r21  
    8181/*
    8282 *@@category: Helpers\PM helpers\Window classes\Split windows
     83 *      See cctl_splitwin.c.
    8384 */
    8485
  • trunk/src/helpers/cctl_tooltip.c

    r20 r21  
    8181/*
    8282 *@@category: Helpers\PM helpers\Window classes\Tooltips
     83 *      See cctl_tooltip.c.
    8384 */
    8485
     
    12891290                    // compose values for that msg
    12901291                    TOOLTIPTEXT ttt = {0};
    1291                     _Pmpf(("TTM_GETTEXT: PSZ_TEXTCALLBACK"));
     1292                    _Pmpf(("TTM_GETTEXT: PSZ_TEXTCALLBACK... sending TTN_NEEDTEXT"));
    12921293                    ttt.hwndTooltip = hwndTooltip;
    12931294                    ttt.hwndTool = pti->hwndTool;
    1294                     WinSendMsg(pti->hwndTool,
     1295                    WinSendMsg(pti->hwndToolOwner,
    12951296                               WM_CONTROL,
    12961297                               MPFROM2SHORT(pttd->ulTooltipID,  // tooltip control wnd ID
  • trunk/src/helpers/cnrh.c

    r17 r21  
    6363
    6464/*
     65 *@@category: Helpers\PM helpers\Container helpers
     66 *      See cnrh.c.
     67 */
     68
     69/*
    6570 *@@category: Helpers\PM helpers\Container helpers\Details view helpers
     71 *      these functions aid you in setting up the FIELDINFO structures
     72 *      for a container Details view. Use cnrhSetFieldInfos for that.
    6673 */
    6774
     
    343350/*
    344351 *@@category: Helpers\PM helpers\Container helpers\Record core helpers
     352 *      functions for allocating and inserting records more easily.
     353 *
     354 *      Use cnrhAllocRecords first to allocate, then cnrhInsertRecords
     355 *      to insert the records.
    345356 */
    346357
     
    742753/*
    743754 *@@category: Helpers\PM helpers\Container helpers\View management
     755 *      functions for easily managing container views.
     756 *
     757 *      Most importantly, this has the BEGIN_CNRINFO and END_CNRINFO
     758 *      macros which make CNRINFO handling easier. Also see
     759 *      cnrhSetView for that.
    744760 */
    745761
     
    812828 *
    813829 *      With fl, specify any or none of the following:
     830 *
    814831 *      --  FRFP_RIGHTSPLITWINDOW: test right split Details view
    815832 *              instead of main cnr.
     833 *
    816834 *      --  FRFP_SCREENCOORDS: *pptl specifies the point to
    817835 *              check in _screen_ coordinates, instead of
     
    13101328/*
    13111329 *@@category: Helpers\PM helpers\Container helpers\Record relations/iteration
     1330 *      functions for querying the relation of records and
     1331 *      iterating through records.
    13121332 */
    13131333
     
    13961416            // first call: get parent of precTest;
    13971417            // subsequent calls: climb up
    1398             precParentThis = WinSendMsg(hwndCnr,
    1399                                         CM_QUERYRECORD,
    1400                                         precParentThis,
    1401                                         MPFROM2SHORT(CMA_PARENT,
    1402                                                      CMA_ITEMORDER));
     1418            precParentThis = (PRECORDCORE)WinSendMsg(hwndCnr,
     1419                                                     CM_QUERYRECORD,
     1420                                                     precParentThis,
     1421                                                     MPFROM2SHORT(CMA_PARENT,
     1422                                                                  CMA_ITEMORDER));
    14031423            if (precParentThis == (PRECORDCORE)-1)
    14041424                break;
  • trunk/src/helpers/comctl.c

    r14 r21  
    124124/*
    125125 *@@category: Helpers\PM helpers\Window classes\Menu buttons
     126 *      See comctl.c and ctlMakeMenuButton.
    126127 */
    127128
     
    495496/*
    496497 *@@category: Helpers\PM helpers\Window classes\Static bitmaps
     498 *      See comctl.c and ctl_fnwpBitmapStatic.
    497499 */
    498500
     
    978980/*
    979981 *@@category: Helpers\PM helpers\Window classes\Stretched bitmaps
     982 *      See comctl.c and ctlPrepareStretchedBitmap.
    980983 */
    981984
     
    10611064/*
    10621065 *@@category: Helpers\PM helpers\Window classes\Hotkey entry field
     1066 *      See comctl.c and ctl_fnwpObjectHotkeyEntryField.
    10631067 */
    10641068
  • trunk/src/helpers/datetime.c

    r15 r21  
    5454/*
    5555 *@@category: Helpers\C helpers\Date/time helpers
     56 *      See datetime.c.
    5657 */
    5758
  • trunk/src/helpers/debug.c

    r14 r21  
    8888/*
    8989 *@@category: Helpers\Control program helpers\Exceptions/debugging
     90 *      See except.c and debug.c.
    9091 */
    9192
  • trunk/src/helpers/dosh.c

    r17 r21  
    7373/*
    7474 *@@category: Helpers\Control program helpers\Miscellaneous
     75 *      Miscellaneous helpers in dosh.c that didn't fit into any other
     76 *      category.
    7577 */
    7678
     
    215217
    216218/*
    217  *@@category: Helpers\Control program helpers\Memory management
     219 *@@category: Helpers\Control program helpers\Shared memory management
     220 *      helpers for allocating and requesting shared memory.
    218221 */
    219222
     
    286289/*
    287290 *@@category: Helpers\Control program helpers\Drive management
     291 *      functions for managing drives... enumerating, testing,
     292 *      querying etc.
    288293 */
    289294
     
    12971302/*
    12981303 *@@category: Helpers\Control program helpers\Directory management
     1304 *      directory helpers (querying, creating, deleting etc.).
    12991305 */
    13001306
     
    15341540/*
    15351541 *@@category: Helpers\Control program helpers\Module handling
     1542 *      helpers for importing functions from a module (DLL).
    15361543 */
    15371544
     
    15911598/*
    15921599 *@@category: Helpers\Control program helpers\Performance (CPU load) helpers
     1600 *      helpers around DosPerfSysCall.
    15931601 */
    15941602
     
    18521860/*
    18531861 *@@category: Helpers\Control program helpers\Process management
     1862 *      helpers for starting subprocesses.
    18541863 */
    18551864
  • trunk/src/helpers/dosh2.c

    r18 r21  
    346346/*
    347347 *@@category: Helpers\Control program helpers\Environment management
     348 *      helpers for managing those ugly environment string arrays
     349 *      that are used with DosStartSession and WinStartApp.
    348350 */
    349351
     
    749751/*
    750752 *@@category: Helpers\Control program helpers\Executable info
     753 *      these functions can retrieve BLDLEVEL information from
     754 *      any executable module. See doshExecOpen.
    751755 */
    752756
     
    11951199/*
    11961200 *@@category: Helpers\Control program helpers\Partitions info
     1201 *      functions for retrieving partition information directly
     1202 *      from the partition tables on the disk. See doshGetPartitionsList.
    11971203 */
    11981204
  • trunk/src/helpers/eah.c

    r14 r21  
    9898/*
    9999 *@@category: Helpers\Control program helpers\Extended attributes
     100 *      See eah.c.
    100101 */
    101102
     
    404405/*
    405406 *@@category: Helpers\Control program helpers\Extended attributes\Translation helpers
     407 *      these functions are built on top of the regular EA helpers
     408 *      (see eah.c) to convert standard types to EAs.
    406409 */
    407410
  • trunk/src/helpers/except.c

    r15 r21  
    264264/*
    265265 *@@category: Helpers\Control program helpers\Exceptions/debugging
     266 *      See except.c.
    266267 */
    267268
  • trunk/src/helpers/gpih.c

    r18 r21  
    7777LONG            DisplayCaps[CAPS_DEVICE_POLYSET_POINTS] = {0};
    7878BOOL            fCapsQueried = FALSE;
     79
     80/*
     81 *@@category: Helpers\PM helpers\GPI helpers
     82 *      See gpih.c.
     83 */
    7984
    8085/*
  • trunk/src/helpers/level.c

    r14 r21  
    5050/*
    5151 *@@category: Helpers\Control program helpers\SYSLEVEL parsing
     52 *      helpers for parsing SYSLEVEL files. See lvlOpenLevelFile.
    5253 */
    5354
  • trunk/src/helpers/linklist.c

    r17 r21  
    7979/*
    8080 *@@category: Helpers\C helpers\Linked lists
     81 *      See linklist.c.
    8182 */
    8283
  • trunk/src/helpers/memdebug.c

    r14 r21  
    131131/*
    132132 *@@category: Helpers\C helpers\Heap debugging
     133 *      See memdebug.c.
    133134 */
    134135
  • trunk/src/helpers/shapewin.c

    r14 r21  
    213213/*
    214214 *@@category: Helpers\PM helpers\Window classes\Shaped windows (transparency)
     215 *      see shapewin.c.
    215216 */
    216217
  • trunk/src/helpers/stringh.c

    r18 r21  
    5959/*
    6060 *@@category: Helpers\C helpers\String management
     61 *      See stringh.c and xstring.c.
     62 */
     63
     64/*
     65 *@@category: Helpers\C helpers\String management\C string helpers
     66 *      See stringh.c.
    6167 */
    6268
     
    988994 */
    989995
    990 PSZ strhFindEOL(PSZ pszSearchIn,        // in: where to search
     996PSZ strhFindEOL(const char *pcszSearchIn,        // in: where to search
    991997                PULONG pulOffset)       // out: offset (ptr can be NULL)
    992998{
    993     PSZ     p = pszSearchIn,
    994             prc = NULL;
     999    const char *p = pcszSearchIn,
     1000               *prc = 0;
    9951001    while (TRUE)
    9961002    {
     
    10041010
    10051011    if (pulOffset)
    1006         *pulOffset = prc - pszSearchIn;
    1007     return (prc);
     1012        *pulOffset = prc - pcszSearchIn;
     1013
     1014    return ((PSZ)prc);
    10081015}
    10091016
  • trunk/src/helpers/syssound.c

    r18 r21  
    9696/*
    9797 *@@category: Helpers\Profile (INI) helpers\System sounds
     98 *      see syssound.c.
    9899 */
    99100
  • trunk/src/helpers/textv_html.c

    r14 r21  
    5656/*
    5757 *@@category: Helpers\PM helpers\Window classes\XTextView control\HTML conversion
     58 *      see textv_html.c.
    5859 */
    5960
     
    20602061    ULONG   cbSource = strlen(*ppszText);
    20612062
     2063    XHTMLDATA xhtmlTemp = {0};
     2064    BOOL fUsingTemp = FALSE;
    20622065    COPYTARGET  ct = {0};
    20632066
     
    20692072    ct.fSkipNextSpace = TRUE;
    20702073    ct.pxhtml = (PXHTMLDATA)pxhtml;
     2074    if (ct.pxhtml == NULL)  // not specified:
     2075    {
     2076        ct.pxhtml = &xhtmlTemp;
     2077        fUsingTemp = TRUE;
     2078    }
     2079
     2080    lstInit(&ct.pxhtml->llLinks, TRUE);       // auto-free
    20712081
    20722082    // step 2:
     
    22182228    lstClear(&ct.llLists);
    22192229
     2230    if (fUsingTemp)
     2231    {
     2232        if (xhtmlTemp.pszTitle)
     2233            free(xhtmlTemp.pszTitle);
     2234        lstClear(&xhtmlTemp.llLinks);
     2235                // ### better really clear this... there are PSZ's inside
     2236    }
     2237
    22202238    return (brc);
    22212239}
  • trunk/src/helpers/threads.c

    r19 r21  
    66 *      message queue which is created automatically.
    77 *
     8 *      See thrCreate() for how to start such a thread.
     9 *
    810 *      Usage: All OS/2 programs.
    911 *
     
    1315 *      This file is new with V0.81 and contains all the thread
    1416 *      functions that used to be in helpers.c.
    15  *
    16  *      Use thrCreate() to start a thread.
    1717 *
    1818 *      Note: Version numbering in this file relates to XWorkplace version
     
    5656/*
    5757 *@@category: Helpers\Control program helpers\Thread management
     58 *      see threads.c.
    5859 */
    5960
  • trunk/src/helpers/timer.c

    r19 r21  
    9191/*
    9292 *@@category: Helpers\PM helpers\Timer replacements
     93 *      see timer.c.
    9394 */
    9495
  • trunk/src/helpers/tmsgfile.c

    r14 r21  
    8484/*
    8585 *@@category: Helpers\Control program helpers\Text message files (TMF)
     86 *      see tmsgfile.c.
    8687 */
    8788
  • trunk/src/helpers/tree.c

    r14 r21  
    102102/*
    103103 *@@category: Helpers\C helpers\Red-black balanced binary trees
     104 *      See tree.c.
    104105 */
    105106
  • trunk/src/helpers/winh.c

    r18 r21  
    24692469 *      wrapper around WinStartApp which fixes the
    24702470 *      specified PROGDETAILS to (hopefully) work
    2471  *      work with all executable types:
    2472  *
    2473  *      1.  This fixes the executable info to support:
    2474  *
    2475  *          -- starting "*" executables (command prompts
    2476  *             for OS/2, DOS, Win-OS/2);
    2477  *
    2478  *          -- starting ".CMD" and ".BAT" files as
    2479  *             PROGDETAILS.pszExecutable.
    2480  *
    2481  *      2.  Handles and merges special and default
    2482  *          environments for the app to be started.
    2483  *          If PROGDETAILS.pszEnvironment is empty
    2484  *          and the application is a Win-OS/2 app,
    2485  *          this uses the default Win-OS/2 settings
    2486  *          as specified in the "Win-OS/2" WPS settings
    2487  *          object.
     2471 *      work with all executable types.
     2472 *
     2473 *      This fixes the executable info to support:
     2474 *
     2475 *      -- starting "*" executables (command prompts
     2476 *         for OS/2, DOS, Win-OS/2);
     2477 *
     2478 *      -- starting ".CMD" and ".BAT" files as
     2479 *         PROGDETAILS.pszExecutable.
     2480 *
     2481 *      This also handles and merges special and default
     2482 *      environments for the app to be started.
     2483 *      If PROGDETAILS.pszEnvironment is empty
     2484 *      and the application is a Win-OS/2 app,
     2485 *      this uses the default Win-OS/2 settings
     2486 *      as specified in the "Win-OS/2" WPS settings
     2487 *      object.
    24882488 *
    24892489 *      Even though this isn't clearly said in PMREF,
  • trunk/src/helpers/wphandle.c

    r14 r21  
    6969/*
    7070 *@@category: Helpers\PM helpers\Workplace Shell\Handles (OS2SYS.INI)
     71 *      See wphandle.c.
    7172 */
    7273
  • trunk/src/helpers/xprf.c

    r14 r21  
    109109/*
    110110 *@@category: Helpers\Profile (INI) replacement functions
     111 *      See xprf.c.
    111112 */
    112113
  • trunk/src/helpers/xstring.c

    r18 r21  
    113113
    114114/*
    115  *@@category: Helpers\C helpers\String management
     115 *@@category: Helpers\C helpers\String management\XStrings (with memory management)
     116 *      See xstring.c.
    116117 */
    117118
     
    240241        free(pxstr->psz);
    241242    memset(pxstr, 0, sizeof(XSTRING));
     243}
     244
     245/*
     246 *@@ xstrReserve:
     247 *      this function makes sure that the specified
     248 *      XSTRING has at least ulBytes bytes allocated.
     249 *
     250 *      This function is useful if you plan to do
     251 *      a lot of string replacements or appends and
     252 *      want to avoid that the buffer is reallocated
     253 *      with each operation. Before those operations,
     254 *      call this function to make room for the operations.
     255 *
     256 *      If ulBytes is smaller than the current allocation,
     257 *      this function does nothing.
     258 *
     259 *      The XSTRING must be initialized before the
     260 *      call.
     261 *
     262 *      Returns the new total no. of allocated bytes.
     263 *
     264 *@@added V0.9.7 (2001-01-07) [umoeller]
     265 */
     266
     267ULONG xstrReserve(PXSTRING pxstr,
     268                  ULONG ulBytes)
     269{
     270    ULONG   cbNeeded = ulBytes;
     271
     272    if (cbNeeded > pxstr->cbAllocated)
     273    {
     274        // we need more memory than we have previously
     275        // allocated:
     276        if (pxstr->cbAllocated)
     277            // appendee already had memory:
     278            // reallocate
     279            pxstr->psz = (PSZ)realloc(pxstr->psz,
     280                                      cbNeeded);
     281        else
     282        {
     283            // appendee has no memory:
     284            pxstr->psz = (PSZ)malloc(cbNeeded);
     285            *(pxstr->psz) = 0;
     286        }
     287
     288        pxstr->cbAllocated = cbNeeded;
     289                // ulLength is unchanged
     290    }
     291
     292    return (pxstr->cbAllocated);
    242293}
    243294
Note: See TracChangeset for help on using the changeset viewer.