Changeset 98 for trunk/src/helpers


Ignore:
Timestamp:
Aug 21, 2001, 7:29:38 PM (24 years ago)
Author:
umoeller
Message:

Misc updates.

Location:
trunk/src/helpers
Files:
7 edited

Legend:

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

    r46 r98  
    510510
    511511            case WM_MOUSEMOVE:
    512                 pData->hptrOld = WinSetPointer(HWND_DESKTOP, pData->hptrMove);
     512                if (pData->sbcd.ulCreateFlags & SBCF_MOVEABLE)
     513                    // V0.9.14 (2001-08-21) [umoeller]
     514                    // split bar is moveable:
     515                    pData->hptrOld = WinSetPointer(HWND_DESKTOP, pData->hptrMove);
     516                else
     517                    mrc = OldStaticProc(hwndBar, msg, mp1, mp2);
    513518            break;
    514519
     
    521526            case WM_BUTTON1DOWN:
    522527            case WM_BUTTON2DOWN:
    523                 TrackSplitBar(hwndBar, pData);
     528                if (pData->sbcd.ulCreateFlags & SBCF_MOVEABLE)
     529                    // V0.9.14 (2001-08-21) [umoeller]
     530                    // split bar is moveable:
     531                    TrackSplitBar(hwndBar, pData);
     532                else
     533                    mrc = OldStaticProc(hwndBar, msg, mp1, mp2);
    524534            break;
    525535
  • trunk/src/helpers/dialog.c

    r95 r98  
    100100    LINKLIST    llTables;
    101101
    102     HWND        hwndFirstFocus;
     102    HWND        hwndFirstFocus,
     103                hwndDefPushbutton;      // V0.9.14 (2001-08-21) [umoeller]
    103104
    104105    POINTL      ptlTotalOfs;
     
    719720                       )
    720721                        pDlgData->hwndFirstFocus = pColumnDef->hwndControl;
     722
     723                    // if this is the first default push button,
     724                    // go store it too
     725                    // V0.9.14 (2001-08-21) [umoeller]
     726                    if (    (!pDlgData->hwndDefPushbutton)
     727                         && ((ULONG)pControlDef->pcszClass == 0xffff0003L)
     728                         && (pControlDef->flStyle & BS_DEFAULT)
     729                       )
     730                        pDlgData->hwndDefPushbutton = pColumnDef->hwndControl;
    721731                }
    722732                else
     
    10481058 *      This does NOT use regular dialog templates from
    10491059 *      module resources. Instead, you pass in an array
    1050  *      of _DLGHITEM structures, which define the controls
     1060 *      of DLGHITEM structures, which define the controls
    10511061 *      and how they are to be formatted.
     1062 *
     1063 *      The main advantage compared to dialog resources is
     1064 *      that with this  function, you will never have to
     1065 *      define control _positions_. Instead, you only specify
     1066 *      the control _sizes_, and all positions are computed
     1067 *      automatically here. Even better, for many controls,
     1068 *      auto-sizing is supported according to the control's
     1069 *      text (e.g. for statics and checkboxes).
    10521070 *
    10531071 *      A regular standard dialog would use something like
     
    10681086 *      your dlg proc, use WinDefDlgProc as usual.
    10691087 *
    1070  *      There is NO run-time overhead after creation; after this
    1071  *      function returns, the dialog is a standard dialog as if
    1072  *      loaded from WinLoadDlg.
    1073  *
    1074  *      The array of _DLGHITEM structures defines how the
     1088 *      There is NO run-time overhead for either code or memory
     1089 *      after dialog creation; after this function returns, the
     1090 *      dialog is a standard dialog as if loaded from WinLoadDlg.
     1091 *      The array of DLGHITEM structures defines how the
    10751092 *      dialog is set up. All this is ONLY used by this function
    10761093 *      and NOT needed after the dialog has been created.
    10771094 *
    1078  *      In _DLGHITEM, the "Type" field determines what this
     1095 *      In DLGHITEM, the "Type" field determines what this
    10791096 *      structure defines. A number of handy macros have been
    10801097 *      defined to make this easier and to provide type-checking
    1081  *      at compile time.
     1098 *      at compile time. See dialog.h for more.
    10821099 *
    10831100 *      Essentially, such a dialog item operates similarly to
     
    11111128 *
    11121129 *      --  CONTROL_DEF(pDef) defines a control in a table row.
    1113  *          pDef must point to a _CONTROLDEF structure.
    1114  *
    1115  *          The main difference (and advantage) of this
    1116  *          function is that there is NO information in
    1117  *          _CONTROLDEF about a control's _position_.
     1130 *          pDef must point to a CONTROLDEF structure.
     1131 *
     1132 *          Again, there is is NO information in
     1133 *          CONTROLDEF about a control's _position_.
    11181134 *          Instead, the structure only contains the _size_
    11191135 *          of the control. All positions are computed by
     
    12511267 +                                        DlgTemplate,      // DLGHITEM array
    12521268 +                                        ARRAYITEMCOUNT(DlgTemplate),
    1253  +                                        NULL))
     1269 +                                        NULL,             // mp2 for WM_INITDLG
     1270 +                                        "9.WarpSans"))    // default font
    12541271 +          {
    12551272 +              ULONG idReturn = WinProcessDlg(hwndDlg);
     
    12591276 *@@changed V0.9.14 (2001-07-07) [umoeller]: fixed disabled mouse with hwndOwner == HWND_DESKTOP
    12601277 *@@changed V0.9.14 (2001-08-01) [umoeller]: fixed major memory leaks with nested tables
     1278 *@@changed V0.9.14 (2001-08-21) [umoeller]: fixed default push button problems
    12611279 */
    12621280
     
    13171335
    13181336                // push the current table on the stack
    1319                 PSTACKITEM pStackItem = NEW(STACKITEM);
    1320                 if (pStackItem)
     1337                PSTACKITEM pStackItem;
     1338                if (!(pStackItem = NEW(STACKITEM)))
     1339                {
     1340                    arc = ERROR_NOT_ENOUGH_MEMORY;
     1341                    break;
     1342                }
     1343                else
    13211344                {
    13221345                    pStackItem->pLastTable = pCurrentTable;
     
    13261349
    13271350                // create new table
    1328                 pCurrentTable = NEW(TABLEDEF);
    1329                 if (!pCurrentTable)
     1351                if (!(pCurrentTable = NEW(TABLEDEF)))
    13301352                    arc = ERROR_NOT_ENOUGH_MEMORY;
    13311353                else
     
    13721394                {
    13731395                    // create new row
    1374                     pCurrentRow = NEW(ROWDEF);
    1375                     if (!pCurrentRow)
     1396                    if (!(pCurrentRow = NEW(ROWDEF)))
    13761397                        arc = ERROR_NOT_ENOUGH_MEMORY;
    13771398                    else
     
    14651486            hwndOwner = NULLHANDLE;
    14661487
    1467         pDlgData->hwndDlg = WinCreateWindow(HWND_DESKTOP,
    1468                                             WC_FRAME,
    1469                                             (PSZ)pcszDlgTitle,
    1470                                             flStyle,        // style; invisible for now
    1471                                             0, 0, 0, 0,
    1472                                             hwndOwner,
    1473                                             HWND_TOP,
    1474                                             0,              // ID
    1475                                             &fcData,
    1476                                             NULL);          // presparams
    1477 
    1478         if (!pDlgData->hwndDlg)
     1488        if (!(pDlgData->hwndDlg = WinCreateWindow(HWND_DESKTOP,
     1489                                                  WC_FRAME,
     1490                                                  (PSZ)pcszDlgTitle,
     1491                                                  flStyle,        // style; invisible for now
     1492                                                  0, 0, 0, 0,
     1493                                                  hwndOwner,
     1494                                                  HWND_TOP,
     1495                                                  0,              // ID
     1496                                                  &fcData,
     1497                                                  NULL)))          // presparams
    14791498            arc = DLGERR_CANNOT_CREATE_FRAME;
    14801499        else
     
    14931512                       &szlClient,
    14941513                       PROCESS_CALC_SIZES);
    1495 
     1514                // this goes into major recursions...
     1515
     1516            // free the cached font resources that
     1517            // might have been created here
    14961518            if (pDlgData->lcidLast)
    14971519            {
     
    15011523            if (pDlgData->hps)
    15021524                WinReleasePS(pDlgData->hps);
     1525
     1526            WinSubclassWindow(hwndDlg, pfnwpDialogProc);
    15031527
    15041528            /*
     
    15061530             *     size of all controls
    15071531             */
    1508 
    1509             WinSubclassWindow(hwndDlg, pfnwpDialogProc);
    15101532
    15111533            // calculate the frame size from the client size
     
    15461568                       &szlClient,
    15471569                       PROCESS_CREATE_CONTROLS);
     1570
     1571            if (pDlgData->hwndDefPushbutton)
     1572                // we had a default pushbutton:
     1573                // go set it V0.9.14 (2001-08-21) [umoeller]
     1574                WinSetWindowULong(pDlgData->hwndDlg,
     1575                                  QWL_DEFBUTTON,
     1576                                  pDlgData->hwndDefPushbutton);
    15481577
    15491578            /*
  • trunk/src/helpers/xmlparse.c

    r97 r98  
    947947    inheritedBindings = 0;
    948948    attsSize = INIT_ATTS_SIZE;
    949     atts = MALLOC(attsSize * sizeof(ATTRIBUTE));
     949    atts = (ATTRIBUTE*)MALLOC(attsSize * sizeof(ATTRIBUTE));
    950950    nSpecifiedAtts = 0;
    951     dataBuf = MALLOC(INIT_DATA_BUF_SIZE * sizeof(XML_Char));
     951    dataBuf = (XML_Char*)MALLOC(INIT_DATA_BUF_SIZE * sizeof(XML_Char));
    952952    groupSize = 0;
    953953    groupConnector = 0;
     
    10651065
    10661066#ifdef XML_DTD
    1067     int oldParamEntityParsing = paramEntityParsing;
     1067    enum XML_ParamEntityParsing oldParamEntityParsing = paramEntityParsing;
    10681068
    10691069#endif
     
    22522252            }
    22532253            while (bufferSize < neededSize);
    2254             newBuf = MALLOC(bufferSize);
     2254            newBuf = (char*)MALLOC(bufferSize);
    22552255            if (newBuf == 0)
    22562256            {
     
    27832783                    else
    27842784                    {
    2785                         tag = MALLOC(sizeof(TAG));
     2785                        tag = (TAG*)MALLOC(sizeof(TAG));
    27862786                        if (!tag)
    27872787                            return ERROR_EXPAT_NO_MEMORY;
    2788                         tag->buf = MALLOC(INIT_TAG_BUF_SIZE);
     2788                        tag->buf = (char*)MALLOC(INIT_TAG_BUF_SIZE);
    27892789                        if (!tag->buf)
    27902790                            return ERROR_EXPAT_NO_MEMORY;
     
    28062806
    28072807                            bufSize = ROUND_UP(bufSize, sizeof(XML_Char));
    2808                             tag->buf = REALLOC(tag->buf, bufSize);
     2808                            tag->buf = (char*)REALLOC(tag->buf, bufSize);
    28092809                            if (!tag->buf)
    28102810                                return ERROR_EXPAT_NO_MEMORY;
     
    28372837                                break;
    28382838                            bufSize = (tag->bufEnd - tag->buf) << 1;
    2839                             tag->buf = REALLOC(tag->buf, bufSize);
     2839                            tag->buf = (char*)REALLOC(tag->buf, bufSize);
    28402840                            if (!tag->buf)
    28412841                                return ERROR_EXPAT_NO_MEMORY;
     
    31403140
    31413141        attsSize = n + nDefaultAtts + INIT_ATTS_SIZE;
    3142         atts = REALLOC((void *)atts, attsSize * sizeof(ATTRIBUTE));
     3142        atts = (ATTRIBUTE*)REALLOC((void *)atts, attsSize * sizeof(ATTRIBUTE));
    31433143        if (!atts)
    31443144            return ERROR_EXPAT_NO_MEMORY;
     
    33653365    {
    33663366        TAG *p;
    3367         XML_Char *uri = MALLOC((n + EXPAND_SPARE) * sizeof(XML_Char));
     3367        XML_Char *uri = (XML_Char*)MALLOC((n + EXPAND_SPARE) * sizeof(XML_Char));
    33683368
    33693369        if (!uri)
     
    33973397        if (len > b->uriAlloc)
    33983398        {
    3399             b->uri = REALLOC(b->uri, sizeof(XML_Char) * (len + EXPAND_SPARE));
     3399            b->uri = (XML_Char*)REALLOC(b->uri, sizeof(XML_Char) * (len + EXPAND_SPARE));
    34003400            if (!b->uri)
    34013401                return 0;
     
    34063406    else
    34073407    {
    3408         b = MALLOC(sizeof(BINDING));
     3408        b = (BINDING*)MALLOC(sizeof(BINDING));
    34093409        if (!b)
    34103410            return 0;
    3411         b->uri = MALLOC(sizeof(XML_Char) * (len + EXPAND_SPARE));
     3411        b->uri = (XML_Char*)MALLOC(sizeof(XML_Char) * (len + EXPAND_SPARE));
    34123412        if (!b->uri)
    34133413        {
     
    38193819            {
    38203820                unknownEncodingData = info.data;
    3821                 unknownEncodingRelease = info.release;
     3821                unknownEncodingRelease = (void(*)(void*))info.release;
    38223822                encoding = enc;
    38233823                return ERROR_EXPAT_NONE;
     
    44534453                    if (groupSize)
    44544454                    {
    4455                         groupConnector = REALLOC(groupConnector, groupSize *= 2);
     4455                        groupConnector = (char*)REALLOC(groupConnector, groupSize *= 2);
    44564456                        if (dtd.scaffIndex)
    4457                             dtd.scaffIndex = REALLOC(dtd.scaffIndex, groupSize * sizeof(int));
     4457                            dtd.scaffIndex = (int*)REALLOC(dtd.scaffIndex, groupSize * sizeof(int));
    44584458                    }
    44594459                    else
    4460                         groupConnector = MALLOC(groupSize = 32);
     4460                        groupConnector = (char*)MALLOC(groupSize = 32);
    44614461                    if (!groupConnector)
    44624462                        return ERROR_EXPAT_NO_MEMORY;
     
    52325232        {
    52335233            type->allocDefaultAtts = 8;
    5234             type->defaultAtts = MALLOC(type->allocDefaultAtts * sizeof(DEFAULT_ATTRIBUTE));
     5234            type->defaultAtts = (DEFAULT_ATTRIBUTE*)MALLOC(type->allocDefaultAtts * sizeof(DEFAULT_ATTRIBUTE));
    52355235        }
    52365236        else
    52375237        {
    52385238            type->allocDefaultAtts *= 2;
    5239             type->defaultAtts = REALLOC(type->defaultAtts,
     5239            type->defaultAtts = (DEFAULT_ATTRIBUTE*)REALLOC(type->defaultAtts,
    52405240                          type->allocDefaultAtts * sizeof(DEFAULT_ATTRIBUTE));
    52415241        }
     
    58145814            return 0;
    58155815        tsize = INIT_SIZE * sizeof(NAMED *);
    5816         table->v = table->mem->malloc_fcn(tsize);
     5816        table->v = (NAMED**)table->mem->malloc_fcn(tsize);
    58175817        if (!table->v)
    58185818            return 0;
     
    58405840            size_t newSize = table->size * 2;
    58415841            size_t tsize = newSize * sizeof(NAMED *);
    5842             NAMED **newV = table->mem->malloc_fcn(tsize);
     5842            NAMED **newV = (NAMED**)table->mem->malloc_fcn(tsize);
    58435843
    58445844            if (!newV)
     
    58665866        }
    58675867    }
    5868     table->v[i] = table->mem->malloc_fcn(createSize);
     5868    table->v[i] = (NAMED*)table->mem->malloc_fcn(createSize);
    58695869    if (!table->v[i])
    58705870        return 0;
     
    61406140        int blockSize = (pool->end - pool->start) * 2;
    61416141
    6142         pool->blocks = pool->mem->realloc_fcn(pool->blocks, offsetof(BLOCK, s) + blockSize * sizeof(XML_Char));
     6142        pool->blocks = (BLOCK*)pool->mem->realloc_fcn(pool->blocks, offsetof(BLOCK, s) + blockSize * sizeof(XML_Char));
    61436143        if (!pool->blocks)
    61446144            return 0;
     
    61576157        else
    61586158            blockSize *= 2;
    6159         tem = pool->mem->malloc_fcn(offsetof(BLOCK, s) + blockSize * sizeof(XML_Char));
     6159        tem = (BLOCK*)pool->mem->malloc_fcn(offsetof(BLOCK, s) + blockSize * sizeof(XML_Char));
    61606160        if (!tem)
    61616161            return 0;
     
    61806180    if (!dtd.scaffIndex)
    61816181    {
    6182         dtd.scaffIndex = MALLOC(groupSize * sizeof(int));
     6182        dtd.scaffIndex = (int*)MALLOC(groupSize * sizeof(int));
    61836183
    61846184        if (!dtd.scaffIndex)
     
    62736273    int allocsize = dtd.scaffCount * sizeof(XMLCONTENT) + dtd.contentStringLen;
    62746274
    6275     ret = MALLOC(allocsize);
     6275    ret = (XMLCONTENT*)MALLOC(allocsize);
    62766276    if (!ret)
    62776277        return 0;
  • trunk/src/helpers/xmlrole.c

    r97 r98  
    6464#endif /* not XML_DTD */
    6565
    66 typedef int PROLOG_HANDLER(PROLOG_STATE *state,
    67                int tok,
    68                const char *ptr,
    69                const char *end,
    70                const ENCODING *enc);
     66typedef int EXPATENTRY PROLOG_HANDLER(PROLOG_STATE *state,
     67                                      int tok,
     68                                      const char *ptr,
     69                                      const char *end,
     70                                      const ENCODING *enc);
    7171
    7272static PROLOG_HANDLER
     
    9292
    9393static
    94 int prolog0(PROLOG_STATE *state,
     94int EXPATENTRY prolog0(PROLOG_STATE *state,
    9595        int tok,
    9696        const char *ptr,
  • trunk/src/helpers/xmltok.c

    r97 r98  
    8686
    8787static
    88 int isNever(const ENCODING * enc, const char *p)
     88int EXPATENTRY isNever(const ENCODING * enc, const char *p)
    8989{
    9090    return 0;
     
    9292
    9393static
    94 int utf8_isName2(const ENCODING * enc, const char *p)
     94int EXPATENTRY utf8_isName2(const ENCODING * enc, const char *p)
    9595{
    9696    return UTF8_GET_NAMING2(namePages, (const unsigned char *)p);
     
    9898
    9999static
    100 int utf8_isName3(const ENCODING * enc, const char *p)
     100int EXPATENTRY utf8_isName3(const ENCODING * enc, const char *p)
    101101{
    102102    return UTF8_GET_NAMING3(namePages, (const unsigned char *)p);
     
    106106
    107107static
    108 int utf8_isNmstrt2(const ENCODING * enc, const char *p)
     108int EXPATENTRY utf8_isNmstrt2(const ENCODING * enc, const char *p)
    109109{
    110110    return UTF8_GET_NAMING2(nmstrtPages, (const unsigned char *)p);
     
    112112
    113113static
    114 int utf8_isNmstrt3(const ENCODING * enc, const char *p)
     114int EXPATENTRY utf8_isNmstrt3(const ENCODING * enc, const char *p)
    115115{
    116116    return UTF8_GET_NAMING3(nmstrtPages, (const unsigned char *)p);
     
    122122
    123123static
    124 int utf8_isInvalid3(const ENCODING * enc, const char *p)
     124int EXPATENTRY utf8_isInvalid3(const ENCODING * enc, const char *p)
    125125{
    126126    return UTF8_INVALID3((const unsigned char *)p);
     
    128128
    129129static
    130 int utf8_isInvalid4(const ENCODING * enc, const char *p)
     130int EXPATENTRY utf8_isInvalid4(const ENCODING * enc, const char *p)
    131131{
    132132    return UTF8_INVALID4((const unsigned char *)p);
     
    138138    unsigned char type[256];
    139139#ifdef XML_MIN_SIZE
    140     int (*byteType) (const ENCODING *, const char *);
    141     int (*isNameMin) (const ENCODING *, const char *);
    142     int (*isNmstrtMin) (const ENCODING *, const char *);
    143     int (*byteToAscii) (const ENCODING *, const char *);
    144     int (*charMatches) (const ENCODING *, const char *, int);
     140    int (* EXPATENTRY byteType) (const ENCODING *, const char *);
     141    int (* EXPATENTRY isNameMin) (const ENCODING *, const char *);
     142    int (* EXPATENTRY isNmstrtMin) (const ENCODING *, const char *);
     143    int (* EXPATENTRY byteToAscii) (const ENCODING *, const char *);
     144    int (* EXPATENTRY charMatches) (const ENCODING *, const char *, int);
    145145#endif                          /* XML_MIN_SIZE */
    146     int (*isName2) (const ENCODING *, const char *);
    147     int (*isName3) (const ENCODING *, const char *);
    148     int (*isName4) (const ENCODING *, const char *);
    149     int (*isNmstrt2) (const ENCODING *, const char *);
    150     int (*isNmstrt3) (const ENCODING *, const char *);
    151     int (*isNmstrt4) (const ENCODING *, const char *);
    152     int (*isInvalid2) (const ENCODING *, const char *);
    153     int (*isInvalid3) (const ENCODING *, const char *);
    154     int (*isInvalid4) (const ENCODING *, const char *);
     146    int (* EXPATENTRY isName2) (const ENCODING *, const char *);
     147    int (* EXPATENTRY isName3) (const ENCODING *, const char *);
     148    int (* EXPATENTRY isName4) (const ENCODING *, const char *);
     149    int (* EXPATENTRY isNmstrt2) (const ENCODING *, const char *);
     150    int (* EXPATENTRY isNmstrt3) (const ENCODING *, const char *);
     151    int (* EXPATENTRY isNmstrt4) (const ENCODING *, const char *);
     152    int (* EXPATENTRY isInvalid2) (const ENCODING *, const char *);
     153    int (* EXPATENTRY isInvalid3) (const ENCODING *, const char *);
     154    int (* EXPATENTRY isInvalid4) (const ENCODING *, const char *);
    155155};
    156156
     
    202202
    203203#ifdef XML_MIN_SIZE
    204 static
    205 int sb_byteType(const ENCODING * enc, const char *p)
     204static int EXPATENTRY sb_byteType(const ENCODING * enc, const char *p)
    206205{
    207206    return SB_BYTE_TYPE(enc, p);
     
    217216 (((const struct normal_encoding *)(enc))->byteToAscii(enc, p))
    218217static
    219 int sb_byteToAscii(const ENCODING * enc, const char *p)
     218int EXPATENTRY sb_byteToAscii(const ENCODING * enc, const char *p)
    220219{
    221220    return *p;
     
    246245 (((const struct normal_encoding *)(enc))->charMatches(enc, p, c))
    247246static
    248 int sb_charMatches(const ENCODING * enc, const char *p, int c)
     247int EXPATENTRY sb_charMatches(const ENCODING * enc, const char *p, int c)
    249248{
    250249    return *p == c;
     
    276275};
    277276
    278 static void utf8_toUtf8(const ENCODING * enc,
     277static void EXPATENTRY utf8_toUtf8(const ENCODING * enc,
    279278                        const char **fromP,
    280279                        const char *fromLim,
     
    302301}
    303302
    304 static void utf8_toUtf16(const ENCODING * enc,
     303static void EXPATENTRY utf8_toUtf16(const ENCODING * enc,
    305304                         const char **fromP,
    306305                         const char *fromLim,
     
    397396};
    398397
    399 static void latin1_toUtf8(const ENCODING * enc,
     398static void  EXPATENTRY latin1_toUtf8(const ENCODING * enc,
    400399                          const char **fromP,
    401400                          const char *fromLim,
     
    427426}
    428427
    429 static void latin1_toUtf16(const ENCODING * enc,
     428static void  EXPATENTRY latin1_toUtf16(const ENCODING * enc,
    430429                           const char **fromP,
    431430                           const char *fromLim,
     
    463462};
    464463
    465 static void ascii_toUtf8(const ENCODING * enc,
     464static void EXPATENTRY ascii_toUtf8(const ENCODING * enc,
    466465                         const char **fromP,
    467466                         const char *fromLim,
     
    526525
    527526#define DEFINE_UTF16_TO_UTF8(E) \
    528 static \
    529 void E ## toUtf8(const ENCODING *enc, \
     527static void EXPATENTRY E ## toUtf8(const ENCODING *enc, \
    530528         const char **fromP, const char *fromLim, \
    531529         char **toP, const char *toLim) \
     
    589587
    590588#define DEFINE_UTF16_TO_UTF16(E) \
    591 static \
    592 void E ## toUtf16(const ENCODING *enc, \
     589static void EXPATENTRY E ## toUtf16(const ENCODING *enc, \
    593590          const char **fromP, const char *fromLim, \
    594591          unsigned short **toP, const unsigned short *toLim) \
     
    638635
    639636#ifdef XML_MIN_SIZE
    640 
    641      static
    642      int little2_byteType(const ENCODING * enc, const char *p)
     637static int  EXPATENTRY little2_byteType(const ENCODING * enc, const char *p)
    643638{
    644639    return LITTLE2_BYTE_TYPE(enc, p);
    645640}
    646641
    647 static int little2_byteToAscii(const ENCODING * enc, const char *p)
     642static int  EXPATENTRY little2_byteToAscii(const ENCODING * enc, const char *p)
    648643{
    649644    return LITTLE2_BYTE_TO_ASCII(enc, p);
    650645}
    651646
    652 static int little2_charMatches(const ENCODING * enc, const char *p, int c)
     647static int  EXPATENTRY little2_charMatches(const ENCODING * enc, const char *p, int c)
    653648{
    654649    return LITTLE2_CHAR_MATCHES(enc, p, c);
    655650}
    656651
    657 static int little2_isNameMin(const ENCODING * enc, const char *p)
     652static int  EXPATENTRY little2_isNameMin(const ENCODING * enc, const char *p)
    658653{
    659654    return LITTLE2_IS_NAME_CHAR_MINBPC(enc, p);
    660655}
    661656
    662 static int little2_isNmstrtMin(const ENCODING * enc, const char *p)
     657static int  EXPATENTRY little2_isNmstrtMin(const ENCODING * enc, const char *p)
    663658{
    664659    return LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p);
     
    778773#ifdef XML_MIN_SIZE
    779774
    780 static int big2_byteType(const ENCODING * enc, const char *p)
     775static int  EXPATENTRY big2_byteType(const ENCODING * enc, const char *p)
    781776{
    782777    return BIG2_BYTE_TYPE(enc, p);
    783778}
    784779
    785 static int big2_byteToAscii(const ENCODING * enc, const char *p)
     780static int  EXPATENTRY big2_byteToAscii(const ENCODING * enc, const char *p)
    786781{
    787782    return BIG2_BYTE_TO_ASCII(enc, p);
    788783}
    789784
    790 static int big2_charMatches(const ENCODING * enc, const char *p, int c)
     785static int  EXPATENTRY big2_charMatches(const ENCODING * enc, const char *p, int c)
    791786{
    792787    return BIG2_CHAR_MATCHES(enc, p, c);
    793788}
    794789
    795 static int big2_isNameMin(const ENCODING * enc, const char *p)
     790static int  EXPATENTRY big2_isNameMin(const ENCODING * enc, const char *p)
    796791{
    797792    return BIG2_IS_NAME_CHAR_MINBPC(enc, p);
    798793}
    799794
    800 static int big2_isNmstrtMin(const ENCODING * enc, const char *p)
     795static int  EXPATENTRY big2_isNmstrtMin(const ENCODING * enc, const char *p)
    801796{
    802797    return BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p);
     
    923918}
    924919
    925 static void initUpdatePosition(const ENCODING * enc, const char *ptr,
     920static void  EXPATENTRY initUpdatePosition(const ENCODING * enc, const char *ptr,
    926921                        const char *end, POSITION * pos)
    927922{
     
    929924}
    930925
    931 static int toAscii(const ENCODING * enc, const char *ptr, const char *end)
     926static int  EXPATENTRY toAscii(const ENCODING * enc, const char *ptr, const char *end)
    932927{
    933928    char buf[1];
     
    941936}
    942937
    943 static int isSpace(int c)
     938static int  EXPATENTRY isSpace(int c)
    944939{
    945940    switch (c)
     
    956951/* Return 1 if there's just optional white space
    957952 * or there's an S followed by name=val. */
    958 static int parsePseudoAttribute(const ENCODING * enc,
     953static int  EXPATENTRY parsePseudoAttribute(const ENCODING * enc,
    959954                                const char *ptr,
    960955                                const char *end,
     
    12881283}
    12891284
    1290 static int unknown_isName(const ENCODING * enc, const char *p)
     1285static int  EXPATENTRY unknown_isName(const ENCODING * enc, const char *p)
    12911286{
    12921287    int c = ((const struct unknown_encoding *)enc)
     
    12981293}
    12991294
    1300 static int unknown_isNmstrt(const ENCODING * enc, const char *p)
     1295static int  EXPATENTRY unknown_isNmstrt(const ENCODING * enc, const char *p)
    13011296{
    13021297    int c = ((const struct unknown_encoding *)enc)
     
    13081303}
    13091304
    1310 static int unknown_isInvalid(const ENCODING * enc, const char *p)
     1305static int  EXPATENTRY unknown_isInvalid(const ENCODING * enc, const char *p)
    13111306{
    13121307    int c = ((const struct unknown_encoding *)enc)
     
    13161311}
    13171312
    1318 static void unknown_toUtf8(const ENCODING * enc,
     1313static void  EXPATENTRY unknown_toUtf8(const ENCODING * enc,
    13191314                           const char **fromP,
    13201315                           const char *fromLim,
     
    13591354}
    13601355
    1361 static void unknown_toUtf16(const ENCODING * enc,
     1356static void  EXPATENTRY unknown_toUtf16(const ENCODING * enc,
    13621357                            const char **fromP,
    13631358                            const char *fromLim,
     
    13951390{
    13961391    int i;
    1397     struct unknown_encoding *e = mem;
     1392    struct unknown_encoding *e = (struct unknown_encoding*)mem;
    13981393
    13991394    // gee, isn't this a regular memcpy?!?
     
    15631558
    15641559
    1565 static int initScan(const ENCODING ** encodingTable,
     1560static int EXPATENTRY initScan(const ENCODING ** encodingTable,
    15661561                    const INIT_ENCODING * enc,
    15671562                    int state,
     
    17081703ENCODING * XmlInitUnknownEncodingNS(void *mem,
    17091704                                    int *table,
    1710                                     int (*convert) (void *userData, const char *p),
     1705                                    int (* EXPATENTRY convert) (void *userData, const char *p),
    17111706                                    void *userData)
    17121707{
  • trunk/src/helpers/xmltok_impl.c

    r97 r98  
     1
    12/*
    2 Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
    3 See the file COPYING for copying permission.
    4 */
     3 *sourcefile xmltok_impl.c
     4 *      part of the expat implementation. See xmlparse.c.
     5 *
     6 *      NOTE: This file must not be compiled directly. It is
     7 *      #include'd from xmltok.c several times.
     8 */
     9
     10/*
     11 *      Copyright (C) 2001 Ulrich M”ller.
     12 *      Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd.
     13 *                                     and Clark Cooper.
     14 *
     15 *      Permission is hereby granted, free of charge, to any person obtaining
     16 *      a copy of this software and associated documentation files (the
     17 *      "Software"), to deal in the Software without restriction, including
     18 *      without limitation the rights to use, copy, modify, merge, publish,
     19 *      distribute, sublicense, and/or sell copies of the Software, and to
     20 *      permit persons to whom the Software is furnished to do so, subject to
     21 *      the following conditions:
     22 *
     23 *      The above copyright notice and this permission notice shall be included
     24 *      in all copies or substantial portions of the Software.
     25 *
     26 *      THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
     27 *      EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
     28 *      MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
     29 *      IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
     30 *      CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
     31 *      TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
     32 *      SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     33 */
    534
    635#ifndef IS_INVALID_CHAR
     
    88117/* ptr points to character following "<!-" */
    89118
    90 static
    91 int PREFIX(scanComment)(const ENCODING *enc, const char *ptr, const char *end,
    92             const char **nextTokPtr)
     119static int EXPATENTRY PREFIX(scanComment)(const ENCODING *enc,
     120                                          const char *ptr,
     121                                          const char *end,
     122                                          const char **nextTokPtr)
    93123{
    94124  if (ptr != end) {
     
    126156/* ptr points to character following "<!" */
    127157
    128 static
    129 int PREFIX(scanDecl)(const ENCODING *enc, const char *ptr, const char *end,
     158static int EXPATENTRY PREFIX(scanDecl)(const ENCODING *enc, const char *ptr, const char *end,
    130159             const char **nextTokPtr)
    131160{
     
    173202}
    174203
    175 static
    176 int PREFIX(checkPiTarget)(const ENCODING *enc, const char *ptr, const char *end, int *tokPtr)
     204static int EXPATENTRY PREFIX(checkPiTarget)(const ENCODING *enc, const char *ptr, const char *end, int *tokPtr)
    177205{
    178206  int upper = 0;
     
    217245/* ptr points to character following "<?" */
    218246
    219 static
    220 int PREFIX(scanPi)(const ENCODING *enc, const char *ptr, const char *end,
     247static int EXPATENTRY PREFIX(scanPi)(const ENCODING *enc, const char *ptr, const char *end,
    221248           const char **nextTokPtr)
    222249{
     
    280307
    281308
    282 static
    283 int PREFIX(scanCdataSection)(const ENCODING *enc, const char *ptr, const char *end,
     309static int EXPATENTRY PREFIX(scanCdataSection)(const ENCODING *enc, const char *ptr, const char *end,
    284310                 const char **nextTokPtr)
    285311{
     
    299325}
    300326
    301 static
    302 int PREFIX(cdataSectionTok)(const ENCODING *enc, const char *ptr, const char *end,
     327static int EXPATENTRY PREFIX(cdataSectionTok)(const ENCODING *enc, const char *ptr, const char *end,
    303328                const char **nextTokPtr)
    304329{
     
    377402/* ptr points to character following "</" */
    378403
    379 static
    380 int PREFIX(scanEndTag)(const ENCODING *enc, const char *ptr, const char *end,
     404static int EXPATENTRY PREFIX(scanEndTag)(const ENCODING *enc, const char *ptr, const char *end,
    381405               const char **nextTokPtr)
    382406{
     
    425449/* ptr points to character following "&#X" */
    426450
    427 static
    428 int PREFIX(scanHexCharRef)(const ENCODING *enc, const char *ptr, const char *end,
     451static int EXPATENTRY PREFIX(scanHexCharRef)(const ENCODING *enc, const char *ptr, const char *end,
    429452               const char **nextTokPtr)
    430453{
     
    457480/* ptr points to character following "&#" */
    458481
    459 static
    460 int PREFIX(scanCharRef)(const ENCODING *enc, const char *ptr, const char *end,
     482static int EXPATENTRY PREFIX(scanCharRef)(const ENCODING *enc, const char *ptr, const char *end,
    461483            const char **nextTokPtr)
    462484{
     
    489511/* ptr points to character following "&" */
    490512
    491 static
    492 int PREFIX(scanRef)(const ENCODING *enc, const char *ptr, const char *end,
     513static int EXPATENTRY PREFIX(scanRef)(const ENCODING *enc, const char *ptr, const char *end,
    493514            const char **nextTokPtr)
    494515{
     
    519540/* ptr points to character following first character of attribute name */
    520541
    521 static
    522 int PREFIX(scanAtts)(const ENCODING *enc, const char *ptr, const char *end,
     542static int EXPATENTRY PREFIX(scanAtts)(const ENCODING *enc, const char *ptr, const char *end,
    523543             const char **nextTokPtr)
    524544{
     
    679699/* ptr points to character following "<" */
    680700
    681 static
    682 int PREFIX(scanLt)(const ENCODING *enc, const char *ptr, const char *end,
     701static int EXPATENTRY PREFIX(scanLt)(const ENCODING *enc, const char *ptr, const char *end,
    683702           const char **nextTokPtr)
    684703{
     
    778797}
    779798
    780 static
    781 int PREFIX(contentTok)(const ENCODING *enc, const char *ptr, const char *end,
     799static int EXPATENTRY PREFIX(contentTok)(const ENCODING *enc, const char *ptr, const char *end,
    782800               const char **nextTokPtr)
    783801{
     
    877895/* ptr points to character following "%" */
    878896
    879 static
    880 int PREFIX(scanPercent)(const ENCODING *enc, const char *ptr, const char *end,
     897static int EXPATENTRY PREFIX(scanPercent)(const ENCODING *enc, const char *ptr, const char *end,
    881898            const char **nextTokPtr)
    882899{
     
    906923}
    907924
    908 static
    909 int PREFIX(scanPoundName)(const ENCODING *enc, const char *ptr, const char *end,
     925static int EXPATENTRY PREFIX(scanPoundName)(const ENCODING *enc, const char *ptr, const char *end,
    910926              const char **nextTokPtr)
    911927{
     
    933949}
    934950
    935 static
    936 int PREFIX(scanLit)(int open, const ENCODING *enc,
     951static int EXPATENTRY PREFIX(scanLit)(int open, const ENCODING *enc,
    937952            const char *ptr, const char *end,
    938953            const char **nextTokPtr)
     
    965980}
    966981
    967 static
    968 int PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end,
     982static int EXPATENTRY PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end,
    969983              const char **nextTokPtr)
    970984{
     
    11931207}
    11941208
    1195 static
    1196 int PREFIX(attributeValueTok)(const ENCODING *enc, const char *ptr, const char *end,
     1209static int EXPATENTRY PREFIX(attributeValueTok)(const ENCODING *enc, const char *ptr, const char *end,
    11971210                  const char **nextTokPtr)
    11981211{
     
    12511264}
    12521265
    1253 static
    1254 int PREFIX(entityValueTok)(const ENCODING *enc, const char *ptr, const char *end,
     1266static int EXPATENTRY PREFIX(entityValueTok)(const ENCODING *enc, const char *ptr, const char *end,
    12551267               const char **nextTokPtr)
    12561268{
     
    13081320#ifdef XML_DTD
    13091321
    1310 static
    1311 int PREFIX(ignoreSectionTok)(const ENCODING *enc, const char *ptr, const char *end,
     1322static int EXPATENTRY PREFIX(ignoreSectionTok)(const ENCODING *enc, const char *ptr, const char *end,
    13121323                 const char **nextTokPtr)
    13131324{
     
    13611372#endif /* XML_DTD */
    13621373
    1363 static
    1364 int PREFIX(isPublicId)(const ENCODING *enc, const char *ptr, const char *end,
     1374static int EXPATENTRY PREFIX(isPublicId)(const ENCODING *enc, const char *ptr, const char *end,
    13651375               const char **badPtr)
    13661376{
     
    14201430are stored in atts. */
    14211431
    1422 static
    1423 int PREFIX(getAtts)(const ENCODING *enc, const char *ptr,
     1432static int EXPATENTRY PREFIX(getAtts)(const ENCODING *enc, const char *ptr,
    14241433            int attsMax, ATTRIBUTE *atts)
    14251434{
     
    15131522}
    15141523
    1515 static
    1516 int PREFIX(charRefNumber)(const ENCODING *enc, const char *ptr)
     1524static int EXPATENTRY PREFIX(charRefNumber)(const ENCODING *enc, const char *ptr)
    15171525{
    15181526  int result = 0;
     
    15531561}
    15541562
    1555 static
    1556 int PREFIX(predefinedEntityName)(const ENCODING *enc, const char *ptr, const char *end)
     1563static int EXPATENTRY PREFIX(predefinedEntityName)(const ENCODING *enc, const char *ptr, const char *end)
    15571564{
    15581565  switch ((end - ptr)/MINBPC(enc)) {
     
    16061613}
    16071614
    1608 static
    1609 int PREFIX(sameName)(const ENCODING *enc, const char *ptr1, const char *ptr2)
     1615static int EXPATENTRY PREFIX(sameName)(const ENCODING *enc, const char *ptr1, const char *ptr2)
    16101616{
    16111617  for (;;) {
     
    16701676}
    16711677
    1672 static
    1673 int PREFIX(nameMatchesAscii)(const ENCODING *enc, const char *ptr1,
     1678static int EXPATENTRY PREFIX(nameMatchesAscii)(const ENCODING *enc, const char *ptr1,
    16741679                 const char *end1, const char *ptr2)
    16751680{
     
    16831688}
    16841689
    1685 static
    1686 int PREFIX(nameLength)(const ENCODING *enc, const char *ptr)
     1690static int EXPATENTRY PREFIX(nameLength)(const ENCODING *enc, const char *ptr)
    16871691{
    16881692  const char *start = ptr;
     
    17101714}
    17111715
    1712 static
    1713 const char *PREFIX(skipS)(const ENCODING *enc, const char *ptr)
     1716static const char* EXPATENTRY PREFIX(skipS)(const ENCODING *enc, const char *ptr)
    17141717{
    17151718  for (;;) {
     
    17261729}
    17271730
    1728 static
    1729 void PREFIX(updatePosition)(const ENCODING *enc,
     1731static void EXPATENTRY PREFIX(updatePosition)(const ENCODING *enc,
    17301732                const char *ptr,
    17311733                const char *end,
  • trunk/src/helpers/xmltok_ns.c

    r97 r98  
    2727};
    2828
    29 static
    30 int NS(initScanProlog)(const ENCODING *enc, const char *ptr, const char *end,
     29static int EXPATENTRY NS(initScanProlog)(const ENCODING *enc, const char *ptr, const char *end,
    3130               const char **nextTokPtr)
    3231{
     
    3433}
    3534
    36 static
    37 int NS(initScanContent)(const ENCODING *enc, const char *ptr, const char *end,
     35static int EXPATENTRY NS(initScanContent)(const ENCODING *enc, const char *ptr, const char *end,
    3836               const char **nextTokPtr)
    3937{
Note: See TracChangeset for help on using the changeset viewer.