fileselect.c File Reference

#include <gtk/gtk.h>
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

Go to the source code of this file.

Defines

#define CHAR_BUF   2000

Functions

void get_iter_at_cursor ()
 get mark, then markname and then get iterator at that markname Get the line number from iterator Then get the corresponding line from errorFile
void get_Line_At_Cursor (int lno)
 The following function is used to highlight the errors in the program.
void getError ()
 The function returns the errors in the program and calls getLine() to get the lines highlighted.
static char * getFileName ()
 The functions helps us getting name of the function executing.
void getLine (int no, int flag)
 Have the line no where error occured so go that line in mainfile and retrive the iterators to highlight the line.
void getLine_error (int no, int flag)
 This function highlights the errors in the program when clicked in the error-window.
void gtk_text_view_notify_cursor_position (GtkTextBuffer *buffer, GtkWidget *v)
 This function is event handler triggered when the cursor position is changed.
void highlight_comments ()
 This function would be invoked when the user loads an application and is used to highlight the quotes and comments in the program.
void highlight_digits ()
 This function would be invoked when the user loads an application and is used to highlight the numbers in the program.
void highlight_include ()
 This function would be invoked when the user loads an application and is used to highlight the header files and macros in the c program.
void highlight_keywords ()
 This function would be invoked when the user loads an application and is used to highlight the keywords in the program.
static void load_file (char *fname)
 The following function is used to LOAD THE FILE IN UTF-8 format into a file selection dialog.
void parseFilename (char *text)
 This function would be invoked to parse the path name to retrieve the filename.
static gboolean save_file (char *fname)
 The function save_file would save the file in to the directory.
static gboolean save_if_modified (void)
 This function is used to prompt the user to save if the buffer is modified whenever he quits the application or loads a new file.
void submit_clicked (GtkWidget *widget, gpointer gdata)
 The following function is triggered when the user clicks on the gcc button used to compile the file selected by the user and display the errors.
void Syntax_highlight ()
 This function is for the syntax highlighting this in turn calls the functions for highlighting digits, keywords, macros, comments.

Variables

GtkTextBuffer * buf
 variables indicating the GtkTextBuffers
GtkTextBuffer * buf1
GtkTextBuffer * buf2
GtkWidget * entry
 These give entry text.
gchar * entry_text = " "
int errno
 These variables give us the status, error filenames when loaded.
char f_name [300]
char file_name [300]
char * filename
char * Fname
 variables indicating the file name
char fname1 [300]
char LoadFile [300]
int status
GtkWidget * view
 These give us text view widgets where all the typing is done.
GtkWidget * view2
GtkWidget * window
 This creates main window.


Define Documentation

#define CHAR_BUF   2000

Definition at line 5 of file fileselect.c.

Referenced by load_file(), save_file(), and submit_clicked().


Function Documentation

void get_iter_at_cursor (  ) 

get mark, then markname and then get iterator at that markname Get the line number from iterator Then get the corresponding line from errorFile

Definition at line 1070 of file fileselect.c.

References buf2, get_Line_At_Cursor(), and getLine_error().

Referenced by gtk_text_view_notify_cursor_position().

void get_Line_At_Cursor ( int  lno  ) 

The following function is used to highlight the errors in the program.

Definition at line 1010 of file fileselect.c.

References buf, f_name, file_name, filename, and getLine().

Referenced by get_iter_at_cursor().

void getError (  ) 

The function returns the errors in the program and calls getLine() to get the lines highlighted.

The errors are loaded in the UTF-8 format into a file selection dialog.

Definition at line 844 of file fileselect.c.

References f_name, file_name, filename, getLine(), and Syntax_highlight().

Referenced by submit_clicked().

static char* getFileName (  )  [static]

The functions helps us getting name of the function executing.

Definition at line 576 of file fileselect.c.

References LoadFile.

Referenced by submit_clicked().

void getLine ( int  no,
int  flag 
)

Have the line no where error occured so go that line in mainfile and retrive the iterators to highlight the line.

Definition at line 585 of file fileselect.c.

References buf, filename, and view.

Referenced by get_Line_At_Cursor(), and getError().

void getLine_error ( int  no,
int  flag 
)

This function highlights the errors in the program when clicked in the error-window.

Definition at line 637 of file fileselect.c.

References buf2, and view2.

Referenced by get_iter_at_cursor().

void gtk_text_view_notify_cursor_position ( GtkTextBuffer *  buffer,
GtkWidget *  v 
)

This function is event handler triggered when the cursor position is changed.

Definition at line 1097 of file fileselect.c.

References get_iter_at_cursor(), and status.

Referenced by main().

void highlight_comments (  ) 

