Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /sml/trunk/src/runtime/kernel/qualify-name.c
ViewVC logotype

Annotation of /sml/trunk/src/runtime/kernel/qualify-name.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 651 - (view) (download) (as text)

1 : monnier 249 /* qualify-name.c
2 :     *
3 :     * COPYRIGHT (c) 1996 AT&T Research.
4 :     */
5 :    
6 : blume 569 #include <string.h>
7 : monnier 249 #include "ml-base.h"
8 :     #include "machine-id.h"
9 :    
10 :     #define SUFFIX MACHINE_ID "-" OPSYS_ID
11 :    
12 :     /* QualifyImageName:
13 :     *
14 :     * Given a pathname for an image file, this adds the architecture extension
15 :     * to the pathname (if it doesn't already have it). It returns TRUE, if the
16 :     * extension was added.
17 :     */
18 :     bool_t QualifyImageName (char *buf)
19 :     {
20 :     int len = strlen(buf);
21 :     int midLen = sizeof(SUFFIX); /* length of ID + 1 */
22 :    
23 :     if ((midLen+1 < len) && (buf[len-midLen] == '.')
24 :     && (strcmp(&(buf[len-(midLen-1)]), SUFFIX) == 0))
25 :     /* the pathname is already qualified by the machine ID and OPSYS */
26 :     return FALSE;
27 :    
28 :     strcat (buf, "." SUFFIX);
29 :    
30 :     return TRUE;
31 :    
32 :     } /* end of QualifyImageName */
33 :    

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0