Changeset 98 for trunk/src/helpers
- Timestamp:
- Aug 21, 2001, 7:29:38 PM (24 years ago)
- Location:
- trunk/src/helpers
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/cctl_splitwin.c
r46 r98 510 510 511 511 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); 513 518 break; 514 519 … … 521 526 case WM_BUTTON1DOWN: 522 527 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); 524 534 break; 525 535 -
trunk/src/helpers/dialog.c
r95 r98 100 100 LINKLIST llTables; 101 101 102 HWND hwndFirstFocus; 102 HWND hwndFirstFocus, 103 hwndDefPushbutton; // V0.9.14 (2001-08-21) [umoeller] 103 104 104 105 POINTL ptlTotalOfs; … … 719 720 ) 720 721 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; 721 731 } 722 732 else … … 1048 1058 * This does NOT use regular dialog templates from 1049 1059 * module resources. Instead, you pass in an array 1050 * of _DLGHITEM structures, which define the controls1060 * of DLGHITEM structures, which define the controls 1051 1061 * 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). 1052 1070 * 1053 1071 * A regular standard dialog would use something like … … 1068 1086 * your dlg proc, use WinDefDlgProc as usual. 1069 1087 * 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 1075 1092 * dialog is set up. All this is ONLY used by this function 1076 1093 * and NOT needed after the dialog has been created. 1077 1094 * 1078 * In _DLGHITEM, the "Type" field determines what this1095 * In DLGHITEM, the "Type" field determines what this 1079 1096 * structure defines. A number of handy macros have been 1080 1097 * defined to make this easier and to provide type-checking 1081 * at compile time. 1098 * at compile time. See dialog.h for more. 1082 1099 * 1083 1100 * Essentially, such a dialog item operates similarly to … … 1111 1128 * 1112 1129 * -- 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_. 1118 1134 * Instead, the structure only contains the _size_ 1119 1135 * of the control. All positions are computed by … … 1251 1267 + DlgTemplate, // DLGHITEM array 1252 1268 + ARRAYITEMCOUNT(DlgTemplate), 1253 + NULL)) 1269 + NULL, // mp2 for WM_INITDLG 1270 + "9.WarpSans")) // default font 1254 1271 + { 1255 1272 + ULONG idReturn = WinProcessDlg(hwndDlg); … … 1259 1276 *@@changed V0.9.14 (2001-07-07) [umoeller]: fixed disabled mouse with hwndOwner == HWND_DESKTOP 1260 1277 *@@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 1261 1279 */ 1262 1280 … … 1317 1335 1318 1336 // 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 1321 1344 { 1322 1345 pStackItem->pLastTable = pCurrentTable; … … 1326 1349 1327 1350 // create new table 1328 pCurrentTable = NEW(TABLEDEF); 1329 if (!pCurrentTable) 1351 if (!(pCurrentTable = NEW(TABLEDEF))) 1330 1352 arc = ERROR_NOT_ENOUGH_MEMORY; 1331 1353 else … … 1372 1394 { 1373 1395 // create new row 1374 pCurrentRow = NEW(ROWDEF); 1375 if (!pCurrentRow) 1396 if (!(pCurrentRow = NEW(ROWDEF))) 1376 1397 arc = ERROR_NOT_ENOUGH_MEMORY; 1377 1398 else … … 1465 1486 hwndOwner = NULLHANDLE; 1466 1487 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 1479 1498 arc = DLGERR_CANNOT_CREATE_FRAME; 1480 1499 else … … 1493 1512 &szlClient, 1494 1513 PROCESS_CALC_SIZES); 1495 1514 // this goes into major recursions... 1515 1516 // free the cached font resources that 1517 // might have been created here 1496 1518 if (pDlgData->lcidLast) 1497 1519 { … … 1501 1523 if (pDlgData->hps) 1502 1524 WinReleasePS(pDlgData->hps); 1525 1526 WinSubclassWindow(hwndDlg, pfnwpDialogProc); 1503 1527 1504 1528 /* … … 1506 1530 * size of all controls 1507 1531 */ 1508 1509 WinSubclassWindow(hwndDlg, pfnwpDialogProc);1510 1532 1511 1533 // calculate the frame size from the client size … … 1546 1568 &szlClient, 1547 1569 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); 1548 1577 1549 1578 /* -
trunk/src/helpers/xmlparse.c
r97 r98 947 947 inheritedBindings = 0; 948 948 attsSize = INIT_ATTS_SIZE; 949 atts = MALLOC(attsSize * sizeof(ATTRIBUTE));949 atts = (ATTRIBUTE*)MALLOC(attsSize * sizeof(ATTRIBUTE)); 950 950 nSpecifiedAtts = 0; 951 dataBuf = MALLOC(INIT_DATA_BUF_SIZE * sizeof(XML_Char));951 dataBuf = (XML_Char*)MALLOC(INIT_DATA_BUF_SIZE * sizeof(XML_Char)); 952 952 groupSize = 0; 953 953 groupConnector = 0; … … 1065 1065 1066 1066 #ifdef XML_DTD 1067 intoldParamEntityParsing = paramEntityParsing;1067 enum XML_ParamEntityParsing oldParamEntityParsing = paramEntityParsing; 1068 1068 1069 1069 #endif … … 2252 2252 } 2253 2253 while (bufferSize < neededSize); 2254 newBuf = MALLOC(bufferSize);2254 newBuf = (char*)MALLOC(bufferSize); 2255 2255 if (newBuf == 0) 2256 2256 { … … 2783 2783 else 2784 2784 { 2785 tag = MALLOC(sizeof(TAG));2785 tag = (TAG*)MALLOC(sizeof(TAG)); 2786 2786 if (!tag) 2787 2787 return ERROR_EXPAT_NO_MEMORY; 2788 tag->buf = MALLOC(INIT_TAG_BUF_SIZE);2788 tag->buf = (char*)MALLOC(INIT_TAG_BUF_SIZE); 2789 2789 if (!tag->buf) 2790 2790 return ERROR_EXPAT_NO_MEMORY; … … 2806 2806 2807 2807 bufSize = ROUND_UP(bufSize, sizeof(XML_Char)); 2808 tag->buf = REALLOC(tag->buf, bufSize);2808 tag->buf = (char*)REALLOC(tag->buf, bufSize); 2809 2809 if (!tag->buf) 2810 2810 return ERROR_EXPAT_NO_MEMORY; … … 2837 2837 break; 2838 2838 bufSize = (tag->bufEnd - tag->buf) << 1; 2839 tag->buf = REALLOC(tag->buf, bufSize);2839 tag->buf = (char*)REALLOC(tag->buf, bufSize); 2840 2840 if (!tag->buf) 2841 2841 return ERROR_EXPAT_NO_MEMORY; … … 3140 3140 3141 3141 attsSize = n + nDefaultAtts + INIT_ATTS_SIZE; 3142 atts = REALLOC((void *)atts, attsSize * sizeof(ATTRIBUTE));3142 atts = (ATTRIBUTE*)REALLOC((void *)atts, attsSize * sizeof(ATTRIBUTE)); 3143 3143 if (!atts) 3144 3144 return ERROR_EXPAT_NO_MEMORY; … … 3365 3365 { 3366 3366 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)); 3368 3368 3369 3369 if (!uri) … … 3397 3397 if (len > b->uriAlloc) 3398 3398 { 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)); 3400 3400 if (!b->uri) 3401 3401 return 0; … … 3406 3406 else 3407 3407 { 3408 b = MALLOC(sizeof(BINDING));3408 b = (BINDING*)MALLOC(sizeof(BINDING)); 3409 3409 if (!b) 3410 3410 return 0; 3411 b->uri = MALLOC(sizeof(XML_Char) * (len + EXPAND_SPARE));3411 b->uri = (XML_Char*)MALLOC(sizeof(XML_Char) * (len + EXPAND_SPARE)); 3412 3412 if (!b->uri) 3413 3413 { … … 3819 3819 { 3820 3820 unknownEncodingData = info.data; 3821 unknownEncodingRelease = info.release;3821 unknownEncodingRelease = (void(*)(void*))info.release; 3822 3822 encoding = enc; 3823 3823 return ERROR_EXPAT_NONE; … … 4453 4453 if (groupSize) 4454 4454 { 4455 groupConnector = REALLOC(groupConnector, groupSize *= 2);4455 groupConnector = (char*)REALLOC(groupConnector, groupSize *= 2); 4456 4456 if (dtd.scaffIndex) 4457 dtd.scaffIndex = REALLOC(dtd.scaffIndex, groupSize * sizeof(int));4457 dtd.scaffIndex = (int*)REALLOC(dtd.scaffIndex, groupSize * sizeof(int)); 4458 4458 } 4459 4459 else 4460 groupConnector = MALLOC(groupSize = 32);4460 groupConnector = (char*)MALLOC(groupSize = 32); 4461 4461 if (!groupConnector) 4462 4462 return ERROR_EXPAT_NO_MEMORY; … … 5232 5232 { 5233 5233 type->allocDefaultAtts = 8; 5234 type->defaultAtts = MALLOC(type->allocDefaultAtts * sizeof(DEFAULT_ATTRIBUTE));5234 type->defaultAtts = (DEFAULT_ATTRIBUTE*)MALLOC(type->allocDefaultAtts * sizeof(DEFAULT_ATTRIBUTE)); 5235 5235 } 5236 5236 else 5237 5237 { 5238 5238 type->allocDefaultAtts *= 2; 5239 type->defaultAtts = REALLOC(type->defaultAtts,5239 type->defaultAtts = (DEFAULT_ATTRIBUTE*)REALLOC(type->defaultAtts, 5240 5240 type->allocDefaultAtts * sizeof(DEFAULT_ATTRIBUTE)); 5241 5241 } … … 5814 5814 return 0; 5815 5815 tsize = INIT_SIZE * sizeof(NAMED *); 5816 table->v = table->mem->malloc_fcn(tsize);5816 table->v = (NAMED**)table->mem->malloc_fcn(tsize); 5817 5817 if (!table->v) 5818 5818 return 0; … … 5840 5840 size_t newSize = table->size * 2; 5841 5841 size_t tsize = newSize * sizeof(NAMED *); 5842 NAMED **newV = table->mem->malloc_fcn(tsize);5842 NAMED **newV = (NAMED**)table->mem->malloc_fcn(tsize); 5843 5843 5844 5844 if (!newV) … … 5866 5866 } 5867 5867 } 5868 table->v[i] = table->mem->malloc_fcn(createSize);5868 table->v[i] = (NAMED*)table->mem->malloc_fcn(createSize); 5869 5869 if (!table->v[i]) 5870 5870 return 0; … … 6140 6140 int blockSize = (pool->end - pool->start) * 2; 6141 6141 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)); 6143 6143 if (!pool->blocks) 6144 6144 return 0; … … 6157 6157 else 6158 6158 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)); 6160 6160 if (!tem) 6161 6161 return 0; … … 6180 6180 if (!dtd.scaffIndex) 6181 6181 { 6182 dtd.scaffIndex = MALLOC(groupSize * sizeof(int));6182 dtd.scaffIndex = (int*)MALLOC(groupSize * sizeof(int)); 6183 6183 6184 6184 if (!dtd.scaffIndex) … … 6273 6273 int allocsize = dtd.scaffCount * sizeof(XMLCONTENT) + dtd.contentStringLen; 6274 6274 6275 ret = MALLOC(allocsize);6275 ret = (XMLCONTENT*)MALLOC(allocsize); 6276 6276 if (!ret) 6277 6277 return 0; -
trunk/src/helpers/xmlrole.c
r97 r98 64 64 #endif /* not XML_DTD */ 65 65 66 typedef int PROLOG_HANDLER(PROLOG_STATE *state,67 int tok,68 const char *ptr,69 const char *end,70 const ENCODING *enc);66 typedef int EXPATENTRY PROLOG_HANDLER(PROLOG_STATE *state, 67 int tok, 68 const char *ptr, 69 const char *end, 70 const ENCODING *enc); 71 71 72 72 static PROLOG_HANDLER … … 92 92 93 93 static 94 int prolog0(PROLOG_STATE *state,94 int EXPATENTRY prolog0(PROLOG_STATE *state, 95 95 int tok, 96 96 const char *ptr, -
trunk/src/helpers/xmltok.c
r97 r98 86 86 87 87 static 88 int isNever(const ENCODING * enc, const char *p)88 int EXPATENTRY isNever(const ENCODING * enc, const char *p) 89 89 { 90 90 return 0; … … 92 92 93 93 static 94 int utf8_isName2(const ENCODING * enc, const char *p)94 int EXPATENTRY utf8_isName2(const ENCODING * enc, const char *p) 95 95 { 96 96 return UTF8_GET_NAMING2(namePages, (const unsigned char *)p); … … 98 98 99 99 static 100 int utf8_isName3(const ENCODING * enc, const char *p)100 int EXPATENTRY utf8_isName3(const ENCODING * enc, const char *p) 101 101 { 102 102 return UTF8_GET_NAMING3(namePages, (const unsigned char *)p); … … 106 106 107 107 static 108 int utf8_isNmstrt2(const ENCODING * enc, const char *p)108 int EXPATENTRY utf8_isNmstrt2(const ENCODING * enc, const char *p) 109 109 { 110 110 return UTF8_GET_NAMING2(nmstrtPages, (const unsigned char *)p); … … 112 112 113 113 static 114 int utf8_isNmstrt3(const ENCODING * enc, const char *p)114 int EXPATENTRY utf8_isNmstrt3(const ENCODING * enc, const char *p) 115 115 { 116 116 return UTF8_GET_NAMING3(nmstrtPages, (const unsigned char *)p); … … 122 122 123 123 static 124 int utf8_isInvalid3(const ENCODING * enc, const char *p)124 int EXPATENTRY utf8_isInvalid3(const ENCODING * enc, const char *p) 125 125 { 126 126 return UTF8_INVALID3((const unsigned char *)p); … … 128 128 129 129 static 130 int utf8_isInvalid4(const ENCODING * enc, const char *p)130 int EXPATENTRY utf8_isInvalid4(const ENCODING * enc, const char *p) 131 131 { 132 132 return UTF8_INVALID4((const unsigned char *)p); … … 138 138 unsigned char type[256]; 139 139 #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); 145 145 #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 *); 155 155 }; 156 156 … … 202 202 203 203 #ifdef XML_MIN_SIZE 204 static 205 int sb_byteType(const ENCODING * enc, const char *p) 204 static int EXPATENTRY sb_byteType(const ENCODING * enc, const char *p) 206 205 { 207 206 return SB_BYTE_TYPE(enc, p); … … 217 216 (((const struct normal_encoding *)(enc))->byteToAscii(enc, p)) 218 217 static 219 int sb_byteToAscii(const ENCODING * enc, const char *p)218 int EXPATENTRY sb_byteToAscii(const ENCODING * enc, const char *p) 220 219 { 221 220 return *p; … … 246 245 (((const struct normal_encoding *)(enc))->charMatches(enc, p, c)) 247 246 static 248 int sb_charMatches(const ENCODING * enc, const char *p, int c)247 int EXPATENTRY sb_charMatches(const ENCODING * enc, const char *p, int c) 249 248 { 250 249 return *p == c; … … 276 275 }; 277 276 278 static void utf8_toUtf8(const ENCODING * enc,277 static void EXPATENTRY utf8_toUtf8(const ENCODING * enc, 279 278 const char **fromP, 280 279 const char *fromLim, … … 302 301 } 303 302 304 static void utf8_toUtf16(const ENCODING * enc,303 static void EXPATENTRY utf8_toUtf16(const ENCODING * enc, 305 304 const char **fromP, 306 305 const char *fromLim, … … 397 396 }; 398 397 399 static void latin1_toUtf8(const ENCODING * enc,398 static void EXPATENTRY latin1_toUtf8(const ENCODING * enc, 400 399 const char **fromP, 401 400 const char *fromLim, … … 427 426 } 428 427 429 static void latin1_toUtf16(const ENCODING * enc,428 static void EXPATENTRY latin1_toUtf16(const ENCODING * enc, 430 429 const char **fromP, 431 430 const char *fromLim, … … 463 462 }; 464 463 465 static void ascii_toUtf8(const ENCODING * enc,464 static void EXPATENTRY ascii_toUtf8(const ENCODING * enc, 466 465 const char **fromP, 467 466 const char *fromLim, … … 526 525 527 526 #define DEFINE_UTF16_TO_UTF8(E) \ 528 static \ 529 void E ## toUtf8(const ENCODING *enc, \ 527 static void EXPATENTRY E ## toUtf8(const ENCODING *enc, \ 530 528 const char **fromP, const char *fromLim, \ 531 529 char **toP, const char *toLim) \ … … 589 587 590 588 #define DEFINE_UTF16_TO_UTF16(E) \ 591 static \ 592 void E ## toUtf16(const ENCODING *enc, \ 589 static void EXPATENTRY E ## toUtf16(const ENCODING *enc, \ 593 590 const char **fromP, const char *fromLim, \ 594 591 unsigned short **toP, const unsigned short *toLim) \ … … 638 635 639 636 #ifdef XML_MIN_SIZE 640 641 static 642 int little2_byteType(const ENCODING * enc, const char *p) 637 static int EXPATENTRY little2_byteType(const ENCODING * enc, const char *p) 643 638 { 644 639 return LITTLE2_BYTE_TYPE(enc, p); 645 640 } 646 641 647 static int little2_byteToAscii(const ENCODING * enc, const char *p)642 static int EXPATENTRY little2_byteToAscii(const ENCODING * enc, const char *p) 648 643 { 649 644 return LITTLE2_BYTE_TO_ASCII(enc, p); 650 645 } 651 646 652 static int little2_charMatches(const ENCODING * enc, const char *p, int c)647 static int EXPATENTRY little2_charMatches(const ENCODING * enc, const char *p, int c) 653 648 { 654 649 return LITTLE2_CHAR_MATCHES(enc, p, c); 655 650 } 656 651 657 static int little2_isNameMin(const ENCODING * enc, const char *p)652 static int EXPATENTRY little2_isNameMin(const ENCODING * enc, const char *p) 658 653 { 659 654 return LITTLE2_IS_NAME_CHAR_MINBPC(enc, p); 660 655 } 661 656 662 static int little2_isNmstrtMin(const ENCODING * enc, const char *p)657 static int EXPATENTRY little2_isNmstrtMin(const ENCODING * enc, const char *p) 663 658 { 664 659 return LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p); … … 778 773 #ifdef XML_MIN_SIZE 779 774 780 static int big2_byteType(const ENCODING * enc, const char *p)775 static int EXPATENTRY big2_byteType(const ENCODING * enc, const char *p) 781 776 { 782 777 return BIG2_BYTE_TYPE(enc, p); 783 778 } 784 779 785 static int big2_byteToAscii(const ENCODING * enc, const char *p)780 static int EXPATENTRY big2_byteToAscii(const ENCODING * enc, const char *p) 786 781 { 787 782 return BIG2_BYTE_TO_ASCII(enc, p); 788 783 } 789 784 790 static int big2_charMatches(const ENCODING * enc, const char *p, int c)785 static int EXPATENTRY big2_charMatches(const ENCODING * enc, const char *p, int c) 791 786 { 792 787 return BIG2_CHAR_MATCHES(enc, p, c); 793 788 } 794 789 795 static int big2_isNameMin(const ENCODING * enc, const char *p)790 static int EXPATENTRY big2_isNameMin(const ENCODING * enc, const char *p) 796 791 { 797 792 return BIG2_IS_NAME_CHAR_MINBPC(enc, p); 798 793 } 799 794 800 static int big2_isNmstrtMin(const ENCODING * enc, const char *p)795 static int EXPATENTRY big2_isNmstrtMin(const ENCODING * enc, const char *p) 801 796 { 802 797 return BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p); … … 923 918 } 924 919 925 static void initUpdatePosition(const ENCODING * enc, const char *ptr,920 static void EXPATENTRY initUpdatePosition(const ENCODING * enc, const char *ptr, 926 921 const char *end, POSITION * pos) 927 922 { … … 929 924 } 930 925 931 static int toAscii(const ENCODING * enc, const char *ptr, const char *end)926 static int EXPATENTRY toAscii(const ENCODING * enc, const char *ptr, const char *end) 932 927 { 933 928 char buf[1]; … … 941 936 } 942 937 943 static int isSpace(int c)938 static int EXPATENTRY isSpace(int c) 944 939 { 945 940 switch (c) … … 956 951 /* Return 1 if there's just optional white space 957 952 * or there's an S followed by name=val. */ 958 static int parsePseudoAttribute(const ENCODING * enc,953 static int EXPATENTRY parsePseudoAttribute(const ENCODING * enc, 959 954 const char *ptr, 960 955 const char *end, … … 1288 1283 } 1289 1284 1290 static int unknown_isName(const ENCODING * enc, const char *p)1285 static int EXPATENTRY unknown_isName(const ENCODING * enc, const char *p) 1291 1286 { 1292 1287 int c = ((const struct unknown_encoding *)enc) … … 1298 1293 } 1299 1294 1300 static int unknown_isNmstrt(const ENCODING * enc, const char *p)1295 static int EXPATENTRY unknown_isNmstrt(const ENCODING * enc, const char *p) 1301 1296 { 1302 1297 int c = ((const struct unknown_encoding *)enc) … … 1308 1303 } 1309 1304 1310 static int unknown_isInvalid(const ENCODING * enc, const char *p)1305 static int EXPATENTRY unknown_isInvalid(const ENCODING * enc, const char *p) 1311 1306 { 1312 1307 int c = ((const struct unknown_encoding *)enc) … … 1316 1311 } 1317 1312 1318 static void unknown_toUtf8(const ENCODING * enc,1313 static void EXPATENTRY unknown_toUtf8(const ENCODING * enc, 1319 1314 const char **fromP, 1320 1315 const char *fromLim, … … 1359 1354 } 1360 1355 1361 static void unknown_toUtf16(const ENCODING * enc,1356 static void EXPATENTRY unknown_toUtf16(const ENCODING * enc, 1362 1357 const char **fromP, 1363 1358 const char *fromLim, … … 1395 1390 { 1396 1391 int i; 1397 struct unknown_encoding *e = mem;1392 struct unknown_encoding *e = (struct unknown_encoding*)mem; 1398 1393 1399 1394 // gee, isn't this a regular memcpy?!? … … 1563 1558 1564 1559 1565 static int initScan(const ENCODING ** encodingTable,1560 static int EXPATENTRY initScan(const ENCODING ** encodingTable, 1566 1561 const INIT_ENCODING * enc, 1567 1562 int state, … … 1708 1703 ENCODING * XmlInitUnknownEncodingNS(void *mem, 1709 1704 int *table, 1710 int (* convert) (void *userData, const char *p),1705 int (* EXPATENTRY convert) (void *userData, const char *p), 1711 1706 void *userData) 1712 1707 { -
trunk/src/helpers/xmltok_impl.c
r97 r98 1 1 2 /* 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 Mller. 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 */ 5 34 6 35 #ifndef IS_INVALID_CHAR … … 88 117 /* ptr points to character following "<!-" */ 89 118 90 static 91 int PREFIX(scanComment)(const ENCODING *enc, const char *ptr, const char *end, 92 const char **nextTokPtr) 119 static int EXPATENTRY PREFIX(scanComment)(const ENCODING *enc, 120 const char *ptr, 121 const char *end, 122 const char **nextTokPtr) 93 123 { 94 124 if (ptr != end) { … … 126 156 /* ptr points to character following "<!" */ 127 157 128 static 129 int PREFIX(scanDecl)(const ENCODING *enc, const char *ptr, const char *end, 158 static int EXPATENTRY PREFIX(scanDecl)(const ENCODING *enc, const char *ptr, const char *end, 130 159 const char **nextTokPtr) 131 160 { … … 173 202 } 174 203 175 static 176 int PREFIX(checkPiTarget)(const ENCODING *enc, const char *ptr, const char *end, int *tokPtr) 204 static int EXPATENTRY PREFIX(checkPiTarget)(const ENCODING *enc, const char *ptr, const char *end, int *tokPtr) 177 205 { 178 206 int upper = 0; … … 217 245 /* ptr points to character following "<?" */ 218 246 219 static 220 int PREFIX(scanPi)(const ENCODING *enc, const char *ptr, const char *end, 247 static int EXPATENTRY PREFIX(scanPi)(const ENCODING *enc, const char *ptr, const char *end, 221 248 const char **nextTokPtr) 222 249 { … … 280 307 281 308 282 static 283 int PREFIX(scanCdataSection)(const ENCODING *enc, const char *ptr, const char *end, 309 static int EXPATENTRY PREFIX(scanCdataSection)(const ENCODING *enc, const char *ptr, const char *end, 284 310 const char **nextTokPtr) 285 311 { … … 299 325 } 300 326 301 static 302 int PREFIX(cdataSectionTok)(const ENCODING *enc, const char *ptr, const char *end, 327 static int EXPATENTRY PREFIX(cdataSectionTok)(const ENCODING *enc, const char *ptr, const char *end, 303 328 const char **nextTokPtr) 304 329 { … … 377 402 /* ptr points to character following "</" */ 378 403 379 static 380 int PREFIX(scanEndTag)(const ENCODING *enc, const char *ptr, const char *end, 404 static int EXPATENTRY PREFIX(scanEndTag)(const ENCODING *enc, const char *ptr, const char *end, 381 405 const char **nextTokPtr) 382 406 { … … 425 449 /* ptr points to character following "&#X" */ 426 450 427 static 428 int PREFIX(scanHexCharRef)(const ENCODING *enc, const char *ptr, const char *end, 451 static int EXPATENTRY PREFIX(scanHexCharRef)(const ENCODING *enc, const char *ptr, const char *end, 429 452 const char **nextTokPtr) 430 453 { … … 457 480 /* ptr points to character following "&#" */ 458 481 459 static 460 int PREFIX(scanCharRef)(const ENCODING *enc, const char *ptr, const char *end, 482 static int EXPATENTRY PREFIX(scanCharRef)(const ENCODING *enc, const char *ptr, const char *end, 461 483 const char **nextTokPtr) 462 484 { … … 489 511 /* ptr points to character following "&" */ 490 512 491 static 492 int PREFIX(scanRef)(const ENCODING *enc, const char *ptr, const char *end, 513 static int EXPATENTRY PREFIX(scanRef)(const ENCODING *enc, const char *ptr, const char *end, 493 514 const char **nextTokPtr) 494 515 { … … 519 540 /* ptr points to character following first character of attribute name */ 520 541 521 static 522 int PREFIX(scanAtts)(const ENCODING *enc, const char *ptr, const char *end, 542 static int EXPATENTRY PREFIX(scanAtts)(const ENCODING *enc, const char *ptr, const char *end, 523 543 const char **nextTokPtr) 524 544 { … … 679 699 /* ptr points to character following "<" */ 680 700 681 static 682 int PREFIX(scanLt)(const ENCODING *enc, const char *ptr, const char *end, 701 static int EXPATENTRY PREFIX(scanLt)(const ENCODING *enc, const char *ptr, const char *end, 683 702 const char **nextTokPtr) 684 703 { … … 778 797 } 779 798 780 static 781 int PREFIX(contentTok)(const ENCODING *enc, const char *ptr, const char *end, 799 static int EXPATENTRY PREFIX(contentTok)(const ENCODING *enc, const char *ptr, const char *end, 782 800 const char **nextTokPtr) 783 801 { … … 877 895 /* ptr points to character following "%" */ 878 896 879 static 880 int PREFIX(scanPercent)(const ENCODING *enc, const char *ptr, const char *end, 897 static int EXPATENTRY PREFIX(scanPercent)(const ENCODING *enc, const char *ptr, const char *end, 881 898 const char **nextTokPtr) 882 899 { … … 906 923 } 907 924 908 static 909 int PREFIX(scanPoundName)(const ENCODING *enc, const char *ptr, const char *end, 925 static int EXPATENTRY PREFIX(scanPoundName)(const ENCODING *enc, const char *ptr, const char *end, 910 926 const char **nextTokPtr) 911 927 { … … 933 949 } 934 950 935 static 936 int PREFIX(scanLit)(int open, const ENCODING *enc, 951 static int EXPATENTRY PREFIX(scanLit)(int open, const ENCODING *enc, 937 952 const char *ptr, const char *end, 938 953 const char **nextTokPtr) … … 965 980 } 966 981 967 static 968 int PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end, 982 static int EXPATENTRY PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end, 969 983 const char **nextTokPtr) 970 984 { … … 1193 1207 } 1194 1208 1195 static 1196 int PREFIX(attributeValueTok)(const ENCODING *enc, const char *ptr, const char *end, 1209 static int EXPATENTRY PREFIX(attributeValueTok)(const ENCODING *enc, const char *ptr, const char *end, 1197 1210 const char **nextTokPtr) 1198 1211 { … … 1251 1264 } 1252 1265 1253 static 1254 int PREFIX(entityValueTok)(const ENCODING *enc, const char *ptr, const char *end, 1266 static int EXPATENTRY PREFIX(entityValueTok)(const ENCODING *enc, const char *ptr, const char *end, 1255 1267 const char **nextTokPtr) 1256 1268 { … … 1308 1320 #ifdef XML_DTD 1309 1321 1310 static 1311 int PREFIX(ignoreSectionTok)(const ENCODING *enc, const char *ptr, const char *end, 1322 static int EXPATENTRY PREFIX(ignoreSectionTok)(const ENCODING *enc, const char *ptr, const char *end, 1312 1323 const char **nextTokPtr) 1313 1324 { … … 1361 1372 #endif /* XML_DTD */ 1362 1373 1363 static 1364 int PREFIX(isPublicId)(const ENCODING *enc, const char *ptr, const char *end, 1374 static int EXPATENTRY PREFIX(isPublicId)(const ENCODING *enc, const char *ptr, const char *end, 1365 1375 const char **badPtr) 1366 1376 { … … 1420 1430 are stored in atts. */ 1421 1431 1422 static 1423 int PREFIX(getAtts)(const ENCODING *enc, const char *ptr, 1432 static int EXPATENTRY PREFIX(getAtts)(const ENCODING *enc, const char *ptr, 1424 1433 int attsMax, ATTRIBUTE *atts) 1425 1434 { … … 1513 1522 } 1514 1523 1515 static 1516 int PREFIX(charRefNumber)(const ENCODING *enc, const char *ptr) 1524 static int EXPATENTRY PREFIX(charRefNumber)(const ENCODING *enc, const char *ptr) 1517 1525 { 1518 1526 int result = 0; … … 1553 1561 } 1554 1562 1555 static 1556 int PREFIX(predefinedEntityName)(const ENCODING *enc, const char *ptr, const char *end) 1563 static int EXPATENTRY PREFIX(predefinedEntityName)(const ENCODING *enc, const char *ptr, const char *end) 1557 1564 { 1558 1565 switch ((end - ptr)/MINBPC(enc)) { … … 1606 1613 } 1607 1614 1608 static 1609 int PREFIX(sameName)(const ENCODING *enc, const char *ptr1, const char *ptr2) 1615 static int EXPATENTRY PREFIX(sameName)(const ENCODING *enc, const char *ptr1, const char *ptr2) 1610 1616 { 1611 1617 for (;;) { … … 1670 1676 } 1671 1677 1672 static 1673 int PREFIX(nameMatchesAscii)(const ENCODING *enc, const char *ptr1, 1678 static int EXPATENTRY PREFIX(nameMatchesAscii)(const ENCODING *enc, const char *ptr1, 1674 1679 const char *end1, const char *ptr2) 1675 1680 { … … 1683 1688 } 1684 1689 1685 static 1686 int PREFIX(nameLength)(const ENCODING *enc, const char *ptr) 1690 static int EXPATENTRY PREFIX(nameLength)(const ENCODING *enc, const char *ptr) 1687 1691 { 1688 1692 const char *start = ptr; … … 1710 1714 } 1711 1715 1712 static 1713 const char *PREFIX(skipS)(const ENCODING *enc, const char *ptr) 1716 static const char* EXPATENTRY PREFIX(skipS)(const ENCODING *enc, const char *ptr) 1714 1717 { 1715 1718 for (;;) { … … 1726 1729 } 1727 1730 1728 static 1729 void PREFIX(updatePosition)(const ENCODING *enc, 1731 static void EXPATENTRY PREFIX(updatePosition)(const ENCODING *enc, 1730 1732 const char *ptr, 1731 1733 const char *end, -
trunk/src/helpers/xmltok_ns.c
r97 r98 27 27 }; 28 28 29 static 30 int NS(initScanProlog)(const ENCODING *enc, const char *ptr, const char *end, 29 static int EXPATENTRY NS(initScanProlog)(const ENCODING *enc, const char *ptr, const char *end, 31 30 const char **nextTokPtr) 32 31 { … … 34 33 } 35 34 36 static 37 int NS(initScanContent)(const ENCODING *enc, const char *ptr, const char *end, 35 static int EXPATENTRY NS(initScanContent)(const ENCODING *enc, const char *ptr, const char *end, 38 36 const char **nextTokPtr) 39 37 {
Note:
See TracChangeset
for help on using the changeset viewer.