Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix copyright headers
[simgrid.git] / src / java / jmsg_task.c
index 21efd57..8ce5de8 100644 (file)
@@ -1,55 +1,51 @@
-/*
- * $Id$
- *
- * Copyright 2006,2007 Martin Quinson, Malek Cherier All right reserved. 
- *
- * This program is free software; you can redistribute it and/or modify it 
- * under the terms of the license (GNU LGPL) which comes with this package.
- *
- * This contains the implementation of the functions in relation with the java
- * task instance. 
- */
+/* Functions related to the java task instances.                            */
+
+/* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+  * under the terms of the license (GNU LGPL) which comes with this package. */
+
 #include "jmsg.h"
 #include "jmsg_task.h"
 #include "jxbt_utilities.h"
 
-jobject
-jtask_new_global_ref(jobject jtask,JNIEnv* env) {
-  return (*env)->NewGlobalRef(env,jtask); 
+jobject jtask_new_global_ref(jobject jtask, JNIEnv * env)
+{
+  return (*env)->NewGlobalRef(env, jtask);
 }
 
-void
-jtask_delete_global_ref(jobject jtask,JNIEnv* env) {
-  (*env)->DeleteGlobalRef(env,jtask);
+void jtask_delete_global_ref(jobject jtask, JNIEnv * env)
+{
+  (*env)->DeleteGlobalRef(env, jtask);
 }
 
-void
-jtask_bind(jobject jtask,m_task_t task,JNIEnv* env) {
-  jfieldID id = jxbt_get_sfield(env,"simgrid/msg/Task","bind", "J");
-    
-  if(!id)
+void jtask_bind(jobject jtask, m_task_t task, JNIEnv * env)
+{
+  jfieldID id = jxbt_get_sfield(env, "simgrid/msg/Task", "bind", "J");
+
+  if (!id)
     return;
 
-  (*env)->SetLongField(env,jtask,id,(jlong)(long)(task));       
+  (*env)->SetLongField(env, jtask, id, (jlong) (long) (task));
 }
 
-m_task_t
-jtask_to_native_task(jobject jtask,JNIEnv* env) {
-  jfieldID id = jxbt_get_sfield(env,"simgrid/msg/Task","bind", "J");
-    
-  if(!id)
+m_task_t jtask_to_native_task(jobject jtask, JNIEnv * env)
+{
+  jfieldID id = jxbt_get_sfield(env, "simgrid/msg/Task", "bind", "J");
+
+  if (!id)
     return NULL;
-    
-  return (m_task_t)(long)(*env)->GetLongField(env,jtask,id);   
+
+  return (m_task_t) (long) (*env)->GetLongField(env, jtask, id);
 }
 
-jboolean
-jtask_is_valid(jobject jtask,JNIEnv* env) {
-  jfieldID id = jxbt_get_sfield(env,"simgrid/msg/Task","bind", "J");
-    
-  if(!id)
+jboolean jtask_is_valid(jobject jtask, JNIEnv * env)
+{
+  jfieldID id = jxbt_get_sfield(env, "simgrid/msg/Task", "bind", "J");
+
+  if (!id)
     return JNI_FALSE;
-    
-  return (*env)->GetLongField(env,jtask,id) ? JNI_TRUE : JNI_FALSE;
+
+  return (*env)->GetLongField(env, jtask, id) ? JNI_TRUE : JNI_FALSE;
 }