int __cdecl main(int argc, char *argv[]) { const char szFileName[] = {"testfile.txt"}; long lPos = -1; int i; char szTempBuffer[256]; struct TESTS testCase[] = { {0, SEEK_SET, 0}, {10, SEEK_CUR, 10}, {-5, SEEK_CUR, 5}, {-2, SEEK_END, 50} }; if (0 != PAL_Initialize(argc,argv)) { return FAIL; } memset(szTempBuffer, 0, 256); /* open the test file */ pFile = fopen(szFileName, "r"); if (pFile == NULL) { Fail("ftell: ERROR -> fopen failed to open the file \"%s\".\n"); } /* loop through the test cases */ for (i = 0; i < (sizeof(testCase)/sizeof(struct TESTS)); i++) { if (MovePointer(testCase[i].lDist, testCase[i].nFrom) != TRUE) { Fail(""); } else if (Validate(testCase[i].lPosition) != TRUE) { Fail(""); } } if (fclose(pFile) != 0) { Fail("ftell: ERROR -> fclose failed to close the file.\n"); } /* lets just see if we can find out where we are in a closed stream... */ if ((lPos = ftell(pFile)) != -1) { Fail("ftell: ERROR -> ftell returned a valid position (%ld) on a " "closed file handle\n", lPos); } PAL_Terminate(); return PASS; }
gboolean XButtonUp( GtkWidget *wid, GdkEventButton *event, gpointer data) { if(((XWidget*)data)->event.Up.pChar>-1) MovePointer(((XWidget*)data)->event.Up); }
gboolean XButtonLeave( GtkWidget *wid, GdkEventButton *event, gpointer data) { if(((XWidget*)data)->event.Leave.pChar>-1) MovePointer(((XWidget*)data)->event.Leave); }
gboolean XButtonPress( GtkWidget *wid, GdkEventButton *event, gpointer data) { if(((XWidget*)data)->event.Press.pChar>-1) MovePointer(((XWidget*)data)->event.Press); }
gboolean XButtonClick( GtkWidget *wid, gpointer data) { if(((XWidget*)data)->event.Click.pChar>-1) MovePointer(((XWidget*)data)->event.Click); }
void XCheckBoxToogle( GtkWidget *wid, gpointer data) { if(((XWidget*)data)->event.Click.pChar>-1) MovePointer(((XWidget*)data)->event.Click); }
void XWindowClick(GtkWidget *wid, gpointer data) { XWidget *w=(XWidget*)data; MovePointer(w->event.Click); }