/* ---------------------------------------------------------------------------- * Global functions * ---------------------------------------------------------------------------- */ void tracker_init (TrackerInfo* ti) { ti->m_curr_x = 1024; ti->m_curr_y = 768; //ti->m_search_w = 5; //ti->m_search_h = 5; //ti->m_search_w = 25; //ti->m_search_h = 25; ti->m_search_w = 35; ti->m_search_h = 35; /* Allocate memory for score */ ti->m_score_size = sizeof(long) * ti->m_search_w * ti->m_search_h; ti->m_score = (long*) malloc (ti->m_score_size); /* Create template */ create_template (ti); debug_printf ("Created score %p template %p\n", ti->m_score, ti->m_template); }
int create_template_from_current(char* group, const char* name) { char cwd[1023]; if( NULL != getcwd(cwd, 1023) ) { DIR * dirp; int files_size = dirsize(cwd) - 2; char* files[files_size]; if ( NULL != (dirp = opendir(cwd)) ) { struct dirent * file; int i = 0; while( NULL != (file = readdir(dirp)) ) { // puts( file->d_name ); if ( (strcmp( ".", file->d_name ) != 0) && (strcmp ( "..", file->d_name ) != 0) ) { // puts( "Adding file to list." ); int cwd_size = strlen(cwd); int fname_size = strlen(file->d_name); char* path = malloc(sizeof(char) * (cwd_size + fname_size + 2)); memset(path, 0, sizeof(char) * (cwd_size + fname_size + 2)); strcpy( path, cwd ); strcat( path, "/" ); strcat( path, file->d_name ); puts( path ); files[i++] = path; } } closedir(dirp); } int out = create_template(group, name, files, files_size); for (int j = 0; j < files_size; j++) { free(files[j]); } } }
void test_validate_data_and_payload_creation(const axutil_env_t* env) { wsf_wsdl_data_t* data = NULL; wsf_wsdl_data_template_t* data_template = NULL; axis2_bool_t success; axis2_char_t* payload; AXIS2_LOG_DEBUG_MSG(env->log, "[wsf_wsdl_test] Starting test_wsdl_data..."); data = create_params(env); if (data) { AXIS2_LOG_DEBUG_MSG(env->log, "[wsf_wsdl_test]data is not NULL, again a good sign!"); } data_template = create_template(env); if (data_template) { AXIS2_LOG_DEBUG_MSG(env->log, "[wsf_wsdl_test]wow!, even template is not NULL!"); } success = validate_data(env, NULL, data_template, data, VALIDATION_CRITERIA_REQUEST_MODE_TYPE); if (success) { AXIS2_LOG_DEBUG_MSG(env->log, "[wsf_wsdl_test]validation result : SUCCESS!!!"); } payload = create_payload(env, data); AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[wsf_wsdl_test]payload : %s", payload); AXIS2_LOG_DEBUG_MSG(env->log, "[wsf_wsdl_test] Ending test_wsdl_data..."); }
int main(int arg, char *args[]) { set_folder_template(); if(args[1]!=NULL) { printf("Projeto: %s \n",args[1]); if(args[2]!=NULL && verified_folder(args[1])) { path = args[1]; printf("Namespace: %s\n",args[2]); int verified = verified_namespace(args[2]); if(verified==1) { name_space = args[2]; printf("criando pasta do modulo \n"); if(create_folder(args[3])) { module = args[3]; printf("pasta criada \n"); char* option; scanf("tipo do modulo %s\n",&option); printf("%s\n",option); } else { printf("erro ao criar o folder \n"); } } else { printf("não existe namespace com esse nome \n "); if(args[2]!=NULL && verified == 0) { printf("criando o namespace \n"); if(create_folder(args[2])) { name_space = args[2]; chdir(args[2]); printf("criando pasta do modulo \n"); if(create_folder(args[3])) { printf("pasta criada \n"); chdir(args[3]); set_module(args[3]); printf("selecione a opção de módulo que você deseja\n"); printf("1. simples(etc/config.xml, diretório controller e Block ).\n2. básico (todos os diretórios e também o arquivo de configuração). \n"); int option; printf("escolha o tipo do módulo:\n"); scanf("%d",&option); printf("opção escolhida %d\n",option); printf("criando template"); create_template(option); } else { printf("erro ao criar o folder \n"); } }else{ printf("erro ao criar o namespace \n"); } }else{ printf("verifique a estrutura de seu projeto \n"); } } } else printf("Nenhum namespace foi especificado \n"); } else { printf("Nenhum Projeto foi especificado \n"); } return 0; }