This function would be invoked when the user loads an application and is used to highlight the quotes and comments in the program.

Definition at line 163 of file fileselect.c.

References buf.

Referenced by Syntax_highlight().

void highlight_digits (  ) 

This function would be invoked when the user loads an application and is used to highlight the numbers in the program.

Definition at line 389 of file fileselect.c.

References buf.

Referenced by Syntax_highlight().

void highlight_include (  ) 

This function would be invoked when the user loads an application and is used to highlight the header files and macros in the c program.

Definition at line 70 of file fileselect.c.

References buf.

Referenced by Syntax_highlight().

void highlight_keywords (  ) 

This function would be invoked when the user loads an application and is used to highlight the keywords in the program.

Definition at line 307 of file fileselect.c.

References buf.

Referenced by Syntax_highlight().

static void load_file ( char *  fname  )  [static]

The following function is used to LOAD THE FILE IN UTF-8 format into a file selection dialog.

else displays error.

Definition at line 461 of file fileselect.c.

References buf, buf2, CHAR_BUF, entry, errno, filename, fname1, LoadFile, parseFilename(), status, Syntax_highlight(), and window.

Referenced by file_open(), and main().

void parseFilename ( char *  text  ) 

This function would be invoked to parse the path name to retrieve the filename.

Definition at line 46 of file fileselect.c.

References fname1.

Referenced by load_file(), and save_file().

static gboolean save_file ( char *  fname  )  [static]

The function save_file would save the file in to the directory.

Definition at line 688 of file fileselect.c.

References buf, buf2, CHAR_BUF, entry, errno, filename, fname1, LoadFile, parseFilename(), status, Syntax_highlight(), and window.

Referenced by file_save(), file_saveas(), save_if_modified(), and submit_clicked().

static gboolean save_if_modified ( void   )  [static]

This function is used to prompt the user to save if the buffer is modified whenever he quits the application or loads a new file.

Definition at line 807 of file fileselect.c.

References buf, filename, save_file(), status, and window.

Referenced by delete_event(), file_new(), file_open(), and file_quit().

void submit_clicked ( GtkWidget *  widget,
gpointer  gdata 
)

The following function is triggered when the user clicks on the gcc button used to compile the file selected by the user and display the errors.

Definition at line 894 of file fileselect.c.

References buf2, CHAR_BUF, entry_text, errno, file_name, filename, Fname, getError(), getFileName(), save_file(), status, and window.

Referenced by main().

void Syntax_highlight (  ) 

This function is for the syntax highlighting this in turn calls the functions for highlighting digits, keywords, macros, comments.

Definition at line 444 of file fileselect.c.

References highlight_comments(), highlight_digits(), highlight_include(), and highlight_keywords().

Referenced by getError(), load_file(), and save_file().


Variable Documentation

GtkTextBuffer* buf

GtkTextBuffer * buf1

Definition at line 35 of file fileselect.c.

GtkTextBuffer * buf2

GtkWidget* entry

These give entry text.

Definition at line 12 of file fileselect.c.

Referenced by file_new(), load_file(), main(), and save_file().

gchar* entry_text = " "

Definition at line 13 of file fileselect.c.

Referenced by gcc_entry(), and submit_clicked().

int errno

These variables give us the status, error filenames when loaded.

Definition at line 24 of file fileselect.c.

Referenced by load_file(), save_file(), and submit_clicked().

char f_name[300]

Definition at line 30 of file fileselect.c.

Referenced by get_Line_At_Cursor(), and getError().

char file_name[300]

Definition at line 30 of file fileselect.c.

Referenced by get_Line_At_Cursor(), getError(), and submit_clicked().

char * filename

char* Fname

variables indicating the file name

Definition at line 30 of file fileselect.c.

Referenced by submit_clicked().

char fname1[300]

Definition at line 30 of file fileselect.c.

Referenced by load_file(), parseFilename(), and save_file().

char LoadFile[300]

Definition at line 30 of file fileselect.c.

Referenced by getFileName(), load_file(), and save_file().

int status

GtkWidget* view

These give us text view widgets where all the typing is done.

Definition at line 40 of file fileselect.c.

Referenced by file_new(), file_open(), getLine(), main(), text_find_replace(), and textfind().

GtkWidget * view2

Definition at line 40 of file fileselect.c.

Referenced by getLine_error(), and main().

GtkWidget* window

This creates main window.

Definition at line 18 of file fileselect.c.

Referenced by err_msg(), file_new(), file_quit(), load_file(), main(), save_file(), save_if_modified(), and submit_clicked().


Generated on Wed Apr 7 21:37:10 2010 for C_Editor by  doxygen 1.5.8