Beispiel #1
0
static void
tag_name_changed (GtkEntry *entry, gpointer user_data)
{
  dt_lib_module_t *self = (dt_lib_module_t *)user_data;
  dt_lib_tagging_t *d   = (dt_lib_tagging_t *)self->data;
  set_keyword(self, d);
}
Beispiel #2
0
void gui_reset(dt_lib_module_t *self)
{
  dt_lib_tagging_t *d = (dt_lib_tagging_t *)self->data;
  // clear entry box and query
  gtk_entry_set_text(d->entry, "");
  set_keyword(self, d);
}
Beispiel #3
0
int set_sub_command(struct PARBLK *parblk, char *cmd)
{
	struct VARIABLE *v;
	int vallen,status;
	char *value,key[12];
	
	v = p_fvar(parblk,"_SUBCMD");
	
	key[0]='\0';
	find_parm(cmd,key,&value,&vallen);
	
	if (key[0]=='-')		/* This must be a subcommand */
	{
			status=set_keyword(parblk,value,vallen,NULL);
			if (status != SUCCESS)
			{
				*(value + vallen) = '\0';
				shvic_make_upper_case(value,value);
				tae_abort(UNDEFSUB,value);
			}
	}
	else					/* subcommand is defaulted */
	{
		if (v->v_dvp == NULL)
			return SUBREQ;			 /* Subcommand can't be defaulted */
		else
		{
			v->v_count = v->v_dcount;/* Set SUBCMD to default */
			v->v_cvp = v->v_dvp;
		}
	}

	return SUCCESS;
}
Beispiel #4
0
		void textbox::set_keywords(const std::string& name, bool case_sensitive, bool whole_word_match, std::initializer_list<std::string> kw_list_utf8)
		{
			internal_scope_guard lock;
			auto editor = get_drawer_trigger().editor();
			if (editor)
			{
				for (auto & kw : kw_list_utf8)
					editor->set_keyword(::nana::charset(kw, ::nana::unicode::utf8), name, case_sensitive, whole_word_match);
			}
		}
