Beispiel #1
0
int finalize (POSTER_ID id)
{
	posterDelete(id);
	free(ref_name);

	return 0;
}
Beispiel #2
0
static PyObject*
Velodyne_finalize(Velodyne* self)
{
	posterDelete(self->id);

	Py_RETURN_NONE;
}
Beispiel #3
0
static PyObject*
Stereopixel_finalize(Stereopixel* self)
{
	posterDelete(self->id);

	Py_RETURN_NONE;
}
Beispiel #4
0
int 
main(int argc, char *argv[])
{
	POSTER_ID p1, p2, p3;

	if (h2initGlob(0) == ERROR) {
		h2perror("h2initGlob");
		exit(2);
	}
	if (posterCreate(TEST_POSTER_NAME, TEST_POSTER_SIZE, &p1) == ERROR){
		h2perror("posterCreate");
		exit(2);
	}
	if (posterFind(TEST_POSTER_NAME, &p2) == ERROR) {
		h2perror("posterFind");
		exit(2);
	}
	if (posterDelete(p1) == ERROR) {
		h2perror("posterDelete");
		exit(2);
	}
	if (posterFind(TEST_POSTER_NAME, &p3) == OK) {
		fprintf(stderr, "posterFind on a closed poster succeded!\n");
		exit(3);
	}
	exit(0);
}
Beispiel #5
0
static int testEnd(POSTER_ID posterId)
{
  if(posterDelete(posterId) == ERROR) {
    h2perror ("testPosterWrite: posterDelete failed\n");
  }
  printf ("testPosterWrite: poster deleted, Bye\n");
  return 1;
}
Beispiel #6
0
int
main(int argc, char **argv)
{
    char *nom;
    int i;
    POSTER_ID id;
    
    if (argc == 1) {
	nom = "test";
    } else {
	nom = argv[1];
    }

    if (posterCreate(nom, sizeof(int), &id) != OK) {
	printf("Error posterCreate %x\n", errnoGet());
	h2printErrno(errnoGet());
	exit(-1);
    }
    
    while (1) {

	scanf("%d", &i);
	/* 	
	posterWrite(id, 0, &i, sizeof(int));
	*/

	if (posterTake(id, POSTER_WRITE) == ERROR) {
		fprintf(stderr, "Error posterTake: ");
		h2printErrno(errnoGet());
	}
	*(int *)posterAddr(id) = i;
	if (posterGive(id) == ERROR) {
		fprintf(stderr, "Error posterGive: ");
		h2printErrno(errnoGet());
	}

	if (i == -1) {
	    printf("Bye\n");
	    posterDelete(id);
	    exit(0);
	}
    }
    return 0;
}
Beispiel #7
0
int finalize (POSTER_ID id)
{
	posterDelete(id);

	return 0;
}