Explain - after surfing to BadBlue (an enterprise P2P package). Specifically P2P sharing of Excel and Word data. Lots of business applications I can imagine for this - mobile/wireless etc.
In addition, there is a white-paper on the site describing a P2P approach to B2B marketplaces. I think there a boatload of legitimate P2P applications.
Omit the following lines from the bottom of the snippet... had to completely munge the formatting to adhere to postfilters!
if (bRecordUnlock) {
if ((rc1 = RecordUnlock(atoi(argv[1]))) != 0 && !rc) {
rc = rc1;
}
}
if (bRecordUnlock) {
if ((rc1 = RecordUnlock(atoi(argv[1]))) != 0 && !rc) {
rc = rc1;
}
}
here's a real simple template for C error-handling that would remove 99% of all error/unwind conditions.
// always return an error code
// structure loop
// done with structure loop
... } while (0);" construct gives the 'try/catch' effect with no overhead and permits easy cleanup/unwind code.
int _UpdateRecord(int argc, char **argv) {
int bTableUnlock = false;
int bRecordUnlock = false;
int rc = 0;
int rc1;
do {
if (argv != 3) {
rc = BAD_ARG_COUNT; break;
}
if (rc = TableLock(argv[0])) {
break;
}
bTableUnlock = true;
if (rc = RecordLock(atoi(argv[1])) {
break;
}
if (rc = RecordModify(argv[2])) {
break;
}
} while (0);
if (bRecordUnlock) {
if ((rc1 = RecordUnlock(atoi(argv[1]))) != 0 && !rc) {
rc = rc1;
}
}
if (bTableUnlock) {
if ((rc1 = TableUnlock(argv[0])) != 0 && !rc) {
rc = rc1;
}
}
if (bRecordUnlock) {
if ((rc1 = RecordUnlock(atoi(argv[1]))) != 0 && !rc) {
rc = rc1;
}
}
if (bRecordUnlock) {
if ((rc1 = RecordUnlock(atoi(argv[1]))) != 0 && !rc) {
rc = rc1;
}
}
return (rc);
}
The "do {
If C developers adhered to this type of approach with rigor, IMO we'd have a much better track record all told.
Explain - after surfing to BadBlue (an enterprise P2P package). Specifically P2P sharing of Excel and Word data. Lots of business applications I can imagine for this - mobile/wireless etc.
In addition, there is a white-paper on the site describing a P2P approach to B2B marketplaces. I think there a boatload of legitimate P2P applications.