changeset 13:30c56504824c

add screptTest
author Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
date Fri, 29 Jun 2012 23:19:02 +0900
parents a6f51c76dea8
children 19b1335632f6
files regen/src/a.out regen/src/grep/grep_jobs.c scriptTest/search.py scriptTest/test.txt
diffstat 4 files changed, 39 insertions(+), 53 deletions(-) [+]
line wrap: on
line diff
Binary file regen/src/a.out has changed
--- a/regen/src/grep/grep_jobs.c	Tue Jun 28 16:25:37 2011 +0900
+++ b/regen/src/grep/grep_jobs.c	Fri Jun 29 23:19:02 2012 +0900
@@ -6,10 +6,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <string.h>
-#include <pthread.h>
-#include "./include/task.h"
 
-/*
 typedef unsigned char UCHAR;
 typedef unsigned char* UCHARP;
 
@@ -24,21 +21,12 @@
   int count;
   char *filename;
 } *ENVP;
-*/
-
 
 void filter(UCHARP beg, UCHARP buf, UCHARP end, ENVP env);
 void predict(UCHARP beg, UCHARP buf, UCHARP end, ENVP env);
 void reject(UCHARP beg, UCHARP buf, UCHARP end, ENVP env);
 void accept(UCHARP beg, UCHARP buf, UCHARP end, ENVP env);
 void s0(UCHARP beg, UCHARP buf, UCHARP end, ENVP env);
-void *s0p(void *p);
-static void run_start();
-void regiTask(TASKP p, UCHARP beg, UCHARP end,  ENVP env);
-void *_read();
-void *_exec();
-void *_write();
-
 #define __REGEX__ "h.s"
 
 UCHARP get_line_beg(UCHARP p, UCHARP beg) {
@@ -75,16 +63,7 @@
   end = beg + size - 1;
   env->count = 0;
 
-  //  s0(beg, beg, end, env);
-
-  int iret;
-  TASK task;
-  pthread_t thread;
-
-  createTask( &task, beg, buf, env, end);
-  iret = pthread_create( &thread, NULL, s0p, (void*)&task );
-  pthread_join( thread, NULL);
-
+  s0(beg, beg, end, env);
 
   munmap(file_mmap, size);
   return;
@@ -178,12 +157,6 @@
   return filter(beg, buf, end, env);
 }
 
-void *s0p(void *p) {
-  THARGP tharg = (THARGP)p;
-  filter(tharg->beg, tharg->buf, tharg->end, tharg->env);
-  return;
-}
-
 void filter(UCHARP beg, UCHARP buf, UCHARP end, ENVP env) {
   static const UCHARP const key = (UCHARP)"h";
   int i, len = 1;
@@ -286,28 +259,3 @@
   beg = buf = ret + 1;
   return s0(beg, buf, end, env);
 }
-
-
-static int division = 16; // in kbyte
-static void
-run_start() {
-
-
-}
-
-void regiTask(TASKP p, UCHARP beg, UCHARP end,  ENVP env){
-
-
-}
-
-void *_read(){
-
-}
-
-void *_exec(){
-
-}
-
-void *_write(){
-
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scriptTest/search.py	Fri Jun 29 23:19:02 2012 +0900
@@ -0,0 +1,17 @@
+#!/usr/bin/python
+
+import re
+
+
+#f = open('~/testProgram/wiki/enwiki20110526.txt', 'r')
+f = open('./test.txt', 'r')
+
+for line in f:
+    if re.search('include', line) : print line
+
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scriptTest/test.txt	Fri Jun 29 23:19:02 2012 +0900
@@ -0,0 +1,21 @@
+#include <stdio.h>
+
+int func() {
+  return 3;
+}
+
+int main(){
+  
+  int a=3;
+  int b=4;
+  int c = a * b * 5;
+  a = 7;
+  a = printf("c = %d\n",c);
+  printf("a = %d\n",a);
+  printf("sizeof(int) = %ld\n",sizeof(int) );
+  printf("sizeof(long) = %ld\n",sizeof(long) );
+  printf("sizeof(double) = %ld\n",sizeof(double) );
+  printf("sizeof(float) = %ld\n",sizeof(float) );
+  return 0;
+}
+