Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Lowercase PID in function name (2/2 - public part).
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 17 Mar 2021 22:45:43 +0000 (23:45 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 18 Mar 2021 09:24:53 +0000 (10:24 +0100)
Changed: sg_actor_get_PID, sg_actor_get_PPID, sg_actor_by_PID

ChangeLog
docs/source/app_s4u.rst
include/simgrid/actor.h
src/bindings/java/jmsg_process.cpp
src/msg/msg_legacy.cpp
src/s4u/s4u_Actor.cpp

index 67accfc..d7642ea 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -25,6 +25,9 @@ S4U:
 XBT:
  - Drop simgrid::xbt::demangle. Please use boost::core::demangle instead.
 
+C binding and interface:
+ - Rename (lowercase) functions sg_actor_get_PID, sg_actor_get_PPID, sg_actor_by_PID.
+
 Documentation:
  - New section: Configuring the logs from the command line.
  - New section: Programming API of logs.
index 635016b..0c85251 100644 (file)
@@ -491,7 +491,7 @@ Retrieving actors
 
    .. group-tab:: C
 
-      .. doxygenfunction:: sg_actor_by_PID(aid_t pid)
+      .. doxygenfunction:: sg_actor_by_pid(aid_t pid)
       .. doxygenfunction:: sg_actor_self()
 
 Querying info
@@ -525,8 +525,8 @@ Querying info
    .. group-tab:: C
 
       .. doxygenfunction:: sg_actor_get_name(const_sg_actor_t actor)
-      .. doxygenfunction:: sg_actor_get_PID(const_sg_actor_t actor)
-      .. doxygenfunction:: sg_actor_get_PPID(const_sg_actor_t actor)
+      .. doxygenfunction:: sg_actor_get_pid(const_sg_actor_t actor)
+      .. doxygenfunction:: sg_actor_get_ppid(const_sg_actor_t actor)
       .. doxygenfunction:: sg_actor_get_properties(const_sg_actor_t actor)
       .. doxygenfunction:: sg_actor_get_property_value(const_sg_actor_t actor, const char *name)
 
index b8b1481..62b5fc6 100644 (file)
@@ -35,9 +35,14 @@ XBT_PUBLIC void sg_actor_set_stacksize(sg_actor_t actor, unsigned size);
 XBT_PUBLIC void sg_actor_exit();
 XBT_PUBLIC void sg_actor_on_exit(void_f_int_pvoid_t fun, void* data);
 
-XBT_PUBLIC aid_t sg_actor_get_PID(const_sg_actor_t actor);
-XBT_PUBLIC aid_t sg_actor_get_PPID(const_sg_actor_t actor);
-XBT_PUBLIC sg_actor_t sg_actor_by_PID(aid_t pid);
+XBT_PUBLIC aid_t sg_actor_get_pid(const_sg_actor_t actor);
+XBT_PUBLIC aid_t sg_actor_get_ppid(const_sg_actor_t actor);
+XBT_PUBLIC sg_actor_t sg_actor_by_pid(aid_t pid);
+XBT_ATTRIB_DEPRECATED_v331("Please use sg_actor_get_pid() instead") XBT_PUBLIC aid_t
+    sg_actor_get_PID(const_sg_actor_t actor);
+XBT_ATTRIB_DEPRECATED_v331("Please use sg_actor_get_ppid() instead") XBT_PUBLIC aid_t
+    sg_actor_get_PPID(const_sg_actor_t actor);
+XBT_ATTRIB_DEPRECATED_v331("Please use sg_actor_by_pid() instead") XBT_PUBLIC sg_actor_t sg_actor_by_PID(aid_t pid);
 XBT_PUBLIC const char* sg_actor_get_name(const_sg_actor_t actor);
 XBT_PUBLIC sg_host_t sg_actor_get_host(const_sg_actor_t actor);
 XBT_PUBLIC const char* sg_actor_get_property_value(const_sg_actor_t actor, const char* name);
index 3f88eac..1ab550c 100644 (file)
@@ -111,7 +111,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_killAll(JNIEnv* env, jclass
 
 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_fromPID(JNIEnv * env, jclass cls, jint pid)
 {
-  auto const* actor = sg_actor_by_PID(pid);
+  auto const* actor = sg_actor_by_pid(pid);
 
   if (not actor) {
     jxbt_throw_process_not_found(env, std::string("PID = ") + std::to_string(static_cast<int>(pid)));
@@ -131,7 +131,7 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_fromPID(JNIEnv * env, jcl
 JNIEXPORT jint JNICALL Java_org_simgrid_msg_Process_nativeGetPID(JNIEnv* env, jobject jprocess)
 {
   const_sg_actor_t actor = jprocess_to_native(jprocess, env);
-  return sg_actor_get_PID(actor);
+  return sg_actor_get_pid(actor);
 }
 
 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_getProperty(JNIEnv *env, jobject jprocess, jobject jname) {
index 79ea9ab..bcbfd0c 100644 (file)
@@ -62,15 +62,15 @@ void MSG_process_on_exit(int_f_int_pvoid_t fun, void* data)
 
 int MSG_process_get_PID(const_sg_actor_t actor)
 {
-  return sg_actor_get_PID(actor);
+  return sg_actor_get_pid(actor);
 }
 int MSG_process_get_PPID(const_sg_actor_t actor)
 {
-  return sg_actor_get_PPID(actor);
+  return sg_actor_get_ppid(actor);
 }
-msg_process_t MSG_process_from_PID(int PID)
+msg_process_t MSG_process_from_PID(int pid)
 {
-  return sg_actor_by_PID(PID);
+  return sg_actor_by_pid(pid);
 }
 const char* MSG_process_get_name(const_sg_actor_t actor)
 {
index 7e619bb..3770e80 100644 (file)
@@ -522,7 +522,7 @@ void sg_actor_exit()
  * This function checks whether @a actor is a valid pointer and return its PID (or 0 in case of problem).
  */
 
-aid_t sg_actor_get_PID(const_sg_actor_t actor)
+aid_t sg_actor_get_pid(const_sg_actor_t actor)
 {
   /* Do not raise an exception here: this function is called by the logs
    * and the exceptions, so it would be called back again and again */
@@ -537,7 +537,7 @@ aid_t sg_actor_get_PID(const_sg_actor_t actor)
  * This function checks whether @a actor is a valid pointer and return its parent's PID.
  * Returns -1 if the actor has not been created by any other actor.
  */
-aid_t sg_actor_get_PPID(const_sg_actor_t actor)
+aid_t sg_actor_get_ppid(const_sg_actor_t actor)
 {
   return actor->get_ppid();
 }
@@ -549,11 +549,26 @@ aid_t sg_actor_get_PPID(const_sg_actor_t actor)
  * If none is found, @c nullptr is returned.
    Note that the PID are unique in the whole simulation, not only on a given host.
  */
-sg_actor_t sg_actor_by_PID(aid_t pid)
+sg_actor_t sg_actor_by_pid(aid_t pid)
 {
   return simgrid::s4u::Actor::by_pid(pid).get();
 }
 
+aid_t sg_actor_get_PID(const_sg_actor_t actor) // XBT_ATTRIB_DEPRECATED_v331
+{
+  return sg_actor_get_pid(actor);
+}
+
+aid_t sg_actor_get_PPID(const_sg_actor_t actor) // XBT_ATTRIB_DEPRECATED_v331
+{
+  return sg_actor_get_ppid(actor);
+}
+
+sg_actor_t sg_actor_by_PID(aid_t pid) // XBT_ATTRIB_DEPRECATED_v331
+{
+  return sg_actor_by_pid(pid);
+}
+
 /** @brief Return the name of an actor. */
 const char* sg_actor_get_name(const_sg_actor_t actor)
 {