Subversion Repositories filter_foundry

Rev

Rev 2 | Rev 18 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 15
Line 44... Line 44...
44
        int i,j,chunk,n;
44
        int i,j,chunk,n;
45
        OSErr e;
45
        OSErr e;
46
        long est;
46
        long est;
47
        static char afs_sig[] = "%RGB-1.0\n";
47
        static char afs_sig[] = "%RGB-1.0\n";
48
       
48
       
-
 
49
        if(!h) DBG("saveparams: Null handle!");
-
 
50
       
49
        est = strlen(expr[0])+strlen(expr[1])+strlen(expr[2])+strlen(expr[3]);
51
        est = strlen(expr[0]) + strlen(expr[1]) + strlen(expr[2]) + strlen(expr[3]);
50
        est += strlen(afs_sig) + est/CHOPLINES + 4 + 8*6 + 1024 /*slop*/ ;
52
        est += strlen(afs_sig) + est/CHOPLINES + 4 + 8*6 + 64 /*slop*/ ;
51
       
53
       
-
 
54
        PIUNLOCKHANDLE(h); // should not be necessary
52
        if( !(e = PISETHANDLESIZE(h,est)) && (p = start = PILOCKHANDLE(h,false)) ){
55
        if( !(e = PISETHANDLESIZE(h,est)) && (p = start = PILOCKHANDLE(h,false)) ){
53
                p = cat(p,afs_sig);
56
                p = cat(p,afs_sig);
54
               
57
               
55
                /* slider values */
58
                /* slider values */
56
                for( i=0 ; i<8 ; ++i ){
59
                for( i=0 ; i<8 ; ++i ){
57
                        p = int_str(p,slider[i],10);
60
                        p = int_str(p,slider[i],10);
58
                        *p++ = '\n';
61
                        *p++ = '\n';
59
                }
62
                }
60
               
63
               
61
                /* expressions */
64
                /* expressions */
62
                if(!e)
-
 
63
                        for( i=0 ; i<4 ; ++i ){
65
                for( i=0 ; i<4 ; ++i ){
64
                                if(r = expr[i])
66
                        if(r = expr[i])
65
                                        for( n = strlen(r) ; n ; n -= chunk ){
67
                                for( n = strlen(r) ; n ; n -= chunk ){
66
                                                chunk = n>CHOPLINES ? CHOPLINES : n;
68
                                        chunk = n>CHOPLINES ? CHOPLINES : n;
67
                                                for( j = chunk,q = outbuf ; j-- ; )
69
                                        for( j = chunk,q = outbuf ; j-- ; )
Line 77... Line 79...
77
                                        }
79
                                }
78
                                else
80
                        else
79
                                        p = cat(p,"(null expr)\n"); // this shouldn't happen
81
                                p = cat(p,"(null expr)\n"); // this shouldn't happen
80
                                *p++ = '\n';
82
                        *p++ = '\n';
81
                        }
83
                }
-
 
84
 
-
 
85
//              *p = 0; dbg(start);
-
 
86
 
82
                PIUNLOCKHANDLE(h);
87
                PIUNLOCKHANDLE(h);
-
 
88
                e = PISETHANDLESIZE(h,p - start); // could ignore this error, maybe
83
                if(!e)
89
        }else{char s[100];
-
 
90
                //alertuser("saveparams","couldn't resize (or lock) parameters!");
84
                        e = PISETHANDLESIZE(h,p - start);
91
                //sprintf(s,"est=%d e=%d ",est,e);dbg(s);
85
        }
92
        }
86
err:
93
err:
87
        return e;
94
        return e;
88
}
95
}
89
 
96