Beispiel #5
0
void main() {


   unsigned short kp;
   int nscale=0;
   char txt[3];

        //initializing scale
   char scale[3][3];
   scale[0][0]='H';scale[0][1]='z';scale[0][2]=' ';
   scale[1][0]='K';scale[1][1]='H';scale[1][2]='z';
   scale[2][0]='M';scale[2][1]='H';scale[2][2]='z';
   TRISA= 0;
   TRISB=0;


  Lcd_Init();                              // Initialize LCD
  Lcd_Cmd(_LCD_CLEAR);                     // Clear display
  Lcd_Cmd(_LCD_CURSOR_OFF);                // Cursor off
  Lcd_Out(1, 1, "Freq:");                  // Write message text on LCD
  Lcd_Out(1, 14, "Hz");
  Lcd_Out(2,1,"Signal Generator");
  Keypad_Init();                           // Initialize Keypad
  while(1)
  {
          int freq_array[3]={0,0,0};
          unsigned long freq;

          kp=0;
          kp=Keypad_Key_Click();

          if(kp!=0 && kp!=1 && kp!=2)         //when any number is pressed
          {
                freq_array[0]=freq_array[1];
                freq_array[1]=freq_array[2];
                freq_array[2]=keyidentifier(kp);
                freq=100*freq_array[2]+10*freq_array[1]+freq_array[0];
                LongToStr(freq,txt);
                Lcd_Out(1,6,txt);
          }

          if(kp==2)         //when scale key pressed
          {
                if(nscale==2){
                        nscale=0;
                }
                else
                {
                        nscale=nscale+1;
                }
                Lcd_Out(1,14,scale[nscale]);
          }

          if(kp==1)         //when start is pressed
          {
                  if(nscale==2)
                  {
                          freq=freq*1000000;
                  }
                  else if(nscale==1)
                  {
                          freq=freq*1000;
                  }
                  else
                  {
                          freq=freq;
                  }

                  set_keyword(freq);
                  send_data_ad9850();
          }

  }

}
Beispiel #6
0
void
gui_init (dt_lib_module_t *self)
{
  dt_lib_tagging_t *d = (dt_lib_tagging_t *)malloc(sizeof(dt_lib_tagging_t));
  self->data = (void *)d;
  d->imgsel = -1;

  self->widget = gtk_vbox_new(TRUE, 5);
  gtk_widget_set_size_request(self->widget,100,-1);

  GtkBox *box, *hbox;
  GtkWidget *button;
  GtkWidget *w;
  GtkListStore *liststore;

  // left side, current
  box = GTK_BOX(gtk_vbox_new(FALSE, 0));

  gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(box), TRUE, TRUE, 0);
  w = gtk_scrolled_window_new(NULL, NULL);
  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(w), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
  gtk_box_pack_start(box, w, TRUE, TRUE, 0);
  d->current = GTK_TREE_VIEW(gtk_tree_view_new());
  gtk_tree_view_set_headers_visible(d->current, FALSE);
  liststore = gtk_list_store_new(DT_LIB_TAGGING_NUM_COLS, G_TYPE_STRING, G_TYPE_UINT);
  GtkTreeViewColumn *col = gtk_tree_view_column_new();
  gtk_tree_view_append_column(d->current, col);
  GtkCellRenderer *renderer = gtk_cell_renderer_text_new();
  gtk_tree_view_column_pack_start(col, renderer, TRUE);
  gtk_tree_view_column_add_attribute(col, renderer, "text", DT_LIB_TAGGING_COL_TAG);
  gtk_tree_selection_set_mode(gtk_tree_view_get_selection(d->current),
                              GTK_SELECTION_SINGLE);
  gtk_tree_view_set_model(d->current, GTK_TREE_MODEL(liststore));
  g_object_unref(liststore);
  g_object_set(G_OBJECT(d->current), "tooltip-text", _("attached tags,\ndoubleclick to detach"), (char *)NULL);
  g_signal_connect(G_OBJECT (d->current), "row-activated", G_CALLBACK (detach_activated), (gpointer)self);
  gtk_container_add(GTK_CONTAINER(w), GTK_WIDGET(d->current));

  // attach/detach buttons
  hbox = GTK_BOX(gtk_hbox_new(TRUE, 5));

  button = gtk_button_new_with_label(_("attach"));
  d->attach_button = button;
  g_object_set(G_OBJECT(button), "tooltip-text", _("attach tag to all selected images"), (char *)NULL);
  gtk_box_pack_start(hbox, button, FALSE, TRUE, 0);
  g_signal_connect(G_OBJECT (button), "clicked",
                   G_CALLBACK (attach_button_clicked), (gpointer)self);

  button = gtk_button_new_with_label(_("detach"));
  d->detach_button = button;
  g_object_set(G_OBJECT(button), "tooltip-text", _("detach tag from all selected images"), (char *)NULL);
  g_signal_connect(G_OBJECT (button), "clicked",
                   G_CALLBACK (detach_button_clicked), (gpointer)self);
  gtk_box_pack_start(hbox, button, FALSE, TRUE, 0);

  gtk_box_pack_start(box, GTK_WIDGET(hbox), FALSE, TRUE, 0);

  // right side, related
  box = GTK_BOX(gtk_vbox_new(FALSE, 5));
  gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(box), TRUE, TRUE, 5);

  // text entry and new button
  w = gtk_entry_new();
  g_object_set(G_OBJECT(w), "tooltip-text", _("enter tag name"), (char *)NULL);
  gtk_box_pack_start(box, w, TRUE, TRUE, 0);
  gtk_widget_add_events(GTK_WIDGET(w), GDK_KEY_RELEASE_MASK);
  // g_signal_connect(G_OBJECT(w), "key-release-event",
  g_signal_connect(G_OBJECT(w), "changed",
                   G_CALLBACK(tag_name_changed), (gpointer)self);
  g_signal_connect(G_OBJECT (w), "activate",
                   G_CALLBACK (entry_activated), (gpointer)self);
  d->entry = GTK_ENTRY(w);
  dt_gui_key_accel_block_on_focus_connect(GTK_WIDGET(d->entry));

  // related tree view
  w = gtk_scrolled_window_new(NULL, NULL);
  gtk_widget_set_size_request(w,-1,100);
  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(w), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
  gtk_box_pack_start(box, w, TRUE, TRUE, 0);
  d->related = GTK_TREE_VIEW(gtk_tree_view_new());
  gtk_tree_view_set_headers_visible(d->related, FALSE);
  liststore = gtk_list_store_new(DT_LIB_TAGGING_NUM_COLS, G_TYPE_STRING, G_TYPE_UINT);
  col = gtk_tree_view_column_new();
  gtk_tree_view_append_column(d->related, col);
  renderer = gtk_cell_renderer_text_new();
  gtk_tree_view_column_pack_start(col, renderer, TRUE);
  gtk_tree_view_column_add_attribute(col, renderer, "text", DT_LIB_TAGGING_COL_TAG);
  gtk_tree_selection_set_mode(gtk_tree_view_get_selection(d->related),
                              GTK_SELECTION_SINGLE);
  gtk_tree_view_set_model(d->related, GTK_TREE_MODEL(liststore));
  g_object_unref(liststore);
  g_object_set(G_OBJECT(d->related), "tooltip-text", _("related tags,\ndoubleclick to attach"), (char *)NULL);
  g_signal_connect(G_OBJECT (d->related), "row-activated", G_CALLBACK (attach_activated), (gpointer)self);
  gtk_container_add(GTK_CONTAINER(w), GTK_WIDGET(d->related));

  // attach and delete buttons
  hbox = GTK_BOX(gtk_hbox_new(TRUE, 5));

  button = gtk_button_new_with_label(_("new"));
  d->new_button = button;
  g_object_set(G_OBJECT(button), "tooltip-text", _("create a new tag with the\nname you entered"), (char *)NULL);
  gtk_box_pack_start(hbox, button, FALSE, TRUE, 0);
  g_signal_connect(G_OBJECT (button), "clicked",
                   G_CALLBACK (new_button_clicked), (gpointer)self);

  button = gtk_button_new_with_label(_("delete"));
  d->delete_button = button;
  g_object_set(G_OBJECT(button), "tooltip-text", _("delete selected tag"), (char *)NULL);
  gtk_box_pack_start(hbox, button, FALSE, TRUE, 0);
  g_signal_connect(G_OBJECT (button), "clicked",
                   G_CALLBACK (delete_button_clicked), (gpointer)self);

  gtk_box_pack_start(box, GTK_WIDGET(hbox), FALSE, TRUE, 0);

  // add entry completion
  GtkEntryCompletion *completion = gtk_entry_completion_new();
  gtk_entry_completion_set_model(completion, gtk_tree_view_get_model(GTK_TREE_VIEW(d->related)));
  gtk_entry_completion_set_text_column(completion, 0);
  gtk_entry_completion_set_inline_completion(completion, TRUE);
  gtk_entry_set_completion(d->entry, completion);

  /* connect to mouse over id */
  dt_control_signal_connect(darktable.signals, DT_SIGNAL_MOUSE_OVER_IMAGE_CHANGE, G_CALLBACK(_lib_tagging_redraw_callback), self);
  dt_control_signal_connect(darktable.signals, DT_SIGNAL_TAG_CHANGED, G_CALLBACK(_lib_tagging_tags_changed_callback), self);

  set_keyword(self, d);
}
int main(int argc,char** argv){

/****************funciones de keyword*****************************/
 /*   t_keyword key1;
    t_keyword* key2;
    int set;

    key1.name = (char*)malloc(sizeof(char)*20);
    key1.name = "nombre_de_funcion";

    key1.tag = (char*)malloc(sizeof(char)*20);
    key1.tag = "nombre_de_tag";

    key1.value = (char*)malloc(sizeof(char)*20);
    key1.value = "nombre_de_value";

    key2=(t_keyword*)malloc(sizeof(t_keyword));

    set = straight_list_copy_keyword(key2,&key1);

    if(set==RES_OK){
        printf("key1 name: %s\nkey1 tag: %s\nkey1 value: %s\n",key1.name,key1.tag,key1.value);
        printf("key2 name: %s\nkey2 tag: %s\nkey2 value: %s\n",key2->name,key2->tag,key2->value);
    }

    straight_list_delete_keyword(key2);*/


/******************funciones de lista********************/
/*
    straight_list_t* lista;
    straight_list_t* copia;
    t_keyword* key1;
    t_keyword* key2;
    t_keyword* key3;
    t_keyword* keyaux;
    char linea1[50] = "@function funcion1";
    char linea2[50] = "@descr esta es la primer funcion";
    char linea3[50] = "@author ignacio";

    keyaux = (t_keyword*)malloc(sizeof(t_keyword));
    if(!keyaux)
    {
        printf("ERROR.\n");
        return RES_MEM_ERROR;
    }

    key1 = (t_keyword*)malloc(sizeof(t_keyword));
    if(!key1)
    {
        free(keyaux);
        printf("ERROR.\n");
        return RES_MEM_ERROR;
    }

    key2 = (t_keyword*)malloc(sizeof(t_keyword));
    if(!key2)
    {
        free(key1);
        free(keyaux);
        printf("ERROR.\n");
        return RES_MEM_ERROR;
    }

    key3 = (t_keyword*)malloc(sizeof(t_keyword));
    if(!key3){
        free(key2);
        free(key1);
        free(keyaux);
        printf("ERROR.\n");
        return RES_MEM_ERROR;
    }

    lista=(straight_list_t*)malloc(sizeof(straight_list_t));
    if(!lista){
        free(key3);
        free(key2);
        free(key1);
        printf("ERROR.\n");
        free(keyaux);
        return RES_MEM_ERROR;
    }

    copia=(straight_list_t*)malloc(sizeof(straight_list_t));
    if(!copia){
        free(lista);
        free(key3);
        free(key2);
        free(key1);
        printf("ERROR.\n");
        free(keyaux);
        return RES_MEM_ERROR;
    }

    printf("Creo las listas.\n");
    straight_list_create(lista, sizeof(t_keyword), straight_list_copy_keyword, straight_list_delete_keyword);

    printf("Inicializo los structs.\n");
    set_keyword(key1,linea1);
    set_keyword(key2,linea2);
    set_keyword(key3,linea3);

    printf("key1 name: %s\nkey1 tag: %s\nkey1 value: %s\n",key1->name,key1->tag,key1->value);
    printf("key2 name: %s\nkey2 tag: %s\nkey2 value: %s\n",key2->name,key2->tag,key2->value);
    printf("key3 name: %s\nkey3 tag: %s\nkey3 value: %s\n",key3->name,key3->tag,key3->value);

    straight_list_insert(lista,straight_list_first,key1);
    straight_list_insert(lista,straight_list_next,key2);
    straight_list_insert(lista,straight_list_next,key3);

    printf("Ya inserté en la lista original.\n");

    straight_list_move(lista,straight_list_first);
    do{
        straight_list_get(lista,keyaux);
        printf("keyaux name: %s\nkeyaux tag: %s\nkeyaux value: %s\n",keyaux->name,keyaux->tag,keyaux->value);
        free(keyaux->name);
        free(keyaux->tag);
        free(keyaux->value);
    }while(straight_list_move(lista,straight_list_next));

    printf("ahora copia la lista\n");

    printf("creo la lista\n");
    if(straight_list_create(copia, sizeof(t_keyword), straight_list_copy_keyword, straight_list_delete_keyword)==RES_OK) printf("inicializo la copia\n");
    if(straight_list_copy_listado(copia,lista)==RES_OK) printf("relleno la copia.\n");
    if(straight_list_move(copia,straight_list_first)==TRUE) printf("muevo el corriente de la copia al primero\n");
    straight_list_get(copia,keyaux);
    printf("obtengo el corriente\n");

    printf("%s\n",keyaux->tag);

    printf("ahora me fijo el contenido de la copia\n");
    do{
        straight_list_get(copia,keyaux);
        printf("keyaux name: %s\nkeyaux tag: %s\nkeyaux value: %s\n",keyaux->name,keyaux->tag,keyaux->value);
        free(keyaux->name);
        free(keyaux->tag);
        free(keyaux->value);
    }while(straight_list_move(copia,straight_list_next));

    printf("ahora se elimina la lista copia\n");
    straight_list_delete_listado(copia);
    free(copia);
    printf("se elimina la lista original\n");
    straight_list_delete_listado(lista);
    printf("se elimina el puntero original\n");
    free(lista);

    straight_list_delete_keyword(keyaux);
    straight_list_delete_keyword(key1);
    straight_list_delete_keyword(key2);
    straight_list_delete_keyword(key3);
    free(keyaux);
    free(key1);
    free(key2);
    free(key3);
    return RES_OK;
*/
 /********insercion ordenada**************/
    straight_list_t* lista;
    t_keyword* key1;
    t_keyword* key2;
    t_keyword* key3;
    t_keyword* keyaux;
    char linea1[50] = "@funcion a";
    char linea2[50] = "@funcion b";
    char linea3[50] = "@funcion c";

    keyaux = (t_keyword*)malloc(sizeof(t_keyword));
    if(!keyaux)
    {
        printf("ERROR.\n");
        return RES_MEM_ERROR;
    }

    key1 = (t_keyword*)malloc(sizeof(t_keyword));
    if(!key1)
    {
        free(keyaux);
        printf("ERROR.\n");
        return RES_MEM_ERROR;
    }

    key2 = (t_keyword*)malloc(sizeof(t_keyword));
    if(!key2)
    {
        free(key1);
        free(keyaux);
        printf("ERROR.\n");
        return RES_MEM_ERROR;
    }

    key3 = (t_keyword*)malloc(sizeof(t_keyword));
    if(!key3){
        free(key2);
        free(key1);
        free(keyaux);
        printf("ERROR.\n");
        return RES_MEM_ERROR;
    }

    lista=(straight_list_t*)malloc(sizeof(straight_list_t));
    if(!lista){
        free(key3);
        free(key2);
        free(key1);
        printf("ERROR.\n");
        free(keyaux);
        return RES_MEM_ERROR;
    }

    printf("Creo la lista.\n");
    straight_list_create(lista, sizeof(t_keyword), straight_list_copy_keyword, straight_list_delete_keyword);

    printf("Inicializo los structs.\n");
    set_keyword(key1,linea1);
    set_keyword(key2,linea2);
    set_keyword(key3,linea3);

    printf("key1 name: %s\nkey1 tag: %s\nkey1 value: %s\n",key1->name,key1->tag,key1->value);
    printf("key2 name: %s\nkey2 tag: %s\nkey2 value: %s\n",key2->name,key2->tag,key2->value);
    printf("key3 name: %s\nkey3 tag: %s\nkey3 value: %s\n",key3->name,key3->tag,key3->value);

    straight_list_order_insert(lista,key3);
    straight_list_order_insert(lista,key1);
    straight_list_order_insert(lista,key2);

    printf("Ya inserté en la lista.\n");

    straight_list_move(lista,straight_list_first);
    do{
        straight_list_get(lista,keyaux);
        printf("key name: %s\nkey tag: %s\nkey value: %s\n",keyaux->name,keyaux->tag,keyaux->value);
        straight_list_delete_keyword(keyaux);
    }while(straight_list_move(lista,straight_list_next));

    printf("se elimina la lista original\n");
    straight_list_delete_listado(lista);
    printf("se elimina el puntero original\n");
    free(lista);

    straight_list_delete_keyword(keyaux);
    straight_list_delete_keyword(key1);
    straight_list_delete_keyword(key2);
    straight_list_delete_keyword(key3);
    free(keyaux);
    free(key1);
    free(key2);
    free(key3);
    return RES_OK;

}
/*
@funcion extractDocumentationFromFile
@descr Lee el archivo de entrada y va almacenando en la estructura la información de los comentarios puestos en este. Agrega en el archivo de salida la información.
@autor Ignacio
@fecha 14/11/2015
@version "1.0"
@param docu referencia al documentador
@param html archivo de salida de datos
@param iFile archivo de entrada de datos
@pre docu creado.
@pos Recorre iFile linea por linea. Cuando identifica que encontró un comentario, agrega en el archivo de salida la información de cada comentario. Crea dos listas, una con la información y otra de indice. Devuelve RES_OK si pudo operar sin problemas y RES_MEM_ERROR si tuvo problemas de memoria. RES_ERROR en el caso de que no pudo abrir alguno de los archivos.
*/
int extractDocumentationFromFile(TDA_Doc *docu, htmlFile *html, char *iFile) {
    FILE *inputFile;
    straight_list_t* listado_aux;
    t_keyword* keyword;
    int cinit = 0;
    int cend = 0;
    int got_key = 0;
    char linea[MAX_LINE];
    char *stoken, *etoken;
    straight_list_movement_t mov = straight_list_first;
    straight_list_movement_t mov_aux = straight_list_first;

    logInfo(docu->logFile,"Entro en extractDocumentationFromFile.");
    logInfo(docu->logFile,"Abro archivo de entrada.");
    inputFile = fopen(iFile, "r");
    if (!inputFile) {
        logError(docu->logFile,MSG_ERROR_IN_FILE);
        return RES_ERROR;
    }
    logInfo(docu->logFile,"Creo (pido recursos) las listas listado e indice del documentador.");
    if(straight_list_create(docu->listado, sizeof(straight_list_t), straight_list_copy_listado, straight_list_delete_listado)!=RES_OK) {
        logError(docu->logFile,MSG_ERROR_CREATE_LIST);
        fclose(inputFile);
        return RES_ERROR;
    }
    if(straight_list_create(docu->indice, sizeof(t_keyword), straight_list_copy_keyword, straight_list_delete_keyword)!=RES_OK) {
        logError(docu->logFile,MSG_ERROR_CREATE_LIST);
        straight_list_delete(docu->listado);
        fclose(inputFile);
        return RES_ERROR;
    }

    logInfo(docu->logFile,"Pido recursos para lista auxiliar.");
    listado_aux = (straight_list_t*)malloc(sizeof(straight_list_t));
    if(!listado_aux) {
        logError(docu->logFile,MSG_ERROR_CREATE_LIST);
        straight_list_delete(docu->indice);
        straight_list_delete(docu->listado);
        fclose(inputFile);
        return RES_ERROR;
    }

    if(straight_list_create(listado_aux, sizeof(t_keyword), straight_list_copy_keyword, straight_list_delete_keyword)!=RES_OK) {
        logError(docu->logFile,MSG_ERROR_CREATE_LIST);
        straight_list_delete(docu->listado);
        straight_list_delete(docu->indice);
        straight_list_delete(listado_aux);
        free(listado_aux);
        fclose(inputFile);
        return RES_ERROR;
    }

    logInfo(docu->logFile,"Pido recursos para t_keyword auxiliar.");
    keyword = (t_keyword*)malloc(sizeof(t_keyword));
    if(!keyword) {
        logError(docu->logFile,MSG_ERROR_CREATE_LIST);
        straight_list_delete(docu->indice);
        straight_list_delete(docu->listado);
        straight_list_delete(listado_aux);
        free(listado_aux);
        fclose(inputFile);
        return RES_ERROR;
    }

    logInfo(docu->logFile,"Empiezo a recorrer el archivo.");
    while (!feof(inputFile)) {
        /* TODO: get line dinamico */
        if (fgets(linea, MAX_LINE-1, inputFile) != NULL) {
            stoken = strstr(linea, KW_INIT);
            etoken = strstr(linea, KW_END);

            if ((stoken) && (!etoken)) {
            /* empieza un comentario */
                cinit = 1;
            } else if ((!stoken) && (etoken)) {
            /* termina un comentario */
                cend = 1;
                logInfo(docu->logFile,"Terminó un comentario.");
            }

            if (cinit==1 && cend==0)
            {
                /* mientras que esté dentro del comentario */
                /* armo el listado auxiliar*/
                if (checkForKW(linea) == 0)
                {
                /* encontramos una keyword */
                    set_keyword(keyword,linea);
                    printf("%s\n",keyword->tag);
                /* guardo en la lista auxiliar */
                    if(!straight_list_is_empty(listado_aux))
                        mov_aux = straight_list_next;
                    else
                        mov_aux = straight_list_first;

                    if(!straight_list_insert(listado_aux, mov_aux,keyword)) {
                        logError(docu->logFile,MSG_ERROR_MEMORY);
                        straight_list_destroy(listado_aux);
                        straight_list_destroy(docu->listado);
                        straight_list_destroy(docu->indice);
                        straight_list_delete_keyword(keyword);
                        free(listado_aux);
                        free(keyword);
                        fclose(inputFile);
                        return RES_ERROR;
                    }
                    straight_list_delete_keyword(keyword);
                }
            }
            else if (cinit==1 && cend==1)
            {
                logInfo(docu->logFile,"Termino el comentario de la función, ahora inserto en la lista docu->listado de manera ordenada las funciones.");
                /* en la función de búsqueda habrá que tener en cuenta qué tomar para la comparación */
                if(!straight_list_is_empty(docu->listado))
                    mov = straight_list_next;
                else
                    mov = straight_list_first;
                if(!straight_list_insert(docu->listado,mov,listado_aux)) {
                    /* tuvo problemas de memoria para insertar */
                    logError(docu->logFile,MSG_ERROR_MEMORY);
                    straight_list_destroy(listado_aux);
                    straight_list_destroy(docu->listado);
                    straight_list_destroy(docu->indice);
                    straight_list_delete_keyword(keyword);
                    free(listado_aux);
                    free(keyword);
                    fclose(inputFile);
                    return RES_ERROR;
                }
                logInfo(docu->logFile,"Mando a insertar en el archivo html de salida.");
                /*TODO un get del struct con el nombre para pasar al parser*/
                printf("Mando a insertar en el archivo html de salida.\n");

                parseStringToHtml(html,listado_aux); /*lo mando al html*/
                /* reinicializo las variables auxiliares*/
                printf("paso el html\n");
                logInfo(docu->logFile,"Reinicializo las variables auxiliares.");
                cinit = 0; cend = 0;
                /* como ya inserté los tags/keywords de una funcion, destruto la lista auxiliar */
                straight_list_destroy(listado_aux);
            }
            else if ((cinit==0 && cend==1)||(cinit==1 && stoken)) {
                /* está mal hecho algún comentario, libero los recursos y salgo */
                logError(docu->logFile,MSG_ERROR_BAD_COMMENT);
                logError(docu->logFile,stoken);
                straight_list_delete(listado_aux);
                straight_list_delete(docu->indice);
                straight_list_delete(docu->listado);
                straight_list_delete_keyword(keyword);
                free(listado_aux);
                free(keyword);
                fclose(inputFile);
                return RES_ERROR;
            }
        }
    }

    /* libero los recursos de listado_aux y cierro el archivo de entrada ya que no lo necesito más */
    logInfo(docu->logFile,"Libero los recursos de listado_aux y cierro el archivo de entra ya que no lo necesito más.");
    straight_list_delete(listado_aux);
    straight_list_delete_keyword(keyword);
    fclose(inputFile);

    /* ahora armo la lista del indice ordenada*/
    logInfo(docu->logFile,"Empiezo a armar la lista del indice pero ordenada.");
    straight_list_move(docu->listado,straight_list_first);

    do {
        logInfo(docu->logFile,"Tomo un elemento lista del documentador y lo guardo en listado_aux.");
        straight_list_get(docu->listado,listado_aux);
        /* recorro el elemento lista*/
        straight_list_move(listado_aux,straight_list_first);
        do{
            straight_list_get(listado_aux,keyword);
            if(strcmp(keyword->tag,KW_FUNCTION)==0)
            {
                /* encontré el tag de funcion */
                /* inserto en la lista del indice de docu */
                logInfo(docu->logFile,"Encontré un tag de función y lo inserto en el docu->indice.");
                if(!straight_list_order_insert(docu->indice,keyword)) {
                    /* tuvo problemas de memoria para insertar */
                    logError(docu->logFile,MSG_ERROR_MEMORY);
                    straight_list_destroy(listado_aux);
                    straight_list_destroy(docu->listado);
                    straight_list_destroy(docu->indice);
                    straight_list_delete_keyword(keyword);
                    free(listado_aux);
                    free(keyword);
                    fclose(inputFile);
                    return RES_MEM_ERROR;
                }
                got_key = 1;
            }
            straight_list_delete_keyword(keyword);
        } while (straight_list_move(listado_aux,straight_list_next)!=FALSE||got_key==0);
        got_key = 0;
        straight_list_destroy(listado_aux);
    } while (straight_list_move(docu->listado,straight_list_next)!=FALSE);

    free(keyword);
    free(listado_aux);

    return RES_OK;
}