| www.cortex.salk.edu | September 06, 2008 |
|
:: Style
:: Functions
AbortCSS() abs() acos() asin() atan() atan2() atof() atoi() atol() BLOCKclear_stats() BLOCKget_block_n() BLOCKget_cond_nu() BLOCKget_control() BLOCKget_max_val() BLOCKget_pct_cor() BLOCKget_stats() BLOCKset_control() BLOCKset_next() break_fixation_e() byte_c_out() byte_out() calloc() cart2r() cart2theta() cartesian2polar() ceil() chdir() chmod() chsize() ClearCSSGlobals() clear_eog() clip() clock() close() Cls() CLTactivate() CLTdownload() CLTget_val() CLTretrieve() CLTset_val() CLTupload() CMENUbool() CMENUboolRC() CMENUrun() collect_data() contact() cos() cosh() CurMov() DEVinp() DEVinpw() DEVoutp() DEVoutpw() display_eye_path() display_fixspot() display_histogra() display_play() display_sample() display_test() display_trial_pr() distance_to_line() dont_unload_cond() DrawBox() dsquared() dup() dup2() encode() end_trial() eof() EPPconvert() EPPget_chan() EPPunconvert() exp() EYEget_dva() EYE_WINcopy() EYE_WINreset() EYE_WINset() fabs() fclip() fclose() feof() ferror() fflush() fgetc() fgets() find_DC() find_slope() floor() fmax() fmin() fopen() foreback_wins() fprintf() fputc() fputs() fread() free() freespace() freopen() fscanf() fseek() ftell() fwrite() GactivateCLT() Gadd() Gadd_with_wait() Gcheck() GcolorABS() GcolorLUT() GcolorLUTsubset() GcolorREL() Gdel() GDPget_CLT() GDPset_CLT() GetAKey() getch() getCndsFileName() getcwd() getDataFileName() getenv() getExternsFileNa() getItemsFileName() gets() getTimeDateStrin() getTimingFileNam() get_a_input() get_bar_state() get_block_num() get_block_pct_co() get_CODEbuf() get_CODE_ISImax() get_CODE_ISIover() get_CODE_ISIsize() get_cond_num() get_cond_pct_cor() get_digital_inpu() get_EOGbuf() get_EOGdynamic_f() get_EOGfixwin_si() get_EOGfixwin_si() get_EOGgain() get_EOGmax() get_EOGnew_x() get_EOGnew_y() get_EOGoffset_x() get_EOGoffset_y() get_EOGoverflow() get_EOGsaccade() get_EOGsize() get_EPPbuf() get_EPPmax() get_EPPnew_x() get_EPPnew_y() get_EPPoverflow() get_EPPsize() get_eye_storage_() get_fixation_sta() get_ISIbuf() get_keep_current() get_kHz_resoluti() get_ms_reward_du() get_param() get_repeat_num() get_saccade_stat() get_TIMER100us_c() get_TIMERms_coun() get_trial_num() get_trial_type() Gflush() GmoveABS() GmoveABSorig() GmoveABSref() GmoveREL() Gmove_fixwin() Gmovie() Gmovie_one_time() Gmovie_step() Gon_off() Gpan() GpanABS() GpanREL() Gpriority() Gpurge() GRAPHICSclose() GRAPHICSdegenera() GRAPHICSdraw() GRAPHICSdraw_bac() GRAPHICSdraw_con() GRAPHICSgenerate() GRAPHICSopen() GRAPHICSread_col() GRAPHICSread_col() GRAPHICSset_colo() Gscroll() Gsweep() Gtransparancy() GwinSizeABS() GwinSizeREL() histogram_Ctik() histogram_tik() init_foreback() init_movie() init_pan() init_scroll() init_sweep() init_sweep_with_() init_toggle() inp() inpw() in_corridor() in_window() ITEM_POSbind_fix() ITEM_POSeye_delt() ITEM_POSeye_ishe() ITEM_POSeye_iswi() ITEM_POSget() ITEM_POSlut_inde() ITEM_POSmark_pos() KeyGet() KeyHit() KeyPressed() load_CLT() load_CLT_subset() log() log10() lseek() malloc() max() memchr() memcmp() memcpy() memmove() memset() MessageFloat() MessageInt() MessageLong() MessageString() min() mkdir() MouseMoved() MousePressed() move_eye_window() move_fixspot() move_sample() move_test() Mprintf() MS_TIMERcheck() MS_TIMERset() no_fixation() open() outp() outpw() pan_win() pan_wkstABS() pan_wkstREL() polar2cartesian() polar2x() polar2y() pow() printf() printxy() putchar() puts() put_eye_data_in_() rand() rand2() random() read() realloc() recent_block_sta() remove() rename() repeat_block_if_() repeat_cond_if_p() response_before_() response_correct() response_early() response_late() response_missing() response_no_bar_() response_wrong() reward() rmdir() run_movie() scanf() SCREENcalc_fixwi() SCREENdraw_box_o() SCREENdraw_entir() SCREENdraw_eye_p() SCREENdraw_fixwi() SCREENdraw_histo() SCREENdraw_raste() SCREENerase_hist() SCREENerase_rast() SCREENerase_rast() SCREENmode() SCREENshow_eye_p() SCREENupdate_eye() SCREENuser_displ() scroll_win() scroll_win_with_() send_termination() Serial_Close() Serial_Flush() Serial_Open() Serial_Print() Serial_Read() Serial_Ready() Serial_SetPortHa() Serial_Write() set_CLT_load_ind() set_CODEbuf() set_CODE_ISImax() set_CODE_ISIover() set_CODE_ISIsize() set_colorABS() set_colorREL() set_EOGbuf() set_EOGdynamic_f() set_EOGfixwin_si() set_EOGfixwin_si() set_EOGgain() set_EOGmax() set_EOGnew_x() set_EOGnew_y() set_EOGoffset_x() set_EOGoffset_y() set_EOGoverflow() set_EOGsaccade() set_EOGsize() set_EPPbuf() set_EPPmax() set_EPPnew_x() set_EPPnew_y() set_EPPoverflow() set_EPPsize() set_expected_res() set_fixwin_param() set_ISIbuf() set_keep_current() set_ms_reward_du() set_random_inter() set_random_timer() set_response() set_response_err() set_saccade_tole() set_timer() set_TIMER100us_c() set_TIMERms_coun() set_trial_type() sin() sinh() SMENUrun() SOUNDload() SOUNDplay() SOUNDprep() SOUNDstart() SOUNDstop() SOUNDvol() sprintf() sqrt() srand() srand2() sscanf() start_trial() strcat() strchr() strcmp() strcpy() strdup() strlen() strncat() strncmp() strncpy() strpbrk() strrchr() strspn() strstr() strtok() sweep_win() sweep_win_with_f() system() tan() tanh() tell() THREADadd() THREADdel() THREADrun() THREADstart_seqs() THREADstop_seqs() time() TIMERadd() TIMERaddCSSfn() TIMERaddINT() TIMERchange_rate() TIMERdel() TIMERget_count() TIMERget_ms_coun() TIMERpurge() TIMERstart_clock() TIMERstop_clock() timer_expired() toggle_wins() touch_item() update_histogram() write() _stricmp() | void AbortCSS ()
Purpose: AbortCSS() can be used to abort out of a trial from a timing file. It is the same function that is used internally in Cortex when some huge error occurs (like the stack overflows), or if the user presses CTRL-BREAK three times to kill the running trials. It stops the clock and cleans up a bit by resetting some of the internal flags. There is no reason to use this function in a timing file under normal circumstances. Instead, it makes more sense to restructure the timing file so that the trial ends normally. Cortex automatically cleans up the necessary flags between trials. Parameters: none Returns: none Platform: DOS and Windows intPlatform: DOS and Windows floatPlatform: DOS and Windows float asin (float value)
Purpose: find arc-sine Returns: the arc-sine of value. See also: acos(), atan(), atan2(), cos(), cosh(), sin(), sinh(), tan(), tanh() Platform: DOS and Windows float atan (float value)
Purpose: find arctangent Returns: the arc-tangent of value. See also: asin(), acos(), atan2(), cos(), cosh(), sin(), sinh(), tan(), tanh() Platform: DOS and Windows float atan2 (float y,
float
x)
Purpose: find arc-tangent of y/x Returns: the arc-tangent of y/x. Handles equation correctly even if x is equal to zero. See also: asin(), acos(), atan(), cos(), cosh(), sin(), sinh(), tan(), tanh() Platform: DOS and Windows float atof (pchar string)
Purpose: converts a string to a double Returns: a float value converted from the string. Platform: DOS and Windows int atoi (pchar string)
Purpose: converts a string to an integer Returns: an integer value converted from the string. Platform: DOS and Windows long atol (pchar string)
Purpose: converts a string to a long Returns: a long value converted from the string. Platform: DOS and Windows int BLOCKclear_stats(int block_or_condition, int which_one);
Purpose: clears the percent correct and circular buffer tables for a given block or condition. Returns: 1 if valid block or condition number was made, 0 if not.
Platform: DOS and Windows int BLOCKget_block_num()
Purpose: Gets current block number Parameters: none Returns: current block number See also: BLOCKget_cond_num(), BLOCKset_next(), get_block_num(), get_cond_num() Platform: DOS and Windows int BLOCKget_cond_num()
Purpose: Gets current condition number Parameters: none Returns: current condition number See also: BLOCKget_block_num(), BLOCKset_next(), get_block_num(), get_cond_num() Platform: DOS and Windows int BLOCKget_control_info (int block, pfloat minPctOK, pint minTrials, pint recentOK, pint recentDone, pint max_errors, pint max_retries, pint recentOKtooLow, pfloat PctOKtooLow) Purpose: Gets the current values of these various variables for staircase design. At the end of each trial, these variables are used to check to see if the current block should be considered either unfinished (ie. may need to run some more depending on the parameters set in the Run:Parameters:Block/Repeat family of menus), correct (ie. finished and not to be run again), or aborted (not to be run again because the subject made too many mistakes). These are the exact names of the variables as shown in the Run:Parameters:Block/Repeat:Individual Blocks menu (with the menu length set to "full"). A value of zero for any one of these variables means that it is currently not being tested at the end of the trial. Parameters:
Returns: 1 if valid block is specified, 0 if not See also: BLOCKset_control_info() Platform: DOS and Windows int BLOCKget_max_vals
(pint max_cond)
Purpose: Gets max_block and max_cond values. This could have been done via an external variable, but if these values were inadvertently changed, the system would crash. Parameters: pint max_cond Returns: the current maximum block values See also: BLOCKset_next() Platform: DOS and Windows float BLOCKget_pct_correct
(int block_or_condition, int which_one)
Purpose: Gets percent correct information for a given block or condition. Parameters:
Returns: the percent correct information for a given block or condition, or -1 if unsuccessful. See also: BLOCKclear_stats(), BLOCKget_stats(), get_block_pct_correct(), get_cond_pct_correct() Platform: DOS and Windows int BLOCKget_stats
(int
block_or_condition, int which_one, pint num_correct,
pint num_trials, ppchar circular_buffer)
Purpose: gets the circular buffer, number of correct trials, and the number of total trials for a given block condition. Parameters:
Returns: a non zero value if valid selection is made, 0 if pointers are not yet set See also: BLOCKclear_stats(), BLOCKget_pct_correct(), get_block_pct_correct(), get_cond_pct_correct() Platform: DOS and Windows int BLOCKset_control_info (int block, float minPctOK, int minTrials, int recentOK, int recentDone, int max_errors, int max_retries, int recentOKtooLow, float PctOKtooLow) Purpose: sets the current values of these various variables for staircase design. At the end of each trial, these variables are used to check to see if the current block should be considered either unfinished (ie. may need to run some more depending on the parameters set in the Run:Parameters:Block/Repeat family of menus), correct (ie. finished and not to be run again), or aborted (not to be run again because the subject made too many mistakes). These are the exact names of the variables as shown in the Run:Parameters:Block/Repeat:Individual Blocks menu (with the menu length set to "full"). A value of zero for any one of these variables means that it is currently not being tested at the end of the trial. Parameters:
Returns: 1 if valid block is specified, 0 if not See also: BLOCKget_control_info() Platform: DOS and Windows int BLOCKset_next (int
block,
int condition)
Purpose: sets the block and condition to be run in the next trial Parameters:
Returns: 1 if successful, 0 if not. See also: break_fixation_error() Platform: DOS and Windows void break_fixation_error()
Purpose: Records in the data file that the monkey has broken fixation Parameters: none Returns: nothing Platform: DOS and Windows void byte_c_out (int byte) Purpose: Write the given byte to Port C of the PIO24 board. (Note that thisfunction will not work for the PIO24 portion of the CIO-DAS1602/12 or the PCI-DAS1602/12 boards. For those boards, please use the DEVoutp() function.) Parameters: byte - a single byte (8 bits) of data Returns: nothing Platform: DOS and Windows void byte_out (int byte) Purpose: Write the given byte to Port C of the PIO24 board. (Note that thisfunction will not work for the PIO24 portion of the CIO-DAS1602/12 or the PCI-DAS1602/12 boards. For those boards, please use the DEVoutp() function.) Parameters: byte - a single byte (8 bits) of data Returns: nothing Platform: DOS and Windows pchar calloc (int num_elements,
int bytes_per_element)
Purpose: allocates an array in memory with elements initialized to 0. Parameters:
Returns: a pointer to the first element in the array. See also: free(), malloc(), realloc() Platform: DOS and Windows float cart2r (float x, floaty) Purpose: A Cartesian to polar transform which computes the magnitude (rho) value for the given x, y cartesian coordinates. Parameters: x and y are the Cartesian cooridinates. Returns: the magnitude. Platform: DOS and Windows float cart2theta (float x, float y) Purpose: A Cartesian to polar transform which computes the phase angle theta (in degrees) for a given x, y coordinate. Parameters: x, y are the Cartesian coordinates Returns: The phase angle theta polar value. Platform: DOS and Windows void cartesian2polar (float x, float y, pfloat r, pfloat theta)
Purpose: A Cartesian to polar transform which computes the phase angle theta (in degrees) and the magnitude r, for a given x, y coordinate. Parameters:
Platform: DOS and Windows int ceil (float value)
Purpose: Calculates the ceiling of a value. Retuns: the smallest integer that is greater than or equal to value. See also: floor() Platform: DOS and Windows int chdir (pchar new_dir_name)
Purpose: changes the current working directory to new_dir_name Returns: 0 if successful. See also: getcwd(), mkdir(), rename(), rmdir() Platform: DOS and Windows int chmod (const char *filename, int pmode)
Purpose: Change the file-permission settings. The _chmod function changes the permission setting of the file specified by filename. The permission setting controls read and write access to the file. Parameters:
Platform: DOS and Windows int chsize (int handle, long size) Purpose: Changes the file size. Parameters:
Platform: DOS and Windows void ClearCSSGlobals () Purpose: Clears all the external variables that can be set by the user. Parameters: none Returns: nothing Platform: DOS and Windows void clear_eog() Purpose: clear the eog display window Parameters: none Returns: nothing Platform: DOS and Windows int clip (int value, int
lower_limit,
int upper_limit)
Purpose: clip the range of an integer Parameters:
a = clip (a,100,500);
See also: fclip() Platform: DOS and Windows long clock() Purpose: Calculates the processor time used by the calling process. Parameters: none Returns: clock returns the number of clock ticks of elapsed processor time. The returned value is the product of the amount of time that has elapsed since the start of a process and the value of the CLOCKS_PER_SEC constant. Comments: The clock function tells how much processor time the calling process has used. The time in seconds is approximated by dividing the clock return value by the value of the CLOCKS_PER_SEC constant In Microsoft and Watcom C/C++, the value of CLOCKS_PER_SEC is 1000. Note: In MS-DOS, clock() returns the time elapsed since the process started. This may not be equal to the actual processor time used by the process. Platform: DOS and Windows int close (int handle)
Purpose: closes the file indicated by handle Returns: 0 if successful. See also: dup(), dup2(), open() Platform: DOS and Windows void Cls ()
Purpose: clears the screen to black and resets the cursor position to the top left corner (0, 0). Works in text mode only (SCREENmode(1)). Parameters: none Returns: nothing See also: SCREENmode() Platform: DOS and Windows int CLTactivate (int num_entries, int CLTnum, int src_start, int dst_start)
Purpose: Transfer color data from temporary to active CLTs (color lookup tables). The graphics board only has one color palette in use at a time (i.e., the active CLT). To optimize the speed of lookup table operations, any other temporary color palettes must reside in system memory. When this function call is executed, the given temporary CLT is activated on the graphics board. Parameters:
int CLTdownload (int CLTnum, int CLTstart_idx, int num_entries, pchar data)
Purpose: Copies color data from the given color lookup table (CLT), into the data variable. Parameters:
int CLTget_val (int CLTnum, int index, int *r, int *g, int *b)
Purpose: Gets the R, G, B values for a single entry of a given color lookup table (CLT). Parameters:
Returns: 1 if successful, otherwise 0. Platform: DOS and Windows int CLTretrieve (int num_entries, int CLTnum, int src_start, int dst_start)
Purpose: This function transfers data from the graphics board's active palette to a temporary CLT in system memory. When using two computers, this is faster than GDPget_CLTS and CLTupload() to set the values in a palette. Also more convenient for CSS, which doesn't support structures, although it is equally possible to use GDPget_CLTs and know that each element is a byte, and that they are in RGB order. Parameters:
Returns: 1 if successful, otherwise 0. Platform: DOS and Windows int CLTset_val (int CLTnum, int index, int r, int g, int b)
Purpose: Sets the R, G, B values for a single entry of a give color lookup table (CLT). Parameters:
Returns: 1 if successful, otherwise 0. Platform: DOS and Windows int CLTupload (int CLTnum, int CLTstart_idx, int num_entries, pchar data)
Purpose: Copies color data from the data structure into the given color lookup table (CLT). Parameters:
int CMENUbool (char *msg)
Purpose: Prints the msg string on the screen, then waits for the user's response. The msg string is usually a question requiring a Yes/No answer. Parameters: msg, the string to be printed on the screen Returns: 1 if the user responds "Yes", 0 if the user responds "No", and -1 if ESCAPE is pressed. Platform: DOS only int CMENUboolRC (char *msg, char *choices)
Purpose: Prints the msg string on the screen, then waits for the user's response. The msg string is a question that requires an answer which is one of the choices provided. Parameters:
Returns: 1 if a new value has been set, 0 if no change, and -1 if ESCAPE pressed. Platform: DOS only int CMENUrun (char *message, int y, int *val, int num_choices, char *choices[])
Purpose: Prints the message string on the screen, at location (1, y), and then waits for the user\\\'s response. The message string is a question that requires an answer that is one of the choices provided. Parameters:
Returns: 1 if a new value has been set, 0 if no change, and -1 if ESCAPE pressed. Platform: DOS only void collect_data (int
on_off)
Purpose: instructs CORTEX to either begin or stop collecting spike data to place in the data file. Parameter: BOOL (0 = stop collecting data; 1 = collect data) Returns: nothing Platform: DOS and Windows int contact (int cirx,
int ciry, int cir_radius, int ulx, int uly,
int lrx, int lry)
Purpose: identifies when a circle and a rectangular object overlap each other Parameters:
Returns: 1 if circle and rectangle overlap, 0 if no overlap. Platform: DOS and Windows float cos (float value)
Purpose: find the cosine of a float Returns: the cosine of value. See also: acos(), asin(), atan(), atan2(), cosh(), sin(), sinh(), tan(), tanh() Platform: DOS and Windows float cosh (float value)
Purpose: find the hyperbolic cosine of a float Returns: the hyperbolic cosine of value. See also: acos(), asin(), atan(), atan2(), cos(), sin(), sinh(), tan(), tanh() Platform: DOS and Windows void CurMov (int row,
int column)
Purpose: sets the current text position to the display point (row, column). This call works in text mode only. Returns: nothing See also: SCREENmode(), printxy(), printf() Platform: DOS and Windows int DEVinp (int device_number,
int port)
Purpose: Reads a byte from the given port and deive_number. Parameters:
Returns: a single byte read from port (a part of device_number). Comments: Each device listed in the CORTEX.CFG file has a corresponding device_number. The first device listed is device number zero. The nth device is device number n-1. Ports are numbered much the same way (base-0). The first parallel port on a parallel device will be port number 0, and the nth will be port number n-1 (Port A = port 0). See also: DEVinpw(), DEVoutp(), DEVoutpw() Platform: DOS and Windows int DEVinpw (int device_number,
int port)
Purpose: Reads two bytes from the given port and device_number Parameters:
Comments Each device listed in the CORTEX.CFG file has a corresponding device_number. The first device listed is device number zero. The nth device is device number n-1. Ports are numbered much the same way (base-0). The first parallel port on a parallel device will be port number 0, and the nth will be port number n-1 (Port A = port 0). See also: DEVinp(), DEVoutp(), DEVoutpw() Platform: DOS and Windows int DEVoutp (int device_number,
int port, int data)
Purpose: outputs a single byte of data on port (a part of device_number), the data sent if successful, else returns -1 Parameters:
See also: DEVinp(), DEVinpw(), DEVoutpw() Backward Compatibility: byte_out() Platform: DOS and Windows int DEVoutpw (int device_number,
int port, int data)
Purpose: Writes two bytes of data to the given port and device_number. Parameters:
Returns: outputs two bytes of data on port (a port of device_number). Returns the data sent if successful, else returns -1. Comments: Each device listed in the CORTEX.CFG file has a corresponding device_number. The first device listed is device number zero. The nth device is device number n-1. Ports are numbered much the same way (base-0). The first parallel port on a parallel device will be port number 0, and the nth will be port number n-1 (Port A = port 0). See also: DEVinp(), DEVoutpw(), DEVoutp() Platform: DOS and Windows void display_eye_path (int visible)
Purpose: show/unshow the path of the eye movement up to a given point in a trial. display_eye_path(1) will draw the eye path, and display_eye_path(0) will erase it. Parameters: visible or invisible (1 = visible, 0 = invisible) Returns: nothing See also: put_data_in_eye_buf() Backward Compatibility: display_eye_buf() Platform: DOS and Windows void display_fixspot (int visible)
Purpose: turns on or off the fixation spot, turns on (visible=1) or off (visible=0) the fixation spot Parameters: visible or invisible (1 = visible, 0 = invisible) Returns: nothing See also: display_test(), Gon_off() Platform: DOS and Windows void display_histogram ()
Purpose: causes the histogram for the current condition to be displayed (typically called at the start of the trial) Parameters: none Returns: nothing See also: display_trial_progress(), update_histogram() Platform: DOS and Windows void display_play (int visible)
Purpose: turns on (visible=1) or off (visible=0) the mapping stimulus in play mode Parameters: visible or invisible (1 = visible, 0 = invisible) Returns: nothing See also: display_test(), Gon_off() Platform: DOS and Windows void display_sample (int visible)
Purpose: turns on (visible=1) or off (visible=0) the sample stimulus (the sample stimulus is defined as the item(s) in TEST0 of the current conditions file) Parameters: visible or invisible (1 = visible, 2 = invisible) Returns: nothing See also: display_test(), Gon_off() Platform: DOS and Windows void display_test (int test_screen, int visible)
Purpose: turns on (visible=1) or off (visible=0) a specified test_screen (TEST1 through TEST9) Parameters:
Returns: nothing See also: display_fixspot(), display_play(), display_sample(), Gon_off() Platform: DOS and Windows void display_trial_progress (int show_progress)
Purpose: turns on (show_progress=1) or off (show_progress=0) the current trial's raster (the progress line) below the histogram display. Also turns on or off the placement of data into the cumulative on-line histogram. Has no effect on the raw data collection. The function is normally turned off while waiting either a random amount of time or waiting for the subject to do something. Parameters: 0 = turn progress line off, 1 = turn it on Returns: nothing See also: display_histogram(), update_histogram() Platform: DOS and Windows float distance_to_line (float x, float y, float slope, float DC)
Purpose: Finds the minimum distance between a line and a point. This function is generally used to determine the amount of error the subject has made during a saccade towards a target (that lies on a line of slope from the origin). Parameters:
Returns: the minimum distance between a line of slope passing through the origin (the center of the screen; 0 degrees, 0 degrees) and a point defined by (x degrees, y degrees). See also: EYEget_dva(), find_DC(), find_slope(), in_corridor() Platform: DOS and Windows void dont_unload_conds (void)
Purpose: To prevent the program from unloading the current condition's worth of graphics information and to prevent the next set from being loaded. Parameters: none. Returns: nothing. Comments: This function may decrease the time needed between trials (especially if the stimuli are complex), but should only be used when every trial uses the same set of graphical items and every condition uses the same items in each test_screen. The dont_unload_conds flag is reset every trial, so this routine must be called every trial if you want the same graphical environment to persist over many trials. Also, if this called on the LAST trial of a run, the graphical environment will persist into the next run (unless you set the option in the Run:Parameters:General menu or quit CORTEX in between runs). Platform: DOS and Windows void DrawBox (float X_center, float Y_center, float width, float height, int color)
Purpose: draws onto the EOG_DISPLAY a box centered at (X_center, Y_center), of width width, height height and color color (#include css_inc.h in your state function to use its list of colors) Parameters:
Returns: nothing. See also: ITEM_POSmark_pos() Backward Compatibility: mark_screen_pos() Platform: DOS and Windows long dsquared (int x1, int y1, int x2, int y2)
Purpose: Finds the square of the distance between two points, (x1, y1) and (x2, y2). Parameters:
int dup (int handle)
Purpose: creates a second file handle for a currently open file. Parameters: Takes the handle of the currently open file. Returns: the new file handle See also: close(), dup2(), open() Platform: DOS and Windows int dup2 (int handle_1, int handle_2)
Purpose: forces handle_2 to refer to a currently open file (referred to by handle_1) Parameters:
Returns: 0 if successful. See also: close(), dup(), open() Platform: DOS and Windows void encode (int EVENT_CODE)
Purpose: Records an event code in the cortex data file Parameters: event code Returns: nothing See also: EVENT_CODE Platform: DOS and Windows void end_trial ()
Purpose: cleans up after the trial and turns off the mapping stimulus in play mode Parameters: none Returns: nothing Platform: DOS and Windows int eof (int handle)
Purpose: checks if the current position within the file referred to by handle is end_of_file Returns: 1 if currently at end_of_file, 0 if not Platform: DOS and Windows int EPPconvert (int x, int chan)
Purpose: takes a 12-bit, signed integer value, x, and a channel number, chan, and converts them to the format which the EPP buffer expects. Parameters:
Returns: a 16-bit value (short integer) containing the 12-bit data value, and 4-bits for the channel number Platform: DOS and Windows int EPPget_chan (int x)
Purpose: Takes the 16-bit EPP value, x, and returns the 4-bit channel number from it. Parameters: x, a 16-bit value containg the 12-bit data value and the 4-bit channel number Returns: the channel number Platform: DOS and Windows int EPPunconvert (int x)
Purpose: Extracts the 12-bit integer data value from the EPP buffer storage format. Parameters: x, a 16-bit value containg the 12-bit data value and the 4-bit channel number Returns: the data value Platform: DOS and Windows void EYEget_dva (pfloat
X,
pfloat Y)
gets the eye position in degrees of visual angle (dva) Purpose: gets the eye position in degrees of visual angle (dva) Parameters:
Returns: nothing Backward Compatibility: f_get_X(), f_get_Y(), get_fixation_posX(), get_fixation_posY() Platform: DOS and Windows void EYE_WINcopy (int eye_window_number, int test_screen, int item_position)
Purpose: copies one ITEM_POS or EYE_WIN's center and size into a new EYE_WIN. Values remain until CORTEX is exited or EYE_WINreset() called. Parameters:
Returns: nothing See also: EYE_WINreset(), EYE_WINset() Platform: DOS and Windows void EYE_WINreset ()
Purpose: clears all of the saved EYE_WINs from the EYE_WIN scratch buffer. Otherwise they remain until CORTEX is exited. Parameters: none Returns: nothing See also: EYE_WINcopy(), EYE_WINset() Platform: DOS and Windows void EYE_WINset (int
eye_window_number,float
x_center,float
y_center,float
x_size,float
y_size)
Purpose: stores a position (center and size) for future reference. Parameters:
Returns: 1 if successful, 0 if an invalid selection Comments: Values remain until CORTEX is exited or EYE_WINreset() is called. See also: EYE_WINcopy(), EYE_WINreset() Backward Compatibility: set_position() Platform: DOS and Windows float fabs (float value)
Returns: the absolute value of value See also: abs() Platform: DOS and Windows float fclip (float value,
float lower_limit, float upper_limit)
Purpose: clips the range of a floating point value. Parameters:
Returns: either the original value, the lower limit, or the upper limit. Example: a = clip (a,100.3,500.1); See also: clip() Platform: DOS and Windows int fclose (plong fp)
Purpose: closes the open file handle fp. Parameter: fp - pointer to file Returns: 0 if the file is successfully closed, and non-zero to indicate an error. Platform: DOS and Windows int feof (plong fp)
Purpose: determines whether the end-of-file has been reached for the file pointed to by fp. Parameter: fp - pointer to file Returns: a nonzero value after the first read operation that attempts to read past the end of the file. It returns 0 if the current position is not end of file. Platform: DOS and Windows int ferror (plong fp)
Purpose: tests for a reading or writing error on the file associated with fp. Parameter: fp - pointer to file Returns: If no error has occurred on the file, ferror returns 0. Otherwise, it returns a nonzero value. Platform: DOS and Windows int fflush (plong fp)
Purpose: flushes a stream. If the file associated with the stream is open for output, fflush causes any unwritten data to be written to the file. If the file fp is open for input or update, the fflush function undoes the effect of any preceding ungetc operation on the stream. If the value of fp is NULL, then all files that are open will be flushed. Parameter: fp - pointer to file Returns: fflush returns 0 if the buffer was successfully flushed. A non-zero return value indicates an error. Platform: DOS and Windows int fgetc (plong fp)
Purpose: gets the next character from the file designated by fp. Parameter: fp - pointer to file Returns: the character read as an int or return EOF to indicate an error or end of file. Platform: DOS and Windows pchar fgets(pchar buf, int n, plong fp)
Purpose: gets a string of characters from the file designated by fp and stores them in the array pointed to by buf. The fgets function stops reading characters when end-of-file is reached, or when a newline character is read, or when n-1 characters have been read, whichever comes first. Parameters:
Returns: returns buf if successful, otherwise 0. Platform: DOS and Windows float find_DC (float
target_x,
float target_y)
Purpose: finds denominator constant for distance calculation. This is the denominator constant (DC) of a line that stretches between the origin and a point in the visual field of coordinates (target_x, target_y). Using DC removes the need for costly computations of sin or cosine in trigonometric calculations, thus speeding up functions such as in_corridor() and distance_to_line() that require DC as input. Parameters: targetx, targety - point in the visual field Returns: 1.0 / sqrt(1.0 + (target_y / target_x)*( target_y / target_x)), i.e., 1/(1+slope^2) See also: distance_to_line(), find_slope(), in_corridor() Platform: DOS and Windows float find_slope (float
target_x,
float target_y)
Purpose: find slope of a line formed from the point (target_x, target_y) and the origin (0,0). Parameters: targetx, targety - point in the visual field Returns: the slope (target_y / target_x) of a line stretched between the origin and point (target_x, target_y). See also: distance_to_line(), find_DC(), in_corridor() Platform: DOS and Windows float floor (float value)
Purpose: computes the largest integer not greater than value. Parameter: value - floating-point value to be manipulated Returns: a floating-point value representing the largest integer that is less than or equal to value. Platform: DOS and Windows float fmax (float value_1, float value_2)
Returns: the maximum of two floating point values See also: fmin(), max(), min() Platform: DOS and Windows float fmin (float value_1,
float value_2)
Returns: the minimum of two floating point values See also: fmax(), max(), min() Platform: DOS and Windows plong fopen( pchar filename, pchar mode)
Purpose: opens the file specified by filename. Parameters:
Returns: a pointer to the open file. A null pointer value indicates an error. Platform: DOS and Windows int foreback_wins (int fore_test_screen, int fore_speed, int fore_direction, int back_test_screen,
int back_speed, int back_direction)
Purpose: to execute simultaneous motion of two test_screens. This function has largely been replaced by Gscroll(). Parameters:
Returns: time remaining (in msec). Returns 0 when done, and turns off both test_screens, waiting until they are actually off before returning. NOTE: init_foreback() must be called prior to this function. See also: init_foreback() Platform: DOS and Windows int fprintf ( plong fp, pchar format)
Purpose: writes output to the file pointed to by fp under control of the argument format. The format string has the same syntax and use as in printf(). Parameters:
Returns: the number of bytes written. Otherwise, returns a negative value if an output error occurs. Platform: DOS and Windows int fputc (int c, plong fp)
Purpose: writes the character specified by c to the output stream designated by fp. Parameters:
Returns: the character written; or, if a write error occurs, returns EOF. Platform: DOS and Windows int fputs (pchar buf, plong fp)
Purpose: writes the character string pointed to by buf to the output stream designated by fp. Parameters:
Returns: returns EOF if an error occurs otherwise, it returns a non-negative value. Platform: DOS and Windows int fread (pchar buffer, int size, int count, plong fp)
Purpose: reads count elements of size bytes each from the file specified by fp into the buffer specified by buffer. Parameters:
Returns: the number of complete elements actually read, which may be less than count if an error occurs or if the end of the file is encountered before reaching count. Platform: DOS and Windows void free (pchar memory_block)
Purpose: frees (un-allocates) the currently allocated memory pointed to by memory_block. Be careful to be sure that the pointer you are freeing is the correct pointer. A misspelling with this function can crash the system or worse. Parameter: memory_block - previously allocated memory block to be freed Returns: nothing See also: calloc(), malloc(), realloc() Platform: DOS and Windows float freespace (void)
Purpose: calculates the amount of freespace in kilobytes, on the drive containing the Cortex data file. Parameters: none Returns: the amount of free space in kilobytes. Platform: DOS and Windows plong freopen (pchar filename, pchar mode, plong fp)
Purpose: closes the file currently associated with fp. Then, it opens the file named filename and associates this new file with fp. Parameters:
Returns: a pointer to the newly opened file. If an error occurs, the original file is closed and the function returns a NULL pointer value. Platform: DOS and Windows int fscanf (plong fp, pchar msg)
Purpose: scans input from the file designated by fp under control of the argument format. Parameters:
Returns: the number of input arguments for which values were successfully scanned and stored. Otherwise, returns EOF when the scanning is terminated by reaching the end of the input stream. Platform: DOS and Windows int fseek (plong fp, long offset, int where)
Purpose: changes the read/write position of the file specified by fp. The argument offset is the position to seek to relative to one of three positions specified by the argument where. Parameters:
Returns: 0 if successful, otherwise non-zero. Platform: DOS and Windows long ftell (plong fp)
Purpose: returns the current read/write position of the file specified by fp. Parameters: fp - pointer to file Returns: returns the current read/write position of the file if successful; otherwise, it returns -1 on error. Platform: DOS and Windows int fwrite (pchar buffer, int size, int count, plong fp)
Purpose: writes count elements of size bytes each to the file specified by fp. Parameters:
Returns: the number of complete elements successfully written. This value will be less than the requested number of elements only if a write error occurs. Platform: DOS and Windows pchar GactivateCLT (int num_entries, int CLTsource, int src_start, int dst_start)
Purpose: Delayed (Gflush()able) version for changing a set of colors. Transfers the colors from a temporary CLT to the active CLT. Parameters:
Returns: pointer to thread added. Can be passed to Gcheck() or Gdel(). Platform: DOS and Windows pchar Gadd (int test_screen/index, int operation, int repetitions, float arg1, float arg2, int arg3)
Purpose: General interface to graphics kernel. All of the other kernel functions are converted into Gadd() calls. Basically, Gadd() is the mother of all graphics kernel functions. Must be followed by Gflush(). Parameters:
Returns: pointer to the thread allocated by Gadd() See Also: Gadd_with_wait(), Gcheck(), Gdel(), Gflush(), Gpurge() Platform: DOS and Windows pchar Gadd_with_wait
(int test_screen/index, int operation, int repetitions,
float arg1, float arg2, int wait_frames)
Purpose: General interface to graphics kernel. This is the same as Gadd(), except that it will wait a specified number of Gflush() calls before executing. Thus, if the user calls Gflush() every screen refresh (to enact real-time animation or movies, for instance), the Gadd_with_wait() operation will be performed in wait_frames screen refreshes. This call is helpful when the user would like to start and end a graphical operation at a variable random times and does not wish to keep track of how much time has passed between the start and end of the operation. Must be followed by Gflush(). Parameters:
Returns: pointer to the thread allocated by Gadd_with_wait() See also: Gadd(), Gcheck(), Gdel(), Gflush(), Gpurge() Platform: DOS and Windows long Gcheck (pchar active_thread)
Purpose: Returns the time remaining on a Gadd() thread in milliseconds. Parameters:
Returns: the time remaining for a graphical operation to run (in milliseconds). The value active_thread is the value returned by many of the New Graphical Routines (the ones that are not instantaneous in duration) and it allows Gcheck() to trace the operation's remaining time on the queue. See also: Gadd() Platform: DOS and Windows void GcolorABS (int index,
int red, int green, int blue);
sets the color of one index within the current lookup table. To find out which index of the LUT contains the color information for a certain item, call ITEM_POSlut_index(). Must be followed by Gflush().
Platform: DOS and Windows void GcolorLUT (int index)
Purpose: Delayed (Gflush()able) version for changing a set of colors. Transfers the entire palette of colors (i.e., 256 colors) from a temporary CLT to the active CLT. Parameters:
Returns: pointer to thread added. Can be passed to Gcheck() or Gdel(). Platform: DOS and Windows pchar GcolorLUTsubset (int num_entries, int CLTsource, int src_start, int dst_start)
Purpose: Delayed (Gflush()able) version for changing a set of colors. Transfers the colors from a temporary CLT to the active CLT. Parameters:
Returns: pointer to thread added. Can be passed to Gcheck() or Gdel(). Platform: DOS and Windows void GcolorREL (int index,
int red, int green, int blue)
Purpose: resets the color of an item one color lookup table index at a time by changing a single value within a color lookup table. Adds the values added_red, added_green, and added_blue to the current values for that entry in the color lookup table. Parameters:
Returns: pointer to thread added. Can be passed to Gcheck() or Gdel(). See also: GcolorABS(), GcolorLUT(), ITEM_POSlut_index(), load_CLT(), set_CLT_load_index(), set_colorABS(), set_colorREL() Platform: DOS and Windows void Gdel (pchar active_thread)
Purpose: removes a graphical operation that has been added to the stack by one of the New Graphics Routines. Only needed if the graphical operation has a duration that is non-instantaneous. Parameters:
Returns: the number of threads deleted. Note that this can be dangerous if it isn't currently part of the structure, so descend that structure instead of just using next/previous pointers Platform: DOS and Windows pchar GDPget_CLT (int num_colors, int bstart_index, pchar colors)
Purpose: gets the values of the active color lookup table (CLT) which is in use by graphics board Parameters:
typedef struct { Platform: DOS and Windows void GDPset_CLT (int num_colors, int start_index, pchar colors)
Purpose: sets the values of the active color lookup table (CLT) which is in use by graphics board Parameters:
typedef struct { Platform: DOS and Windows int GetAKey ()
Purpose: waits for and returns a key press. Parameters: none Returns: casting as (char) will provide the key that was pressed, and the high byte contains special attributes (such as SHIFT or CTRL). Or, one can compare directly with the #defines in css_inc.h (be sure to #include "css_inc.h"). Internally, this function is the same as KeyGet(). See Also: KeyGet() Platform: DOS and Windows int getch()
Purpose: Get a character from the console without echo Parameters: none See also: gets() Platform: DOS only void getCndsFileName(pchar filename)
Purpose: This function will return the name of the Cortex conditions file through a parameter. The timing file must allocate space for the file name. Parameters: pointer to a string that will hold the filename Returns: nothing. Platform: Windows only | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||