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 250 - (view) (download) (as text)

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

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